From b14ca0169babf5bd2a599b19ee156427b822ab00 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 25 Feb 2010 16:12:56 +0100 Subject: linux-omap-psp 2.6.32: update to latest PSP git * refresh patches and make them all git am'able * Add initial beagleboardXM support * make it the default for beagleboard * turn off rtc-ds1307 since it renders beagles without zippy expansion boards unbootable * PSP git broke multi usb gadget, disable it for now --- ...-Overo-Add-support-for-second-ethernet-po.patch | 110 - ...touchbook-make-it-build-against-TI-linux-.patch | 61 + ...3touchbook-make-it-build-against-TI-linux.patch | 61 - ...d-support-for-TCT-Zippy-to-Beagle-board-f.patch | 135 ++ ...-ehci-omap-use-new-location-for-usb.h-inc.patch | 25 - ...MAP-Make-beagle-u-boot-partition-writable.patch | 24 + ...net-smsc911x-return-ENODEV-if-device-is-n.patch | 29 - .../0004-board-omap3-beagle-add-DSS2-support.patch | 200 ++ ...s-input-touchscreen-ads7846-return-ENODEV.patch | 53 - ...add-support-for-TCT-Zippy-to-Beagle-board.patch | 135 -- ...-omap3_-foo-_rate_table-omap35x_-foo-_rat.patch | 27 + ...MAP-Make-beagle-u-boot-partition-writable.patch | 24 - ...beagle-prepare-for-DM3730-based-Beagleboa.patch | 97 + ...able-audio-capture-by-default-for-twl4030.patch | 27 - ...st-stab-at-merging-sensor-driver-based-on.patch | 2394 ++++++++++++++++++++ ...beagle-ugly-copy-paste-job-to-get-mt9p111.patch | 214 ++ ...Makefile.fwinst-fix-typo-missing-space-in.patch | 25 - ...ap2-proper-fix-for-subpage-read-ECC-error.patch | 35 - ...beagle-turn-on-power-to-camera-on-boot-an.patch | 31 + ...beagle-update-omap34xxcam-to-more-recent-.patch | 84 + ...able-audio-capture-by-default-for-twl4030.patch | 27 + ...ap2-proper-fix-for-subpage-read-ECC-error.patch | 35 + ...-DSS2-Enable-Pre-Multiplied-Alpha-Support.patch | 44 + ...otarg-for-selecting-svideo-or-composite-f.patch | 75 + ...-add-some-more-from-Leopard-imaging-patch.patch | 133 ++ ...vero-Add-support-for-second-ethernet-port.patch | 110 + ...-smsc911x-return-ENODEV-if-device-is-not-.patch | 29 + ...ut-touchscreen-ads7846-return-ENODEV-if-d.patch | 53 + .../0019-drivers-mfd-add-twl4030-madc-driver.patch | 601 +++++ ...OMAP-Add-missing-twl4030-madc-header-file.patch | 149 ++ ...RM-OMAP-Add-twl4030-madc-support-to-Overo.patch | 32 + ...M-OMAP-Add-twl4030-madc-support-to-Beagle.patch | 35 + ...usb-add-vendor-device-ID-for-Ceiva-Wirele.patch | 25 + ...isplay-single-block-read-console-messages.patch | 28 + ...mc-twl4030-move-clock-input-selection-pri.patch | 47 + ...-add-PM-code-and-sync-with-http-www.sakom.patch | 373 +++ ...0-madc-adjust-for-twl4030-twl-api-changes.patch | 85 + ...e-add-support-for-Samsung-lte430wq-f0c-pa.patch | 161 ++ ...Add-support-for-LG-Philips-LB035Q02-panel.patch | 254 +++ ...-width-which-improves-SD-card-s-peformanc.patch | 32 + ...-support-to-sync-the-VFP-state-of-the-cur.patch | 109 + ...serve-the-HW-context-when-calling-signal-.patch | 211 ++ .../am3517-evm/am3517-ehci-mux.patch | 14 - ...board-omap3_-foo-_rate_table-omap35x_-foo.patch | 27 - ...3beagle-prepare-for-DM3730-based-Beaglebo.patch | 97 - .../linux-omap-psp-2.6.32/beagleboard/defconfig | 26 +- ...-Add-support-for-LG-Philips-LB035Q02-pane.patch | 254 --- .../0014-OMAP-DSS-Add-DSS2-support-for-Overo.patch | 343 --- ...0015-OMAP-DSS-Add-DSS2-support-for-Beagle.patch | 186 -- .../dss2/0016-video-add-timings-for-hd720.patch | 27 - .../dss2/beagle-dss2-support.diff | 308 --- .../linux-omap-psp-2.6.32/fix-usbgadgets.diff | 26 - recipes/linux/linux-omap-psp-2.6.32/holes.patch | 39 - .../linux/linux-omap-psp-2.6.32/no-mmc-spew.patch | 23 - .../linux/linux-omap-psp-2.6.32/omap3evm/defconfig | 2 +- recipes/linux/linux-omap-psp-2.6.32/sctp-fix.patch | 47 - recipes/linux/linux-omap-psp_2.6.32.bb | 48 +- 57 files changed, 5963 insertions(+), 1943 deletions(-) delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0001-ARM-OMAP-Overo-Add-support-for-second-ethernet-po.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux-.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board-f.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-ehci-omap-use-new-location-for-usb.h-inc.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0003-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0003-drivers-net-smsc911x-return-ENODEV-if-device-is-n.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0004-board-omap3-beagle-add-DSS2-support.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0004-drivers-input-touchscreen-ads7846-return-ENODEV.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0005-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0005-beagleboard-omap3_-foo-_rate_table-omap35x_-foo-_rat.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0006-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0006-board-omap3beagle-prepare-for-DM3730-based-Beagleboa.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0007-ASoC-enable-audio-capture-by-default-for-twl4030.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0007-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0008-board-omap3beagle-ugly-copy-paste-job-to-get-mt9p111.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0008-scripts-Makefile.fwinst-fix-typo-missing-space-in.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/0009-MTD-NAND-omap2-proper-fix-for-subpage-read-ECC-error.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0009-board-omap3beagle-turn-on-power-to-camera-on-boot-an.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0010-board-omap3beagle-update-omap34xxcam-to-more-recent-.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0011-ASoC-enable-audio-capture-by-default-for-twl4030.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0012-MTD-NAND-omap2-proper-fix-for-subpage-read-ECC-error.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0013-OMAP3630-DSS2-Enable-Pre-Multiplied-Alpha-Support.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0014-DSS2-add-bootarg-for-selecting-svideo-or-composite-f.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0015-ISP-add-some-more-from-Leopard-imaging-patch.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0016-ARM-OMAP-Overo-Add-support-for-second-ethernet-port.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0017-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0019-drivers-mfd-add-twl4030-madc-driver.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0020-ARM-OMAP-Add-missing-twl4030-madc-header-file.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0021-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0022-ARM-OMAP-Add-twl4030-madc-support-to-Beagle.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0023-netdev-rt73usb-add-vendor-device-ID-for-Ceiva-Wirele.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0024-mmc-don-t-display-single-block-read-console-messages.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0025-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0026-board-overo-add-PM-code-and-sync-with-http-www.sakom.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0027-twl4030-madc-adjust-for-twl4030-twl-api-changes.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0028-OMAP-DSS2-Re-add-support-for-Samsung-lte430wq-f0c-pa.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0029-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-panel.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0030-Fix-for-bus-width-which-improves-SD-card-s-peformanc.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0031-ARM-VFP-add-support-to-sync-the-VFP-state-of-the-cur.patch create mode 100644 recipes/linux/linux-omap-psp-2.6.32/0032-ARM-VFP-preserve-the-HW-context-when-calling-signal-.patch delete mode 100755 recipes/linux/linux-omap-psp-2.6.32/am3517-evm/am3517-ehci-mux.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/beagleboard/0001-beagleboard-omap3_-foo-_rate_table-omap35x_-foo.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/beagleboard/0001-board-omap3beagle-prepare-for-DM3730-based-Beaglebo.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/dss2/0012-OMAP-DSS2-Add-support-for-LG-Philips-LB035Q02-pane.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/dss2/0014-OMAP-DSS-Add-DSS2-support-for-Overo.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/dss2/0015-OMAP-DSS-Add-DSS2-support-for-Beagle.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/dss2/0016-video-add-timings-for-hd720.patch delete mode 100755 recipes/linux/linux-omap-psp-2.6.32/dss2/beagle-dss2-support.diff delete mode 100755 recipes/linux/linux-omap-psp-2.6.32/fix-usbgadgets.diff delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/holes.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/no-mmc-spew.patch delete mode 100644 recipes/linux/linux-omap-psp-2.6.32/sctp-fix.patch (limited to 'recipes/linux') diff --git a/recipes/linux/linux-omap-psp-2.6.32/0001-ARM-OMAP-Overo-Add-support-for-second-ethernet-po.patch b/recipes/linux/linux-omap-psp-2.6.32/0001-ARM-OMAP-Overo-Add-support-for-second-ethernet-po.patch deleted file mode 100644 index 3254fe4562..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0001-ARM-OMAP-Overo-Add-support-for-second-ethernet-po.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 190c75031e65008425dbdd74c3e3237beed18460 Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Tue, 15 Dec 2009 14:59:42 -0800 -Subject: [PATCH 01/16] ARM: OMAP: Overo: Add support for second ethernet port - -Signed-off-by: Steve Sakoman ---- - arch/arm/mach-omap2/board-overo.c | 56 +++++++++++++++++++++++++++++++++++-- - 1 files changed, 53 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c -index 52dfd51..1b94f2c 100644 ---- a/arch/arm/mach-omap2/board-overo.c -+++ b/arch/arm/mach-omap2/board-overo.c -@@ -63,6 +63,8 @@ - - #define OVERO_SMSC911X_CS 5 - #define OVERO_SMSC911X_GPIO 176 -+#define OVERO_SMSC911X2_CS 4 -+#define OVERO_SMSC911X2_GPIO 65 - - #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ - defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) -@@ -137,6 +139,16 @@ static struct resource overo_smsc911x_resources[] = { - }, - }; - -+static struct resource overo_smsc911x2_resources[] = { -+ { -+ .name = "smsc911x2-memory", -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, -+ }, -+}; -+ - static struct smsc911x_platform_config overo_smsc911x_config = { - .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, - .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, -@@ -146,7 +158,7 @@ static struct smsc911x_platform_config overo_smsc911x_config = { - - static struct platform_device overo_smsc911x_device = { - .name = "smsc911x", -- .id = -1, -+ .id = 0, - .num_resources = ARRAY_SIZE(overo_smsc911x_resources), - .resource = overo_smsc911x_resources, - .dev = { -@@ -154,9 +166,26 @@ static struct platform_device overo_smsc911x_device = { - }, - }; - -+static struct platform_device overo_smsc911x2_device = { -+ .name = "smsc911x", -+ .id = 1, -+ .num_resources = ARRAY_SIZE(overo_smsc911x2_resources), -+ .resource = overo_smsc911x2_resources, -+ .dev = { -+ .platform_data = &overo_smsc911x_config, -+ }, -+}; -+ -+static struct platform_device *smsc911x_devices[] = { -+ &overo_smsc911x_device, -+ &overo_smsc911x2_device, -+}; -+ - static inline void __init overo_init_smsc911x(void) - { -- unsigned long cs_mem_base; -+ unsigned long cs_mem_base, cs_mem_base2; -+ -+ /* set up first smsc911x chip */ - - if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { - printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); -@@ -177,7 +206,28 @@ static inline void __init overo_init_smsc911x(void) - overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); - overo_smsc911x_resources[1].end = 0; - -- platform_device_register(&overo_smsc911x_device); -+ /* set up second smsc911x chip */ -+ -+ if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) { -+ printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n"); -+ return; -+ } -+ -+ overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0; -+ overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff; -+ -+ if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) && -+ (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) { -+ gpio_export(OVERO_SMSC911X2_GPIO, 0); -+ } else { -+ printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n"); -+ return; -+ } -+ -+ overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO); -+ overo_smsc911x2_resources[1].end = 0; -+ -+ platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices)); - } - - #else --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux-.patch b/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux-.patch new file mode 100644 index 0000000000..4bdef668a5 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux-.patch @@ -0,0 +1,61 @@ +From 8ba613504c9e73c704c70ffb960affda91c8fadc Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Sat, 30 Jan 2010 15:49:15 +0100 +Subject: [PATCH 01/30] board-omap3touchbook: make it build against TI linux-omap 2.6.32-PSP + +--- + arch/arm/mach-omap2/board-omap3touchbook.c | 11 +++++++++-- + 1 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index fe3d22c..fc3e03c 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -48,12 +49,18 @@ + #include + #include + #include ++#include ++#include + + #include "mux.h" + #include "mmc-twl4030.h" + ++#include "pm.h" ++#include "omap3-opp.h" ++ + #include + ++ + #define GPMC_CS0_BASE 0x60 + #define GPMC_CS_SIZE 0x30 + +@@ -78,7 +85,6 @@ static struct mtd_partition omap3touchbook_nand_partitions[] = { + .name = "U-Boot", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ + .size = 15 * NAND_BLOCK_SIZE, +- .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot Env", +@@ -440,7 +446,8 @@ static void __init omap3_touchbook_init_irq(void) + omap_board_config = omap3_touchbook_config; + omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, +- mt46h32m32lf6_sdrc_params); ++ mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table, ++ omap35x_dsp_rate_table, omap35x_l3_rate_table); + omap_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux.patch b/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux.patch deleted file mode 100644 index 89c385bbbb..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0001-board-omap3touchbook-make-it-build-against-TI-linux.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 51b0bee0036aa6168a2bb7b1df1b5b84bc645840 Mon Sep 17 00:00:00 2001 -From: OpenEmbedded User -Date: Sat, 30 Jan 2010 15:49:15 +0100 -Subject: [PATCH] board-omap3touchbook: make it build against TI linux-omap 2.6.32-PSP - ---- - arch/arm/mach-omap2/board-omap3touchbook.c | 11 +++++++++-- - 1 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c -index fe3d22c..fc3e03c 100644 ---- a/arch/arm/mach-omap2/board-omap3touchbook.c -+++ b/arch/arm/mach-omap2/board-omap3touchbook.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -48,12 +49,18 @@ - #include - #include - #include -+#include -+#include - - #include "mux.h" - #include "mmc-twl4030.h" - -+#include "pm.h" -+#include "omap3-opp.h" -+ - #include - -+ - #define GPMC_CS0_BASE 0x60 - #define GPMC_CS_SIZE 0x30 - -@@ -78,7 +85,6 @@ static struct mtd_partition omap3touchbook_nand_partitions[] = { - .name = "U-Boot", - .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ - .size = 15 * NAND_BLOCK_SIZE, -- .mask_flags = MTD_WRITEABLE, /* force read-only */ - }, - { - .name = "U-Boot Env", -@@ -440,7 +446,8 @@ static void __init omap3_touchbook_init_irq(void) - omap_board_config = omap3_touchbook_config; - omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, -- mt46h32m32lf6_sdrc_params); -+ mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table, -+ omap35x_dsp_rate_table, omap35x_l3_rate_table); - omap_init_irq(); - #ifdef CONFIG_OMAP_32K_TIMER - omap2_gp_clockevent_set_gptimer(12); --- -1.5.4.3 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board-f.patch b/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board-f.patch new file mode 100644 index 0000000000..2432c8c7c8 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board-f.patch @@ -0,0 +1,135 @@ +From 01f6596202c485e52037518398caa47e7f137dd8 Mon Sep 17 00:00:00 2001 +From: Steve Sakoman +Date: Tue, 15 Dec 2009 15:34:29 -0800 +Subject: [PATCH 02/30] ARM: OMAP: add support for TCT Zippy to Beagle board file + +Signed-off-by: Steve Sakoman +--- + arch/arm/mach-omap2/board-omap3beagle.c | 74 +++++++++++++++++++++++++++++- + 1 files changed, 71 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 330fb25..ddfb9c0 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -56,6 +57,49 @@ + + #define NAND_BLOCK_SIZE SZ_128K + ++#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) ++ ++#include ++#include ++ ++#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 ++ ++static struct omap2_mcspi_device_config enc28j60_spi_chip_info = { ++ .turbo_mode = 0, ++ .single_channel = 1, /* 0: slave, 1: master */ ++}; ++ ++static struct spi_board_info omap3beagle_spi_board_info[] __initdata = { ++ { ++ .modalias = "enc28j60", ++ .bus_num = 4, ++ .chip_select = 0, ++ .max_speed_hz = 20000000, ++ .controller_data = &enc28j60_spi_chip_info, ++ }, ++}; ++ ++static void __init omap3beagle_enc28j60_init(void) ++{ ++ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) && ++ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) { ++ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); ++ omap3beagle_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ); ++ set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); ++ } else { ++ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n"); ++ return; ++ } ++ ++ spi_register_board_info(omap3beagle_spi_board_info, ++ ARRAY_SIZE(omap3beagle_spi_board_info)); ++} ++ ++#else ++static inline void __init omap3beagle_enc28j60_init(void) { return; } ++#endif ++ ++ + static struct mtd_partition omap3beagle_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -118,6 +162,14 @@ static struct twl4030_hsmmc_info mmc[] = { + .wires = 8, + .gpio_wp = 29, + }, ++ { ++ .mmc = 2, ++ .wires = 4, ++ .gpio_wp = 141, ++ .gpio_cd = 162, ++ .transceiver = true, ++ .ocr_mask = 0x00100000, /* 3.3V */ ++ }, + {} /* Terminator */ + }; + +@@ -281,7 +333,7 @@ static struct twl4030_platform_data beagle_twldata = { + .vpll2 = &beagle_vpll2, + }; + +-static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { ++static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = { + { + I2C_BOARD_INFO("twl4030", 0x48), + .flags = I2C_CLIENT_WAKE, +@@ -290,10 +342,24 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { + }, + }; + ++#if defined(CONFIG_RTC_DRV_DS1307) || \ ++ defined(CONFIG_RTC_DRV_DS1307_MODULE) ++ ++static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { ++ { ++ I2C_BOARD_INFO("ds1307", 0x68), ++ }, ++}; ++#else ++static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; ++#endif ++ + static int __init omap3_beagle_i2c_init(void) + { +- omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, +- ARRAY_SIZE(beagle_i2c_boardinfo)); ++ omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, ++ ARRAY_SIZE(beagle_i2c1_boardinfo)); ++ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ++ ARRAY_SIZE(beagle_i2c2_boardinfo)); + /* Bus 3 is attached to the DVI port where devices like the pico DLP + * projector don't work reliably with 400kHz */ + omap_register_i2c_bus(3, 100, NULL, 0); +@@ -448,6 +514,8 @@ static void __init omap3_beagle_init(void) + /* REVISIT leave DVI powered down until it's needed ... */ + gpio_direction_output(170, true); + ++ omap3beagle_enc28j60_init(); ++ + usb_musb_init(); + usb_ehci_init(&ehci_pdata); + omap3beagle_flash_init(); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-ehci-omap-use-new-location-for-usb.h-inc.patch b/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-ehci-omap-use-new-location-for-usb.h-inc.patch deleted file mode 100644 index 7add534bc7..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0002-ARM-OMAP-ehci-omap-use-new-location-for-usb.h-inc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 06e97c7ea488e350b7aae5f3864a1bbe0666db87 Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Tue, 15 Dec 2009 15:12:54 -0800 -Subject: [PATCH 02/16] ARM: OMAP: ehci-omap: use new location for usb.h include - ---- - drivers/usb/host/ehci-omap.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c -index 7ba8df3..5cfed78 100644 ---- a/drivers/usb/host/ehci-omap.c -+++ b/drivers/usb/host/ehci-omap.c -@@ -37,7 +37,7 @@ - #include - #include - #include --#include -+#include - - /* - * OMAP USBHOST Register addresses: VIRTUAL ADDRESSES --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0003-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch b/recipes/linux/linux-omap-psp-2.6.32/0003-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch new file mode 100644 index 0000000000..12eb5f4583 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0003-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch @@ -0,0 +1,24 @@ +From 82cf37dd0850ede2122e1723118eb6ec3a4a7945 Mon Sep 17 00:00:00 2001 +From: Steve Sakoman +Date: Thu, 17 Dec 2009 12:40:24 -0800 +Subject: [PATCH 03/30] ARM: OMAP: Make beagle u-boot partition writable + +--- + arch/arm/mach-omap2/board-omap3beagle.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index ddfb9c0..9f72c7a 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -112,7 +112,6 @@ static struct mtd_partition omap3beagle_nand_partitions[] = { + .name = "U-Boot", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ + .size = 15 * NAND_BLOCK_SIZE, +- .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot Env", +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0003-drivers-net-smsc911x-return-ENODEV-if-device-is-n.patch b/recipes/linux/linux-omap-psp-2.6.32/0003-drivers-net-smsc911x-return-ENODEV-if-device-is-n.patch deleted file mode 100644 index c15cf3a396..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0003-drivers-net-smsc911x-return-ENODEV-if-device-is-n.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 196c189ca20294fdcef264995f68cca74b1e16ea Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Tue, 15 Dec 2009 15:17:44 -0800 -Subject: [PATCH 03/16] drivers: net: smsc911x: return ENODEV if device is not found - -Signed-off-by: Steve Sakoman ---- - drivers/net/smsc911x.c | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c -index f9cdcbc..9ca18b5 100644 ---- a/drivers/net/smsc911x.c -+++ b/drivers/net/smsc911x.c -@@ -2021,8 +2021,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) - } - - retval = smsc911x_init(dev); -- if (retval < 0) -+ if (retval < 0) { -+ retval = -ENODEV; - goto out_unmap_io_3; -+ } - - /* configure irq polarity and type before connecting isr */ - if (pdata->config.irq_polarity == SMSC911X_IRQ_POLARITY_ACTIVE_HIGH) --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0004-board-omap3-beagle-add-DSS2-support.patch b/recipes/linux/linux-omap-psp-2.6.32/0004-board-omap3-beagle-add-DSS2-support.patch new file mode 100644 index 0000000000..40e1c0f82b --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0004-board-omap3-beagle-add-DSS2-support.patch @@ -0,0 +1,200 @@ +From 98c074253ee9ca49b145b81843cceedbf7aebc55 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Wed, 10 Feb 2010 15:07:36 +0100 +Subject: [PATCH 04/30] board-omap3-beagle: add DSS2 support + +--- + arch/arm/mach-omap2/board-omap3beagle.c | 130 ++++++++++++++++++++++++------- + 1 files changed, 103 insertions(+), 27 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 9f72c7a..3b7f6ec 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -40,6 +40,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -153,6 +154,105 @@ static struct platform_device omap3beagle_nand_device = { + .resource = &omap3beagle_nand_resource, + }; + ++/* DSS */ ++ ++static int beagle_enable_dvi(struct omap_dss_device *dssdev) ++{ ++ if (dssdev->reset_gpio != -1) ++ gpio_set_value(dssdev->reset_gpio, 1); ++ ++ return 0; ++} ++ ++static void beagle_disable_dvi(struct omap_dss_device *dssdev) ++{ ++ if (dssdev->reset_gpio != -1) ++ gpio_set_value(dssdev->reset_gpio, 0); ++} ++ ++static struct omap_dss_device beagle_dvi_device = { ++ .type = OMAP_DISPLAY_TYPE_DPI, ++ .name = "dvi", ++ .driver_name = "generic_panel", ++ .phy.dpi.data_lines = 24, ++ .reset_gpio = 170, ++ .platform_enable = beagle_enable_dvi, ++ .platform_disable = beagle_disable_dvi, ++}; ++ ++static int beagle_panel_enable_tv(struct omap_dss_device *dssdev) ++{ ++#define ENABLE_VDAC_DEDICATED 0x03 ++#define ENABLE_VDAC_DEV_GRP 0x20 ++ ++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, ++ ENABLE_VDAC_DEDICATED, ++ TWL4030_VDAC_DEDICATED); ++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, ++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP); ++ ++ return 0; ++} ++ ++static void beagle_panel_disable_tv(struct omap_dss_device *dssdev) ++{ ++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00, ++ TWL4030_VDAC_DEDICATED); ++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00, ++ TWL4030_VDAC_DEV_GRP); ++} ++ ++static struct omap_dss_device beagle_tv_device = { ++ .name = "tv", ++ .driver_name = "venc", ++ .type = OMAP_DISPLAY_TYPE_VENC, ++ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, ++ .platform_enable = beagle_panel_enable_tv, ++ .platform_disable = beagle_panel_disable_tv, ++}; ++ ++static struct omap_dss_device *beagle_dss_devices[] = { ++ &beagle_dvi_device, ++ &beagle_tv_device, ++}; ++ ++static struct omap_dss_board_info beagle_dss_data = { ++ .num_devices = ARRAY_SIZE(beagle_dss_devices), ++ .devices = beagle_dss_devices, ++ .default_device = &beagle_dvi_device, ++}; ++ ++static struct platform_device beagle_dss_device = { ++ .name = "omapdss", ++ .id = -1, ++ .dev = { ++ .platform_data = &beagle_dss_data, ++ }, ++}; ++ ++static struct regulator_consumer_supply beagle_vdac_supply = { ++ .supply = "vdda_dac", ++ .dev = &beagle_dss_device.dev, ++}; ++ ++static struct regulator_consumer_supply beagle_vdvi_supply = { ++ .supply = "vdds_dsi", ++ .dev = &beagle_dss_device.dev, ++}; ++ ++static void __init beagle_display_init(void) ++{ ++ int r; ++ ++ r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset"); ++ if (r < 0) { ++ printk(KERN_ERR "Unable to get DVI reset GPIO\n"); ++ return; ++ } ++ ++ gpio_direction_output(beagle_dvi_device.reset_gpio, 0); ++} ++ + #include "sdram-micron-mt46h32m32lf-6.h" + + static struct twl4030_hsmmc_info mmc[] = { +@@ -172,15 +272,6 @@ static struct twl4030_hsmmc_info mmc[] = { + {} /* Terminator */ + }; + +-static struct platform_device omap3_beagle_lcd_device = { +- .name = "omap3beagle_lcd", +- .id = -1, +-}; +- +-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = { +- .ctrl_name = "internal", +-}; +- + static struct regulator_consumer_supply beagle_vmmc1_supply = { + .supply = "vmmc", + }; +@@ -236,16 +327,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = { + .setup = beagle_twl_gpio_setup, + }; + +-static struct regulator_consumer_supply beagle_vdac_supply = { +- .supply = "vdac", +- .dev = &omap3_beagle_lcd_device.dev, +-}; +- +-static struct regulator_consumer_supply beagle_vdvi_supply = { +- .supply = "vdvi", +- .dev = &omap3_beagle_lcd_device.dev, +-}; +- + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ + static struct regulator_init_data beagle_vmmc1 = { + .constraints = { +@@ -418,14 +499,8 @@ static struct platform_device keys_gpio = { + }, + }; + +-static struct omap_board_config_kernel omap3_beagle_config[] __initdata = { +- { OMAP_TAG_LCD, &omap3_beagle_lcd_config }, +-}; +- + static void __init omap3_beagle_init_irq(void) + { +- omap_board_config = omap3_beagle_config; +- omap_board_config_size = ARRAY_SIZE(omap3_beagle_config); + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, + mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, + omap3_dsp_rate_table, omap3_l3_rate_table); +@@ -437,9 +512,9 @@ static void __init omap3_beagle_init_irq(void) + } + + static struct platform_device *omap3_beagle_devices[] __initdata = { +- &omap3_beagle_lcd_device, + &leds_gpio, + &keys_gpio, ++ &beagle_dss_device, + }; + + static void __init omap3beagle_flash_init(void) +@@ -522,8 +597,9 @@ static void __init omap3_beagle_init(void) + /* Ensure SDRC pins are mux'd for self-refresh */ + omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); + omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); +-} + ++ beagle_display_init(); ++} + static void __init omap3_beagle_map_io(void) + { + omap2_set_globals_343x(); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0004-drivers-input-touchscreen-ads7846-return-ENODEV.patch b/recipes/linux/linux-omap-psp-2.6.32/0004-drivers-input-touchscreen-ads7846-return-ENODEV.patch deleted file mode 100644 index 345213cb59..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0004-drivers-input-touchscreen-ads7846-return-ENODEV.patch +++ /dev/null @@ -1,53 +0,0 @@ -From deb568b94c448aa7ffcc9e6788bcf9069fd3b864 Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Tue, 15 Dec 2009 15:24:10 -0800 -Subject: [PATCH 04/16] drivers: input: touchscreen: ads7846: return ENODEV if device is not found - -Signed-off-by: Steve Sakoman ---- - drivers/input/touchscreen/ads7846.c | 13 ++++++++++--- - 1 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c -index 09c8109..7cc9973 100644 ---- a/drivers/input/touchscreen/ads7846.c -+++ b/drivers/input/touchscreen/ads7846.c -@@ -1170,9 +1170,16 @@ static int __devinit ads7846_probe(struct spi_device *spi) - /* take a first sample, leaving nPENIRQ active and vREF off; avoid - * the touchscreen, in case it's not connected. - */ -- (void) ads7846_read12_ser(&spi->dev, -+ err = ads7846_read12_ser(&spi->dev, - READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON); - -+ /* if sample is all 0's or all 1's then there is no device on spi */ -+ if ( (err == 0x000) || (err == 0xfff)) { -+ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err); -+ err = -ENODEV; -+ goto err_free_irq; -+ } -+ - err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); - if (err) - goto err_remove_hwmon; -@@ -1190,7 +1197,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) - err_free_irq: - free_irq(spi->irq, ts); - err_free_gpio: -- if (ts->gpio_pendown != -1) -+ if (!ts->get_pendown_state && ts->gpio_pendown != -1) - gpio_free(ts->gpio_pendown); - err_cleanup_filter: - if (ts->filter_cleanup) -@@ -1217,7 +1224,7 @@ static int __devexit ads7846_remove(struct spi_device *spi) - /* suspend left the IRQ disabled */ - enable_irq(ts->spi->irq); - -- if (ts->gpio_pendown != -1) -+ if (!ts->get_pendown_state && ts->gpio_pendown != -1) - gpio_free(ts->gpio_pendown); - - if (ts->filter_cleanup) --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0005-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board.patch b/recipes/linux/linux-omap-psp-2.6.32/0005-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board.patch deleted file mode 100644 index 1c51552792..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0005-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 334eef94045c93957cad3477522086492dd19b06 Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Tue, 15 Dec 2009 15:34:29 -0800 -Subject: [PATCH 05/16] ARM: OMAP: add support for TCT Zippy to Beagle board file - -Signed-off-by: Steve Sakoman ---- - arch/arm/mach-omap2/board-omap3beagle.c | 74 +++++++++++++++++++++++++++++- - 1 files changed, 71 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c -index 41480bd..f3df638 100644 ---- a/arch/arm/mach-omap2/board-omap3beagle.c -+++ b/arch/arm/mach-omap2/board-omap3beagle.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -52,6 +53,49 @@ - - #define NAND_BLOCK_SIZE SZ_128K - -+#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) -+ -+#include -+#include -+ -+#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 -+ -+static struct omap2_mcspi_device_config enc28j60_spi_chip_info = { -+ .turbo_mode = 0, -+ .single_channel = 1, /* 0: slave, 1: master */ -+}; -+ -+static struct spi_board_info omap3beagle_spi_board_info[] __initdata = { -+ { -+ .modalias = "enc28j60", -+ .bus_num = 4, -+ .chip_select = 0, -+ .max_speed_hz = 20000000, -+ .controller_data = &enc28j60_spi_chip_info, -+ }, -+}; -+ -+static void __init omap3beagle_enc28j60_init(void) -+{ -+ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) && -+ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) { -+ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); -+ omap3beagle_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ); -+ set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); -+ } else { -+ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n"); -+ return; -+ } -+ -+ spi_register_board_info(omap3beagle_spi_board_info, -+ ARRAY_SIZE(omap3beagle_spi_board_info)); -+} -+ -+#else -+static inline void __init omap3beagle_enc28j60_init(void) { return; } -+#endif -+ -+ - static struct mtd_partition omap3beagle_nand_partitions[] = { - /* All the partition sizes are listed in terms of NAND block size */ - { -@@ -114,6 +158,14 @@ static struct twl4030_hsmmc_info mmc[] = { - .wires = 8, - .gpio_wp = 29, - }, -+ { -+ .mmc = 2, -+ .wires = 4, -+ .gpio_wp = 141, -+ .gpio_cd = 162, -+ .transceiver = true, -+ .ocr_mask = 0x00100000, /* 3.3V */ -+ }, - {} /* Terminator */ - }; - -@@ -277,7 +329,7 @@ static struct twl4030_platform_data beagle_twldata = { - .vpll2 = &beagle_vpll2, - }; - --static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { -+static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = { - { - I2C_BOARD_INFO("twl4030", 0x48), - .flags = I2C_CLIENT_WAKE, -@@ -286,10 +338,24 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = { - }, - }; - -+#if defined(CONFIG_RTC_DRV_DS1307) || \ -+ defined(CONFIG_RTC_DRV_DS1307_MODULE) -+ -+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = { -+ { -+ I2C_BOARD_INFO("ds1307", 0x68), -+ }, -+}; -+#else -+static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {}; -+#endif -+ - static int __init omap3_beagle_i2c_init(void) - { -- omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, -- ARRAY_SIZE(beagle_i2c_boardinfo)); -+ omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, -+ ARRAY_SIZE(beagle_i2c1_boardinfo)); -+ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, -+ ARRAY_SIZE(beagle_i2c2_boardinfo)); - /* Bus 3 is attached to the DVI port where devices like the pico DLP - * projector don't work reliably with 400kHz */ - omap_register_i2c_bus(3, 100, NULL, 0); -@@ -434,6 +500,8 @@ static void __init omap3_beagle_init(void) - /* REVISIT leave DVI powered down until it's needed ... */ - gpio_direction_output(170, true); - -+ omap3beagle_enc28j60_init(); -+ - usb_musb_init(); - usb_ehci_init(&ehci_pdata); - omap3beagle_flash_init(); --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0005-beagleboard-omap3_-foo-_rate_table-omap35x_-foo-_rat.patch b/recipes/linux/linux-omap-psp-2.6.32/0005-beagleboard-omap3_-foo-_rate_table-omap35x_-foo-_rat.patch new file mode 100644 index 0000000000..b4636315a1 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0005-beagleboard-omap3_-foo-_rate_table-omap35x_-foo-_rat.patch @@ -0,0 +1,27 @@ +From 04dc08419ca56f03dd01e54a064cb17342165e02 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Wed, 27 Jan 2010 21:57:13 +0100 +Subject: [PATCH 05/30] beagleboard: omap3__rate_table -> omap35x__rate_table + +--- + arch/arm/mach-omap2/board-omap3beagle.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 3b7f6ec..1caaa01 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -502,8 +502,8 @@ static struct platform_device keys_gpio = { + static void __init omap3_beagle_init_irq(void) + { + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, +- mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, +- omap3_dsp_rate_table, omap3_l3_rate_table); ++ mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table, ++ omap35x_dsp_rate_table, omap35x_l3_rate_table); + omap_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0006-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch b/recipes/linux/linux-omap-psp-2.6.32/0006-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch deleted file mode 100644 index 3ad1853e3f..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0006-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 2607d201fb202499533aa4a7fc788b4fa5fd1fcf Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Thu, 17 Dec 2009 12:40:24 -0800 -Subject: [PATCH 06/16] ARM: OMAP: Make beagle u-boot partition writable - ---- - arch/arm/mach-omap2/board-omap3beagle.c | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c -index f3df638..d00b089 100644 ---- a/arch/arm/mach-omap2/board-omap3beagle.c -+++ b/arch/arm/mach-omap2/board-omap3beagle.c -@@ -108,7 +108,6 @@ static struct mtd_partition omap3beagle_nand_partitions[] = { - .name = "U-Boot", - .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ - .size = 15 * NAND_BLOCK_SIZE, -- .mask_flags = MTD_WRITEABLE, /* force read-only */ - }, - { - .name = "U-Boot Env", --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0006-board-omap3beagle-prepare-for-DM3730-based-Beagleboa.patch b/recipes/linux/linux-omap-psp-2.6.32/0006-board-omap3beagle-prepare-for-DM3730-based-Beagleboa.patch new file mode 100644 index 0000000000..c0af143b14 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0006-board-omap3beagle-prepare-for-DM3730-based-Beagleboa.patch @@ -0,0 +1,97 @@ +From d9a0bb7553b59a0ecdd2cfdc8f26666492f298a9 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Mon, 8 Feb 2010 16:30:59 +0100 +Subject: [PATCH 06/30] board-omap3beagle: prepare for DM3730 based BeagleboardXM + +* OPP changes copy/pasted from board-omap3evm.c + * EHCI changes copy/pasted from Steve Kipisz' 2.6.33rcX work +--- + arch/arm/mach-omap2/board-omap3beagle.c | 57 ++++++++++++++++++++++++++---- + 1 files changed, 49 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 1caaa01..accf80d 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -53,6 +53,23 @@ + #include "pm.h" + #include "omap3-opp.h" + ++#ifdef CONFIG_PM ++static struct omap_opp * _omap35x_mpu_rate_table = omap35x_mpu_rate_table; ++static struct omap_opp * _omap37x_mpu_rate_table = omap37x_mpu_rate_table; ++static struct omap_opp * _omap35x_dsp_rate_table = omap35x_dsp_rate_table; ++static struct omap_opp * _omap37x_dsp_rate_table = omap37x_dsp_rate_table; ++static struct omap_opp * _omap35x_l3_rate_table = omap35x_l3_rate_table; ++static struct omap_opp * _omap37x_l3_rate_table = omap37x_l3_rate_table; ++#else /* CONFIG_PM */ ++static struct omap_opp * _omap35x_mpu_rate_table = NULL; ++static struct omap_opp * _omap37x_mpu_rate_table = NULL; ++static struct omap_opp * _omap35x_dsp_rate_table = NULL; ++static struct omap_opp * _omap37x_dsp_rate_table = NULL; ++static struct omap_opp * _omap35x_l3_rate_table = NULL; ++static struct omap_opp * _omap37x_l3_rate_table = NULL; ++#endif /* CONFIG_PM */ ++ ++ + #define GPMC_CS0_BASE 0x60 + #define GPMC_CS_SIZE 0x30 + +@@ -303,12 +320,23 @@ static int beagle_twl_gpio_setup(struct device *dev, + * power switch and overcurrent detect + */ + +- gpio_request(gpio + 1, "EHCI_nOC"); +- gpio_direction_input(gpio + 1); ++ if (cpu_is_omap3630()) { ++ gpio_request(gpio + 1, "nDVI_PWR_EN"); ++ gpio_direction_output(gpio + 1, 0); ++ ++ /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ ++ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); ++ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); ++ } ++ else { ++ gpio_request(gpio + 1, "EHCI_nOC"); ++ gpio_direction_input(gpio + 1); ++ ++ /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ ++ gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); ++ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); ++ } + +- /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ +- gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); +- gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + + /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ + gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; +@@ -501,9 +529,22 @@ static struct platform_device keys_gpio = { + + static void __init omap3_beagle_init_irq(void) + { +- omap2_init_common_hw(mt46h32m32lf6_sdrc_params, +- mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table, +- omap35x_dsp_rate_table, omap35x_l3_rate_table); ++ if (cpu_is_omap3630()) ++ { ++ omap2_init_common_hw(mt46h32m32lf6_sdrc_params, ++ NULL, ++ _omap37x_mpu_rate_table, ++ _omap37x_dsp_rate_table, ++ _omap37x_l3_rate_table); ++ } ++ else ++ { ++ omap2_init_common_hw(mt46h32m32lf6_sdrc_params, ++ NULL, ++ _omap35x_mpu_rate_table, ++ _omap35x_dsp_rate_table, ++ _omap35x_l3_rate_table); ++ } + omap_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-psp-2.6.32/0007-ASoC-enable-audio-capture-by-default-for-twl4030.patch b/recipes/linux/linux-omap-psp-2.6.32/0007-ASoC-enable-audio-capture-by-default-for-twl4030.patch deleted file mode 100644 index 6ad4366f02..0000000000 --- a/recipes/linux/linux-omap-psp-2.6.32/0007-ASoC-enable-audio-capture-by-default-for-twl4030.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a0cf94cd5d99280fccc29e6b7777c448f15d1c65 Mon Sep 17 00:00:00 2001 -From: Steve Sakoman -Date: Thu, 17 Dec 2009 12:45:20 -0800 -Subject: [PATCH 07/16] ASoC: enable audio capture by default for twl4030 - ---- - sound/soc/codecs/twl4030.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c -index 4df7c6c..e85db73 100644 ---- a/sound/soc/codecs/twl4030.c -+++ b/sound/soc/codecs/twl4030.c -@@ -46,8 +46,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = { - 0xc3, /* REG_OPTION (0x2) */ - 0x00, /* REG_UNKNOWN (0x3) */ - 0x00, /* REG_MICBIAS_CTL (0x4) */ -- 0x20, /* REG_ANAMICL (0x5) */ -- 0x00, /* REG_ANAMICR (0x6) */ -+ 0x34, /* REG_ANAMICL (0x5) */ -+ 0x14, /* REG_ANAMICR (0x6) */ - 0x00, /* REG_AVADC_CTL (0x7) */ - 0x00, /* REG_ADCMICSEL (0x8) */ - 0x00, /* REG_DIGMIXING (0x9) */ --- -1.6.2.4 - diff --git a/recipes/linux/linux-omap-psp-2.6.32/0007-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch b/recipes/linux/linux-omap-psp-2.6.32/0007-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch new file mode 100644 index 0000000000..8df955c617 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0007-mt9t111-first-stab-at-merging-sensor-driver-based-on.patch @@ -0,0 +1,2394 @@ +From 0ea3408a0fb0cedddeea2c8f7dc887e559b1da5b Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 9 Feb 2010 17:16:13 +0100 +Subject: [PATCH 07/30] mt9t111: first stab at merging sensor driver based on a patch by Leopard Imaging + +--- + drivers/media/video/Kconfig | 8 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9t111.c | 883 ++++++++++++++++++++++++ + drivers/media/video/mt9t111_reg.h | 1364 +++++++++++++++++++++++++++++++++++++ + include/media/mt9t111.h | 79 +++ + 5 files changed, 2335 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9t111.c + create mode 100644 drivers/media/video/mt9t111_reg.h + create mode 100644 include/media/mt9t111.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 41e39a7..f67ed46 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -344,6 +344,14 @@ config VIDEO_MT9P012 + MT9P012 camera. It is currently working with the TI OMAP3 + camera controller. + ++config VIDEO_MT9T111 ++ tristate "Micron MT9T111 raw sensor driver (3MP)" ++ depends on I2C && VIDEO_V4L2 ++ ---help--- ++ This is a Video4Linux2 sensor-level driver for the Micron ++ MT9T111 camera. It is currently working with the TI OMAP3 ++ camera controller. ++ + config VIDEO_DW9710 + tristate "Lens driver for DW9710" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 88e8ec1..31688bf 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -127,6 +127,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o + obj-y += isp/ + obj-$(CONFIG_VIDEO_OMAP3) += omap34xxcam.o + obj-$(CONFIG_VIDEO_MT9P012) += mt9p012.o ++obj-$(CONFIG_VIDEO_MT9T111) += mt9t111.o + obj-$(CONFIG_VIDEO_DW9710) += dw9710.o + obj-$(CONFIG_VIDEO_TPS61059) += tps61059.o + obj-$(CONFIG_VIDEO_OV3640) += ov3640.o +diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c +new file mode 100644 +index 0000000..ecc5115 +--- /dev/null ++++ b/drivers/media/video/mt9t111.c +@@ -0,0 +1,883 @@ ++/* ++ * drivers/media/video/mt9t111.c ++ * ++ * mt9t111 sensor driver ++ * ++ * Copyright (C) 2009 Leopard Imaging ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++#include ++#include ++#include ++ ++#include ++#include "mt9t111_reg.h" ++ ++#define USE_RAW // YCbCr mode does not work yet ++//#define COLOR_BAR // Create a Color bar test pattern, Blue, Green, Red, Grey ++ ++#define SENSOR_DETECTED 1 ++#define SENSOR_NOT_DETECTED 0 ++ ++static void mt9t111_loaddefault(struct i2c_client *client); ++ ++/* ++* as a place holder for further development ++*/ ++static void debug_dummy(char *in_msg) ++{ ++ ++} ++ ++/* list of image formats supported by mt9t111 sensor */ ++const static struct v4l2_fmtdesc mt9t111_formats[] = { ++#ifdef USE_RAW ++ { ++ .description = "RAW ", ++ .pixelformat = V4L2_PIX_FMT_SGRBG10, ++ }, ++#else ++ { ++ .description = "YUV 422 ", ++ .pixelformat = V4L2_PIX_FMT_YUYV, ++ }, ++#endif ++}; ++ ++#define NUM_CAPTURE_FORMATS ARRAY_SIZE(mt9t111_formats) ++ ++/* ++ * Array of image sizes supported by MT9T111. These must be ordered from ++ * smallest image size to largest. ++ */ ++const static struct capture_size mt9t111_sizes[] = { ++ { 640, 480 }, ++// { 2048, 1536} ++}; ++ ++#define NUM_CAPTURE_SIZE ARRAY_SIZE(mt9t111_sizes) ++ ++ ++const struct v4l2_fract mt9t111_frameintervals[] = { ++ { .numerator = 1, .denominator = 10 } ++}; ++ ++#define NUM_CAPTURE_FRAMEINTERVALS ARRAY_SIZE(mt9t111_frameintervals) ++ ++/** ++ * struct mt9t111_sensor - main structure for storage of sensor information ++ * @pdata: access functions and data for platform level information ++ * @v4l2_int_device: V4L2 device structure structure ++ * @i2c_client: iic client device structure ++ * @pix: V4L2 pixel format information structure ++ * @timeperframe: time per frame expressed as V4L fraction ++ * @scaler: ++ * @ver: mt9t111 chip version ++ * @fps: frames per second value ++ */ ++struct mt9t111_sensor { ++ const struct mt9t111_platform_data *pdata; ++ struct v4l2_int_device *v4l2_int_device; ++ struct i2c_client *i2c_client; ++ struct v4l2_pix_format pix; ++ struct v4l2_fract timeperframe; ++ int scaler; ++ int ver; ++ int fps; ++ int state; ++}; ++ ++static struct mt9t111_sensor mt9t111 = { ++ .timeperframe = { ++ .numerator = 1, ++ .denominator = 10, ++ }, ++ .state = SENSOR_NOT_DETECTED, ++}; ++ ++/** ++ * mt9t111_read_reg - Read a value from a register in an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @data_length: length of data to be read ++ * @reg: register address / offset ++ * @val: stores the value that gets read ++ * ++ * Read a value from a register in an mt9t111 sensor device. ++ * The value is returned in 'val'. ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_read_reg(struct i2c_client *client, u16 reg, u16 *val) ++{ ++ struct i2c_msg msg[1]; ++ u8 data[4]; ++ int err; ++ ++ msg->addr = client->addr; ++ msg->flags = 0; ++ msg->len = 2; ++ msg->buf = data; ++ data[0] = (reg & 0xff00) >> 8; ++ data[1] = (reg & 0x00ff); ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ msg->flags = I2C_M_RD; ++ msg->len = 2; /* 2 byte read */ ++ err = i2c_transfer(client->adapter, msg, 1); ++ if (err >= 0) { ++ *val = ((data[0] & 0x00ff) << 8) ++ | (data[1] & 0x00ff); ++ return 0; ++ } ++ } ++ return err; ++} ++ ++/** ++ * mt9t111_write_reg - Write a value to a register in an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @data_length: length of data to be read ++ * @reg: register address / offset ++ * @val: value to be written to specified register ++ * ++ * Write a value to a register in an mt9t111 sensor device. ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_write_reg(struct i2c_client *client, u16 reg, u16 val) ++{ ++ struct i2c_msg msg[1]; ++ u8 data[20]; ++ int err; ++ ++ msg->addr = client->addr; ++ msg->flags = 0; ++ msg->len = 4; ++ msg->buf = data; ++ data[0] = (u8)((reg & 0xff00) >> 8); ++ data[1] = (u8)(reg & 0x00ff); ++ data[2] = (u8)((val & 0xff00) >> 8); ++ data[3] = (u8)(val & 0x00ff); ++ err = i2c_transfer(client->adapter, msg, 1); ++ ++ return err; ++} ++ ++/** ++ * mt9t111_write_regs - Write registers to an mt9t111 sensor device ++ * @client: i2c driver client structure ++ * @reg_in: pointer to registers to write ++ * @cnt: the number of registers ++ * ++ * Write registers . ++ * Returns zero if successful, or non-zero otherwise. ++ */ ++static int ++mt9t111_write_regs(struct i2c_client *client, mt9t111_regs *reg_in, int cnt) ++{ ++ int err = 0; ++ int i; ++ mt9t111_regs *reg = reg_in; ++ ++ for (i=0;idelay_time == 0) { ++ err |= mt9t111_write_reg(client, reg->addr, reg->data); ++ } else if (reg->addr != 0 || reg->data != 0) { ++ err |= mt9t111_write_reg(client, reg->addr, reg->data); ++ mdelay(reg->delay_time); ++ } else ++ mdelay(reg->delay_time); ++ ++ if (err < 0) { ++ dev_warn(&client->dev, "write reg error, addr = 0x%x, data = 0x%x \n", \ ++ reg->addr, reg->data); ++ return err; ++ } ++ reg++; ++ } ++ return err; ++} ++ ++/** ++ * mt9t111_detect - Detect if an mt9t111 is present, and if so which revision ++ * @client: pointer to the i2c client driver structure ++ * ++ * Detect if an mt9t111 is present ++ * Returns a negative error number if no device is detected, or the ++ * non-negative value of the version ID register if a device is detected. ++ */ ++static int ++mt9t111_detect(struct i2c_client *client) ++{ ++ u16 val; ++ ++ /* chip ID is at address 0 */ ++ if (mt9t111_read_reg(client, MT9T111_CHIP_ID, &val) < 0) ++ return -ENODEV; ++ dev_info(&client->dev, "model id detected 0x%x\n", val); ++ ++ if (val != MT9T111_CHIP_ID_VALUE) { ++ dev_warn(&client->dev, "model id mismatch received 0x%x expecting 0x%x\n", ++ val, MT9T111_CHIP_ID_VALUE); ++ ++ return -ENODEV; ++ } ++ ++ return 0; ++ ++} ++ ++/** ++ * mt9t111_configure - Configure the mt9t111 for the specified image mode ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Configure the mt9t111 for a specified image size, pixel format, and frame ++ * period. xclk is the frequency (in Hz) of the xclk input to the mt9t111. ++ * fper is the frame period (in seconds) expressed as a fraction. ++ * Returns zero if successful, or non-zero otherwise. ++ * The actual frame period is returned in fper. ++ */ ++static int mt9t111_configure(struct v4l2_int_device *s) ++{ ++ debug_dummy("debug_dummy -- to set imager mode"); ++ ++ return 0; ++} ++ ++/** ++ * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes ++ * @s: pointer to standard V4L2 device structure ++ * @frms: pointer to standard V4L2 framesizes enumeration structure ++ * ++ * Returns possible framesizes depending on choosen pixel format ++ **/ ++static int ioctl_enum_framesizes(struct v4l2_int_device *s, ++ struct v4l2_frmsizeenum *frms) ++{ ++ int ifmt; ++ ++ for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { ++ if (frms->pixel_format == mt9t111_formats[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == NUM_CAPTURE_FORMATS) ++ return -EINVAL; ++ ++ /* Do we already reached all discrete framesizes? */ ++ if (frms->index >= NUM_CAPTURE_SIZE) ++ return -EINVAL; ++ ++ frms->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frms->discrete.width = mt9t111_sizes[frms->index].width; ++ frms->discrete.height = mt9t111_sizes[frms->index].height; ++ ++ return 0; ++ ++} ++ ++static int ioctl_enum_frameintervals(struct v4l2_int_device *s, ++ struct v4l2_frmivalenum *frmi) ++{ ++ int ifmt; ++ ++printk(KERN_INFO "entering ioctl_enum_frameintervals\n"); ++printk(KERN_INFO "index = %d, pixel_format = 0x%x, width = %d, height = %d\n", ++ frmi->index, frmi->pixel_format, frmi->width, frmi->height); ++printk(KERN_INFO "mt9t111 format = 0x%x\n", mt9t111_formats[0].pixelformat); ++ ++ if (frmi->index >= NUM_CAPTURE_FRAMEINTERVALS) ++ return -EINVAL; ++ ++ for (ifmt = 0; ifmt < NUM_CAPTURE_FORMATS; ifmt++) { ++ if (frmi->pixel_format == mt9t111_formats[ifmt].pixelformat) ++ break; ++ } ++ /* Is requested pixelformat not found on sensor? */ ++ if (ifmt == NUM_CAPTURE_FORMATS) ++ return -EINVAL; ++ ++ frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; ++ frmi->discrete.numerator = ++ mt9t111_frameintervals[frmi->index].numerator; ++ frmi->discrete.denominator = ++ mt9t111_frameintervals[frmi->index].denominator; ++ return 0; ++} ++ ++/** ++ * ioctl_init - V4L2 sensor interface handler for VIDIOC_INT_INIT ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialize the sensor device (call mt9t111_configure()) ++ */ ++static int ioctl_init(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_dev_exit - V4L2 sensor interface handler for vidioc_int_dev_exit_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Delinitialise the dev. at slave detach. The complement of ioctl_dev_init. ++ */ ++static int ioctl_dev_exit(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_dev_init - V4L2 sensor interface handler for vidioc_int_dev_init_num ++ * @s: pointer to standard V4L2 device structure ++ * ++ * Initialise the device when slave attaches to the master. Returns 0 if ++ * mt9t111 device could be found, otherwise returns appropriate error. ++ */ ++static int ioctl_dev_init(struct v4l2_int_device *s) ++{ ++ return 0; ++} ++ ++/** ++ * ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num ++ * @s: pointer to standard V4L2 device structure ++ * @on: power state to which device is to be set ++ * ++ * Sets devices power state to requrested state, if possible. ++ */ ++static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ struct i2c_client *c = sensor->i2c_client; ++ int rval; ++ ++ if ((on == V4L2_POWER_STANDBY) && (sensor->state == SENSOR_DETECTED)) ++ debug_dummy("debug_dummy -- put to standby\n"); ++ ++ if (on != V4L2_POWER_ON) ++ debug_dummy("debug_dummy -- stop master clock\n"); ++ else ++ debug_dummy("debug_dummy -- enable clock\n");; ++ ++ rval = sensor->pdata->power_set(on); ++ if (rval < 0) { ++ dev_err(&c->dev, "Unable to set the power state: " "mt9t111" ++ " sensor\n"); ++ //sensor->pdata->set_xclk(0); ++ return rval; ++ } ++ ++ if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_DETECTED)) ++ mt9t111_configure(s); ++ ++ if ((on == V4L2_POWER_ON) && (sensor->state == SENSOR_NOT_DETECTED)) { ++ rval = mt9t111_detect(c); ++ if (rval < 0) { ++ dev_err(&c->dev, "Unable to detect " "mt9t111" ++ " sensor\n"); ++ sensor->state = SENSOR_NOT_DETECTED; ++ return rval; ++ } ++ mt9t111_loaddefault(c); ++ sensor->state = SENSOR_DETECTED; ++ sensor->ver = rval; ++ pr_info("mt9t111" " chip version 0x%02x detected\n", ++ sensor->ver); ++ } ++ return 0; ++} ++ ++/** ++ * ioctl_g_priv - V4L2 sensor interface handler for vidioc_int_g_priv_num ++ * @s: pointer to standard V4L2 device structure ++ * @p: void pointer to hold sensor's private data address ++ * ++ * Returns device's (sensor's) private data area address in p parameter ++ */ ++static int ioctl_g_priv(struct v4l2_int_device *s, void *p) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ ++ return sensor->pdata->priv_data_set(p); ++} ++ ++/** ++ * ioctl_s_parm - V4L2 sensor interface handler for VIDIOC_S_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure ++ * ++ * Configures the sensor to use the input parameters, if possible. If ++ * not possible, reverts to the old parameters and returns the ++ * appropriate error code. ++ */ ++static int ioctl_s_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ //TODO: set paramters ++ debug_dummy("debug_dummy -- VIDIOC_S_PARM "); ++ return 0; ++} ++ ++/** ++ * ioctl_g_parm - V4L2 sensor interface handler for VIDIOC_G_PARM ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure ++ * ++ * Returns the sensor's video CAPTURE parameters. ++ */ ++static int ioctl_g_parm(struct v4l2_int_device *s, ++ struct v4l2_streamparm *a) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ struct v4l2_captureparm *cparm = &a->parm.capture; ++ ++ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ++ return -EINVAL; ++ ++ memset(a, 0, sizeof(*a)); ++ a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ ++ cparm->capability = V4L2_CAP_TIMEPERFRAME; ++ cparm->timeperframe = sensor->timeperframe; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_g_fmt_cap - V4L2 sensor interface handler for ioctl_g_fmt_cap ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 v4l2_format structure ++ * ++ * Returns the sensor's current pixel format in the v4l2_format ++ * parameter. ++ */ ++static int ioctl_g_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct mt9t111_sensor *sensor = s->priv; ++ f->fmt.pix = sensor->pix; ++ ++ return 0; ++} ++ ++/** ++ * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl ++ * @s: pointer to standard V4L2 device structure ++ * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure ++ * ++ * Implement the VIDIOC_TRY_FMT ioctl for the CAPTURE buffer type. This ++ * ioctl is used to negotiate the image capture size and pixel format ++ * without actually making it take effect. ++ */ ++static int ioctl_try_fmt_cap(struct v4l2_int_device *s, ++ struct v4l2_format *f) ++{ ++ struct v4l2_pix_format *pix = &f->fmt.pix; ++ struct mt9t111_sensor *sensor = s->priv; ++ struct v4l2_pix_format *pix2 = &sensor->pix; ++ ++ pix->width = 640; ++ pix->height = 480; ++#ifdef USE_RAW ++ pix->pixelformat = V4L2_PIX_FMT_SGRBG10; ++ pix->bytesperline = pix->width; ++ pix->colorspace = V4L2_COLORSPACE_SRGB; ++#else ++ pix->pixelformat = V4L2_PIX_FMT_YUYV; ++ pix->bytesperline = pix->wid