summaryrefslogtreecommitdiffstats
path: root/recipes-kernel
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-05-26 16:19:58 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-05-26 16:19:58 +0200
commitdaa411646120c89e03766b98ad126c7320587829 (patch)
treeaed61d1b9d636b704d3bfdb5d218c6e888806868 /recipes-kernel
parentbf34f61efa7a84c069dc27ddf851cea80d2ab925 (diff)
downloadmeta-ti-daa411646120c89e03766b98ad126c7320587829.tar.gz
linux-omap 2.6.39: update to latest beagle patchset
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-kernel')
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch27
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch6
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/beagleboard/defconfig7
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch918
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch917
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch142
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch34
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch853
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch2
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch4
-rw-r--r--recipes-kernel/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch105
-rw-r--r--recipes-kernel/linux/linux-omap_2.6.39.bb8
77 files changed, 2184 insertions, 1027 deletions
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
index 30063f9d..2bd76c3c 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
@@ -1,4 +1,4 @@
1From 2dd4bf287ad066e3d9e82c239782fb649c6f7fe7 Mon Sep 17 00:00:00 2001 1From 812ef26f4be80d12facd62adce971ec9fe64a144 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net> 2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Fri, 20 May 2011 12:48:37 +0200 3Date: Fri, 20 May 2011 12:48:37 +0200
4Subject: [PATCH 1/5] OMAP3: beagle: add support for beagleboard xM revision C 4Subject: [PATCH 1/5] OMAP3: beagle: add support for beagleboard xM revision C
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch
index f815a58a..ab63acf5 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch
@@ -1,4 +1,4 @@
1From 258a21a495a9ba2238081cd473b4796cd61a60e7 Mon Sep 17 00:00:00 2001 1From e87dd8c997e212b8c14468c869c83d6953da3c34 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net> 2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Fri, 20 May 2011 13:06:24 +0200 3Date: Fri, 20 May 2011 13:06:24 +0200
4Subject: [PATCH 2/5] OMAP3: beagle: add support for expansionboards 4Subject: [PATCH 2/5] OMAP3: beagle: add support for expansionboards
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch
index 0f5c0bd5..7984a30e 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch
@@ -1,4 +1,4 @@
1From b6deb9a9c3a0c8b9afc981cbca20ff73fa7a8d8c Mon Sep 17 00:00:00 2001 1From 140a5cddce807e20e32a5ddcf7c00a758ff5016d Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net> 2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Sat, 21 May 2011 16:18:30 +0200 3Date: Sat, 21 May 2011 16:18:30 +0200
4Subject: [PATCH 3/5] OMAP3: beagle: add MADC support 4Subject: [PATCH 3/5] OMAP3: beagle: add MADC support
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch
index 900502d2..29ebb401 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch
@@ -1,15 +1,15 @@
1From 0ba8b335b9dd023784ef493b524d6335bfcd453a Mon Sep 17 00:00:00 2001 1From 482c65c01edad75e2b8a3fa07f0fc914e3c9b9d9 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net> 2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 25 May 2011 08:56:06 +0200 3Date: Wed, 25 May 2011 08:56:06 +0200
4Subject: [PATCH 4/5] OMAP3: beagle: add regulators for camera interface 4Subject: [PATCH 4/5] OMAP3: beagle: add regulators for camera interface
5 5
6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> 6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7--- 7---
8 arch/arm/mach-omap2/board-omap3beagle.c | 40 +++++++++++++++++++++++++++++++ 8 arch/arm/mach-omap2/board-omap3beagle.c | 50 +++++++++++++++++++++++++++++++
9 1 files changed, 40 insertions(+), 0 deletions(-) 9 1 files changed, 50 insertions(+), 0 deletions(-)
10 10
11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c 11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12index da4ba50..52ea11a 100644 12index da4ba50..211cbdf 100644
13--- a/arch/arm/mach-omap2/board-omap3beagle.c 13--- a/arch/arm/mach-omap2/board-omap3beagle.c
14+++ b/arch/arm/mach-omap2/board-omap3beagle.c 14+++ b/arch/arm/mach-omap2/board-omap3beagle.c
15@@ -453,6 +453,44 @@ static struct regulator_consumer_supply beagle_vsim_supply = { 15@@ -453,6 +453,44 @@ static struct regulator_consumer_supply beagle_vsim_supply = {
@@ -57,7 +57,24 @@ index da4ba50..52ea11a 100644
57 static int beagle_twl_gpio_setup(struct device *dev, 57 static int beagle_twl_gpio_setup(struct device *dev,
58 unsigned gpio, unsigned ngpio) 58 unsigned gpio, unsigned ngpio)
59 { 59 {
60@@ -651,6 +689,8 @@ static struct twl4030_platform_data beagle_twldata = { 60@@ -504,6 +542,16 @@ static int beagle_twl_gpio_setup(struct device *dev,
61 pr_err("%s: unable to configure EHCI_nOC\n", __func__);
62 }
63
64+ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
65+ /*
66+ * Power on camera interface - only on pre-production, not
67+ * needed on production boards
68+ */
69+ gpio_request(gpio + 2, "CAM_EN");
70+ gpio_direction_output(gpio + 2, 1);
71+ }
72+
73+
74 /*
75 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
76 * high / others active low)
77@@ -651,6 +699,8 @@ static struct twl4030_platform_data beagle_twldata = {
61 .vsim = &beagle_vsim, 78 .vsim = &beagle_vsim,
62 .vdac = &beagle_vdac, 79 .vdac = &beagle_vdac,
63 .vpll2 = &beagle_vpll2, 80 .vpll2 = &beagle_vpll2,
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch
index a555c931..c0e31042 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch
@@ -1,4 +1,4 @@
1From 5b0f364b7e017d422b01c0e3297d0b68119f95f0 Mon Sep 17 00:00:00 2001 1From 6654672586808d22510d06d54464f4fe32ae6e80 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net> 2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 25 May 2011 08:57:40 +0200 3Date: Wed, 25 May 2011 08:57:40 +0200
4Subject: [PATCH 5/5] OMAP3: beagle: HACK! add in 1GHz OPP 4Subject: [PATCH 5/5] OMAP3: beagle: HACK! add in 1GHz OPP
@@ -9,10 +9,10 @@ Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 1 files changed, 2 insertions(+), 0 deletions(-) 9 1 files changed, 2 insertions(+), 0 deletions(-)
10 10
11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c 11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12index 52ea11a..cf95173 100644 12index 211cbdf..221bfda 100644
13--- a/arch/arm/mach-omap2/board-omap3beagle.c 13--- a/arch/arm/mach-omap2/board-omap3beagle.c
14+++ b/arch/arm/mach-omap2/board-omap3beagle.c 14+++ b/arch/arm/mach-omap2/board-omap3beagle.c
15@@ -901,11 +901,13 @@ static void __init beagle_opp_init(void) 15@@ -911,11 +911,13 @@ static void __init beagle_opp_init(void)
16 /* Enable MPU 1GHz and lower opps */ 16 /* Enable MPU 1GHz and lower opps */
17 dev = &mh->od->pdev.dev; 17 dev = &mh->od->pdev.dev;
18 r = opp_enable(dev, 800000000); 18 r = opp_enable(dev, 800000000);
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/beagleboard/defconfig b/recipes-kernel/linux/linux-omap-2.6.39/beagleboard/defconfig
index e2502650..c2c9e55a 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/beagleboard/defconfig
+++ b/recipes-kernel/linux/linux-omap-2.6.39/beagleboard/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux/arm 2.6.39 Kernel Configuration 3# Linux/arm 2.6.39 Kernel Configuration
4# Wed May 25 09:25:56 2011 4# Thu May 26 10:49:51 2011
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y 7CONFIG_HAVE_PWM=y
@@ -2041,8 +2041,9 @@ CONFIG_VIDEO_ADV7180=m
2041# CONFIG_VIDEO_BT866 is not set 2041# CONFIG_VIDEO_BT866 is not set
2042# CONFIG_VIDEO_KS0127 is not set 2042# CONFIG_VIDEO_KS0127 is not set
2043CONFIG_VIDEO_OV7670=m 2043CONFIG_VIDEO_OV7670=m
2044CONFIG_VIDEO_MT9P031=m 2044CONFIG_VIDEO_MT9P031=y
2045CONFIG_VIDEO_MT9V011=m 2045CONFIG_VIDEO_MT9V011=m
2046CONFIG_VIDEO_MT9V032=y
2046# CONFIG_VIDEO_TCM825X is not set 2047# CONFIG_VIDEO_TCM825X is not set
2047# CONFIG_VIDEO_SAA7110 is not set 2048# CONFIG_VIDEO_SAA7110 is not set
2048CONFIG_VIDEO_SAA711X=m 2049CONFIG_VIDEO_SAA711X=m
@@ -2090,7 +2091,7 @@ CONFIG_VIDEO_TIMBERDALE=m
2090CONFIG_VIDEO_SR030PC30=m 2091CONFIG_VIDEO_SR030PC30=m
2091CONFIG_VIDEO_NOON010PC30=m 2092CONFIG_VIDEO_NOON010PC30=m
2092CONFIG_VIDEO_OMAP3=y 2093CONFIG_VIDEO_OMAP3=y
2093# CONFIG_VIDEO_OMAP3_DEBUG is not set 2094CONFIG_VIDEO_OMAP3_DEBUG=y
2094# CONFIG_SOC_CAMERA is not set 2095# CONFIG_SOC_CAMERA is not set
2095CONFIG_V4L_USB_DRIVERS=y 2096CONFIG_V4L_USB_DRIVERS=y
2096CONFIG_USB_VIDEO_CLASS=m 2097CONFIG_USB_VIDEO_CLASS=m
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch b/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch
new file mode 100644
index 00000000..9746415f
--- /dev/null
+++ b/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch
@@ -0,0 +1,918 @@
1From 327e65fc0d86911bda7c1f37fb5c3534d1b2c849 Mon Sep 17 00:00:00 2001
2From: Javier Martin <javier.martin@vista-silicon.com>
3Date: Thu, 26 May 2011 07:20:53 +0000
4Subject: [PATCH 1/4] Add mt9p031 sensor driver.
5
6This patch applies on 2.6.39 (commit 61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf).
7It has some power management issue which causes horizontal random lines on
8the image. If we do not disable 1v8 regulator, the problem disappears.
9I would like to get some help on fixing whatever the problem with power
10management is.
11
12Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
13---
14 drivers/media/video/Kconfig | 7 +
15 drivers/media/video/Makefile | 1 +
16 drivers/media/video/mt9p031.c | 841 +++++++++++++++++++++++++++++++++++++++++
17 include/media/mt9p031.h | 11 +
18 4 files changed, 860 insertions(+), 0 deletions(-)
19 create mode 100644 drivers/media/video/mt9p031.c
20 create mode 100644 include/media/mt9p031.h
21
22diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
23index 00f51dd..cb87e35 100644
24--- a/drivers/media/video/Kconfig
25+++ b/drivers/media/video/Kconfig
26@@ -329,6 +329,13 @@ config VIDEO_OV7670
27 OV7670 VGA camera. It currently only works with the M88ALP01
28 controller.
29
30+config VIDEO_MT9P031
31+ tristate "Aptina MT9P031 support"
32+ depends on I2C && VIDEO_V4L2
33+ ---help---
34+ This is a Video4Linux2 sensor-level driver for the Aptina
35+ (Micron) mt9p031 5 Mpixel camera.
36+
37 config VIDEO_MT9V011
38 tristate "Micron mt9v011 sensor support"
39 depends on I2C && VIDEO_V4L2
40diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
41index ace5d8b..912b29b 100644
42--- a/drivers/media/video/Makefile
43+++ b/drivers/media/video/Makefile
44@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
45 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
46 obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
47 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
48+obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
49 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
50 obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
51 obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
52diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
53new file mode 100644
54index 0000000..242bea9
55--- /dev/null
56+++ b/drivers/media/video/mt9p031.c
57@@ -0,0 +1,841 @@
58+/*
59+ * Driver for MT9P031 CMOS Image Sensor from Aptina
60+ *
61+ * Copyright (C) 2011, Javier Martin <javier.martin@vista-silicon.com>
62+ *
63+ * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
64+ *
65+ * Based on the MT9V032 driver and Bastian Hecht's code.
66+ *
67+ * This program is free software; you can redistribute it and/or modify
68+ * it under the terms of the GNU General Public License version 2 as
69+ * published by the Free Software Foundation.
70+ */
71+
72+#include <linux/delay.h>
73+#include <linux/device.h>
74+#include <linux/i2c.h>
75+#include <linux/log2.h>
76+#include <linux/pm.h>
77+#include <linux/regulator/consumer.h>
78+#include <linux/slab.h>
79+#include <media/v4l2-subdev.h>
80+#include <linux/videodev2.h>
81+
82+#include <media/mt9p031.h>
83+#include <media/v4l2-chip-ident.h>
84+#include <media/v4l2-subdev.h>
85+#include <media/v4l2-device.h>
86+
87+#define MT9P031_PIXCLK_FREQ 54000000
88+
89+/* mt9p031 selected register addresses */
90+#define MT9P031_CHIP_VERSION 0x00
91+#define MT9P031_CHIP_VERSION_VALUE 0x1801
92+#define MT9P031_ROW_START 0x01
93+#define MT9P031_ROW_START_DEF 54
94+#define MT9P031_COLUMN_START 0x02
95+#define MT9P031_COLUMN_START_DEF 16
96+#define MT9P031_WINDOW_HEIGHT 0x03
97+#define MT9P031_WINDOW_WIDTH 0x04
98+#define MT9P031_H_BLANKING 0x05
99+#define MT9P031_H_BLANKING_VALUE 0
100+#define MT9P031_V_BLANKING 0x06
101+#define MT9P031_V_BLANKING_VALUE 25
102+#define MT9P031_OUTPUT_CONTROL 0x07
103+#define MT9P031_OUTPUT_CONTROL_CEN 2
104+#define MT9P031_OUTPUT_CONTROL_SYN 1
105+#define MT9P031_SHUTTER_WIDTH_UPPER 0x08
106+#define MT9P031_SHUTTER_WIDTH 0x09
107+#define MT9P031_PIXEL_CLOCK_CONTROL 0x0a
108+#define MT9P031_FRAME_RESTART 0x0b
109+#define MT9P031_SHUTTER_DELAY 0x0c
110+#define MT9P031_RST 0x0d
111+#define MT9P031_RST_ENABLE 1
112+#define MT9P031_RST_DISABLE 0
113+#define MT9P031_READ_MODE_1 0x1e
114+#define MT9P031_READ_MODE_2 0x20
115+#define MT9P031_READ_MODE_2_ROW_MIR 0x8000
116+#define MT9P031_READ_MODE_2_COL_MIR 0x4000
117+#define MT9P031_ROW_ADDRESS_MODE 0x22
118+#define MT9P031_COLUMN_ADDRESS_MODE 0x23
119+#define MT9P031_GLOBAL_GAIN 0x35
120+
121+#define MT9P031_WINDOW_HEIGHT_MAX 1944
122+#define MT9P031_WINDOW_WIDTH_MAX 2592
123+#define MT9P031_WINDOW_HEIGHT_MIN 2
124+#define MT9P031_WINDOW_WIDTH_MIN 18
125+
126+struct mt9p031 {
127+ struct v4l2_subdev subdev;
128+ struct media_pad pad;
129+ struct v4l2_rect rect; /* Sensor window */
130+ struct v4l2_mbus_framefmt format;
131+ struct mt9p031_platform_data *pdata;
132+ struct mutex power_lock; /* lock to protect power_count */
133+ int power_count;
134+ u16 xskip;
135+ u16 yskip;
136+ /* cache register values */
137+ u16 output_control;
138+ u16 h_blanking;
139+ u16 v_blanking;
140+ u16 column_address_mode;
141+ u16 row_address_mode;
142+ u16 column_start;
143+ u16 row_start;
144+ u16 window_width;
145+ u16 window_height;
146+ struct regulator *reg_1v8;
147+ struct regulator *reg_2v8;
148+};
149+
150+static struct mt9p031 *to_mt9p031(const struct i2c_client *client)
151+{
152+ return container_of(i2c_get_clientdata(client), struct mt9p031, subdev);
153+}
154+
155+static int reg_read(struct i2c_client *client, const u8 reg)
156+{
157+ s32 data = i2c_smbus_read_word_data(client, reg);
158+ return data < 0 ? data : swab16(data);
159+}
160+
161+static int reg_write(struct i2c_client *client, const u8 reg,
162+ const u16 data)
163+{
164+ return i2c_smbus_write_word_data(client, reg, swab16(data));
165+}
166+
167+static int reg_write_cached(struct i2c_client *client, const u8 reg,
168+ const u16 data, u16 *cache)
169+{
170+ int ret;
171+
172+ ret = reg_write(client, reg, data);
173+ if (ret < 0)
174+ return ret;
175+ *cache = data;
176+ return 0;
177+}
178+
179+static int mt9p031_set_output_control(struct mt9p031 *mt9p031, u16 clear,
180+ u16 set)
181+{
182+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
183+ u16 value = (mt9p031->output_control & ~clear) | set;
184+
185+ return reg_write_cached(client, MT9P031_OUTPUT_CONTROL, value,
186+ &mt9p031->output_control);
187+}
188+
189+static int restore_registers(struct i2c_client *client)
190+{
191+ int ret;
192+ struct mt9p031 *mt9p031 = to_mt9p031(client);
193+
194+ /* Disable register update, reconfigure atomically */
195+ ret = mt9p031_set_output_control(mt9p031, 0,
196+ MT9P031_OUTPUT_CONTROL_SYN);
197+ if (ret < 0)
198+ return ret;
199+
200+ /* Blanking and start values - default... */
201+ ret = reg_write(client, MT9P031_H_BLANKING, mt9p031->h_blanking);
202+ if (ret < 0)
203+ return ret;
204+
205+ ret = reg_write(client, MT9P031_V_BLANKING, mt9p031->v_blanking);
206+ if (ret < 0)
207+ return ret;
208+
209+ ret = reg_write(client, MT9P031_COLUMN_ADDRESS_MODE,
210+ mt9p031->column_address_mode);
211+ if (ret < 0)
212+ return ret;
213+
214+ ret = reg_write(client, MT9P031_ROW_ADDRESS_MODE,
215+ mt9p031->row_address_mode);
216+ if (ret < 0)
217+ return ret;
218+
219+ ret = reg_write(client, MT9P031_COLUMN_START,
220+ mt9p031->column_start);
221+ if (ret < 0)
222+ return ret;
223+
224+ ret = reg_write(client, MT9P031_ROW_START,
225+ mt9p031->row_start);
226+ if (ret < 0)
227+ return ret;
228+
229+ ret = reg_write(client, MT9P031_WINDOW_WIDTH,
230+ mt9p031->window_width);
231+ if (ret < 0)
232+ return ret;
233+
234+ ret = reg_write(client, MT9P031_WINDOW_HEIGHT,
235+ mt9p031->window_height);
236+ if (ret < 0)
237+ return ret;
238+
239+ /* Re-enable register update, commit all changes */
240+ ret = mt9p031_set_output_control(mt9p031,
241+ MT9P031_OUTPUT_CONTROL_SYN, 0);
242+ if (ret < 0)
243+ return ret;
244+ return 0;
245+}
246+
247+static int mt9p031_reset(struct i2c_client *client)
248+{
249+ struct mt9p031 *mt9p031 = to_mt9p031(client);
250+ int ret;
251+
252+ /* Disable chip output, synchronous option update */
253+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_ENABLE);
254+ if (ret < 0)
255+ return ret;
256+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_DISABLE);
257+ if (ret < 0)
258+ return ret;
259+ return mt9p031_set_output_control(mt9p031,
260+ MT9P031_OUTPUT_CONTROL_CEN, 0);
261+}
262+
263+static int mt9p031_power_on(struct mt9p031 *mt9p031)
264+{
265+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
266+ int ret;
267+
268+ /* Ensure RESET_BAR is low */
269+ if (mt9p031->pdata->reset)
270+ mt9p031->pdata->reset(&mt9p031->subdev, 1);
271+ /* turn on digital supply first */
272+ ret = regulator_enable(mt9p031->reg_1v8);
273+ if (ret) {
274+ dev_err(&client->dev,
275+ "Failed to enable 1.8v regulator: %d\n", ret);
276+ goto err_1v8;
277+ }
278+ /* now turn on analog supply */
279+ ret = regulator_enable(mt9p031->reg_2v8);
280+ if (ret) {
281+ dev_err(&client->dev,
282+ "Failed to enable 2.8v regulator: %d\n", ret);
283+ goto err_rst;
284+ }
285+ /* Now RESET_BAR must be high */
286+ if (mt9p031->pdata->reset)
287+ mt9p031->pdata->reset(&mt9p031->subdev, 0);
288+
289+ if (mt9p031->pdata->set_xclk)
290+ mt9p031->pdata->set_xclk(&mt9p031->subdev, MT9P031_PIXCLK_FREQ);
291+
292+ /* soft reset */
293+ ret = mt9p031_reset(client);
294+ if (ret < 0) {
295+ dev_err(&client->dev, "Failed to reset the camera\n");
296+ goto err_rst;
297+ }
298+
299+ ret = restore_registers(client);
300+ if (ret < 0) {
301+ dev_err(&client->dev, "Failed to restore registers\n");
302+ goto err_rst;
303+ }
304+
305+ return 0;
306+err_rst:
307+ regulator_disable(mt9p031->reg_1v8);
308+err_1v8:
309+ return ret;
310+
311+}
312+
313+static void mt9p031_power_off(struct mt9p031 *mt9p031)
314+{
315+ if (mt9p031->pdata->set_xclk)
316+ mt9p031->pdata->set_xclk(&mt9p031->subdev, 0);
317+ if (mt9p031->pdata->reset)
318+ mt9p031->pdata->reset(&mt9p031->subdev, 1);
319+ regulator_disable(mt9p031->reg_1v8);
320+ regulator_disable(mt9p031->reg_2v8);
321+}
322+
323+static int mt9p031_enum_mbus_code(struct v4l2_subdev *sd,
324+ struct v4l2_subdev_fh *fh,
325+ struct v4l2_subdev_mbus_code_enum *code)
326+{
327+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
328+
329+ if (code->pad || code->index)
330+ return -EINVAL;
331+
332+ code->code = mt9p031->format.code;
333+
334+ return 0;
335+}
336+
337+static struct v4l2_mbus_framefmt *mt9p031_get_pad_format(
338+ struct mt9p031 *mt9p031,
339+ struct v4l2_subdev_fh *fh,
340+ unsigned int pad, u32 which)
341+{
342+ switch (which) {
343+ case V4L2_SUBDEV_FORMAT_TRY:
344+ return v4l2_subdev_get_try_format(fh, pad);
345+ case V4L2_SUBDEV_FORMAT_ACTIVE:
346+ return &mt9p031->format;
347+ default:
348+ return NULL;
349+ }
350+}
351+
352+static struct v4l2_rect *mt9p031_get_pad_crop(struct mt9p031 *mt9p031,
353+ struct v4l2_subdev_fh *fh, unsigned int pad, u32 which)
354+{
355+ switch (which) {
356+ case V4L2_SUBDEV_FORMAT_TRY:
357+ return v4l2_subdev_get_try_crop(fh, pad);
358+ case V4L2_SUBDEV_FORMAT_ACTIVE:
359+ return &mt9p031->rect;
360+ default:
361+ return NULL;
362+ }
363+}
364+
365+static int mt9p031_get_crop(struct v4l2_subdev *sd,
366+ struct v4l2_subdev_fh *fh,
367+ struct v4l2_subdev_crop *crop)
368+{
369+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
370+ struct v4l2_rect *rect = mt9p031_get_pad_crop(mt9p031, fh, crop->pad,
371+ crop->which);
372+ if (!rect)
373+ return -EINVAL;
374+
375+ crop->rect = *rect;
376+
377+ return 0;
378+}
379+
380+static u16 mt9p031_skip_for_crop(s32 source, s32 *target, s32 max_skip)
381+{
382+ unsigned int skip;
383+
384+ if (source - source / 4 < *target) {
385+ *target = source;
386+ return 1;
387+ }
388+
389+ skip = DIV_ROUND_CLOSEST(source, *target);
390+ if (skip > max_skip)
391+ skip = max_skip;
392+ *target = 2 * DIV_ROUND_UP(source, 2 * skip);
393+
394+ return skip;
395+}
396+
397+static int mt9p031_set_params(struct i2c_client *client,
398+ struct v4l2_rect *rect, u16 xskip, u16 yskip)
399+{
400+ struct mt9p031 *mt9p031 = to_mt9p031(client);
401+ int ret;
402+ u16 xbin, ybin;
403+ const u16 hblank = MT9P031_H_BLANKING_VALUE,
404+ vblank = MT9P031_V_BLANKING_VALUE;
405+ __s32 left, top, width, height;
406+
407+ /*
408+ * TODO: Attention! When implementing horizontal flipping, adjust
409+ * alignment according to R2 "Column Start" description in the datasheet
410+ */
411+ if (xskip & 1) {
412+ xbin = 1;
413+ left = rect->left & (~3);
414+ } else if (xskip & 2) {
415+ xbin = 2;
416+ left = rect->left & (~7);
417+ } else {
418+ xbin = 4;
419+ left = rect->left & (~15);
420+ }
421+ top = rect->top & (~1);
422+ width = rect->width;
423+ height = rect->height;
424+
425+ ybin = min(yskip, (u16)4);
426+
427+ /* Disable register update, reconfigure atomically */
428+ ret = mt9p031_set_output_control(mt9p031, 0,
429+ MT9P031_OUTPUT_CONTROL_SYN);
430+ if (ret < 0)
431+ return ret;
432+
433+ dev_dbg(&client->dev, "skip %u:%u, rect %ux%u@%u:%u\n",
434+ xskip, yskip, rect->width, rect->height, rect->left, rect->top);
435+
436+ /* Blanking and start values - default... */
437+ ret = reg_write_cached(client, MT9P031_H_BLANKING, hblank,
438+ &mt9p031->h_blanking);
439+ if (ret < 0)
440+ return ret;
441+ ret = reg_write_cached(client, MT9P031_V_BLANKING, vblank,
442+ &mt9p031->v_blanking);
443+ if (ret < 0)
444+ return ret;
445+
446+ ret = reg_write_cached(client, MT9P031_COLUMN_ADDRESS_MODE,
447+ ((xbin - 1) << 4) | (xskip - 1),
448+ &mt9p031->column_address_mode);
449+ if (ret < 0)
450+ return ret;
451+ ret = reg_write_cached(client, MT9P031_ROW_ADDRESS_MODE,
452+ ((ybin - 1) << 4) | (yskip - 1),
453+ &mt9p031->row_address_mode);
454+ if (ret < 0)
455+ return ret;
456+
457+ dev_dbg(&client->dev, "new physical left %u, top %u\n",
458+ rect->left, rect->top);
459+
460+ ret = reg_write_cached(client, MT9P031_COLUMN_START,
461+ rect->left + MT9P031_COLUMN_START_DEF,
462+ &mt9p031->column_start);
463+ if (ret < 0)
464+ return ret;
465+ ret = reg_write_cached(client, MT9P031_ROW_START,
466+ rect->top + MT9P031_ROW_START_DEF,
467+ &mt9p031->row_start);
468+ if (ret < 0)
469+ return ret;
470+ ret = reg_write_cached(client, MT9P031_WINDOW_WIDTH,
471+ rect->width - 1,
472+ &mt9p031->window_width);
473+ if (ret < 0)
474+ return ret;
475+ ret = reg_write_cached(client, MT9P031_WINDOW_HEIGHT,
476+ rect->height - 1,
477+ &mt9p031->window_height);
478+ if (ret < 0)
479+ return ret;
480+
481+ /* Re-enable register update, commit all changes */
482+ ret = mt9p031_set_output_control(mt9p031,
483+ MT9P031_OUTPUT_CONTROL_SYN, 0);
484+ if (ret < 0)
485+ return ret;
486+
487+ mt9p031->xskip = xskip;
488+ mt9p031->yskip = yskip;
489+ return ret;
490+}
491+
492+static int mt9p031_set_crop(struct v4l2_subdev *sd,
493+ struct v4l2_subdev_fh *fh,
494+ struct v4l2_subdev_crop *crop)
495+{
496+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
497+ struct v4l2_mbus_framefmt *f;
498+ struct v4l2_rect *c;
499+ struct v4l2_rect rect;
500+ u16 xskip, yskip;
501+ s32 width, height;
502+
503+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u@%u:%u : %u)\n",
504+ __func__, crop->rect.width, crop->rect.height,
505+ crop->rect.left, crop->rect.top, crop->which);
506+
507+ /*
508+ * Clamp the crop rectangle boundaries and align them to a multiple of 2
509+ * pixels.
510+ */
511+ rect.width = ALIGN(clamp(crop->rect.width,
512+ MT9P031_WINDOW_WIDTH_MIN, MT9P031_WINDOW_WIDTH_MAX), 2);
513+ rect.height = ALIGN(clamp(crop->rect.height,
514+ MT9P031_WINDOW_HEIGHT_MIN, MT9P031_WINDOW_HEIGHT_MAX), 2);
515+ rect.left = ALIGN(clamp(crop->rect.left,
516+ 0, MT9P031_WINDOW_WIDTH_MAX - rect.width), 2);
517+ rect.top = ALIGN(clamp(crop->rect.top,
518+ 0, MT9P031_WINDOW_HEIGHT_MAX - rect.height), 2);
519+
520+ c = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, crop->which);
521+
522+ if (rect.width != c->width || rect.height != c->height) {
523+ /*
524+ * Reset the output image size if the crop rectangle size has
525+ * been modified.
526+ */
527+ f = mt9p031_get_pad_format(mt9p031, fh, crop->pad,
528+ crop->which);
529+ width = f->width;
530+ height = f->height;
531+
532+ xskip = mt9p031_skip_for_crop(rect.width, &width, 7);
533+ yskip = mt9p031_skip_for_crop(rect.height, &height, 8);
534+ } else {
535+ xskip = mt9p031->xskip;
536+ yskip = mt9p031->yskip;
537+ f = NULL;
538+ }
539+ if (f) {
540+ f->width = width;
541+ f->height = height;
542+ }
543+
544+ *c = rect;
545+ crop->rect = rect;
546+
547+ mt9p031->xskip = xskip;
548+ mt9p031->yskip = yskip;
549+ mt9p031->rect = *c;
550+ return 0;
551+}
552+
553+static int mt9p031_get_format(struct v4l2_subdev *sd,
554+ struct v4l2_subdev_fh *fh,
555+ struct v4l2_subdev_format *fmt)
556+{
557+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
558+
559+ fmt->format =
560+ *mt9p031_get_pad_format(mt9p031, fh, fmt->pad, fmt->which);
561+ return 0;
562+}
563+
564+static u16 mt9p031_skip_for_scale(s32 *source, s32 target,
565+ s32 max_skip, s32 max)
566+{
567+ unsigned int skip;
568+
569+ if (*source - *source / 4 < target) {
570+ *source = target;
571+ return 1;
572+ }
573+
574+ skip = min(max, *source + target / 2) / target;
575+ if (skip > max_skip)
576+ skip = max_skip;
577+ *source = target * skip;
578+
579+ return skip;
580+}
581+
582+static int mt9p031_fmt_validate(struct v4l2_subdev *sd,
583+ struct v4l2_subdev_format *fmt)
584+{
585+ struct v4l2_mbus_framefmt *format = &fmt->format;
586+
587+ /* Hardcode code and colorspace as sensor only supports one */
588+ format->code = V4L2_MBUS_FMT_SGRBG12_1X12;
589+ format->colorspace = V4L2_COLORSPACE_SRGB;
590+
591+ format->width = clamp_t(int, ALIGN(format->width, 2), 2,
592+ MT9P031_WINDOW_WIDTH_MAX);
593+ format->height = clamp_t(int, ALIGN(format->height, 2), 2,
594+ MT9P031_WINDOW_HEIGHT_MAX);
595+ format->field = V4L2_FIELD_NONE;
596+
597+ return 0;
598+}
599+
600+static int mt9p031_set_format(struct v4l2_subdev *sd,
601+ struct v4l2_subdev_fh *fh,
602+ struct v4l2_subdev_format *format)
603+{
604+ struct v4l2_subdev_format sdf = *format;
605+ struct v4l2_mbus_framefmt *__format, *format_bak = &sdf.format;
606+ struct v4l2_rect *__crop, rect;
607+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
608+ u16 xskip, yskip;
609+ int ret;
610+
611+ __crop = mt9p031_get_pad_crop(mt9p031, fh, format->pad, format->which);
612+
613+ ret = mt9p031_fmt_validate(sd, &sdf);
614+ if (ret < 0)
615+ return ret;
616+ rect.width = __crop->width;
617+ rect.height = __crop->height;
618+
619+ xskip = mt9p031_skip_for_scale(&rect.width, format_bak->width, 7,
620+ MT9P031_WINDOW_WIDTH_MAX);
621+ if (rect.width + __crop->left > MT9P031_WINDOW_WIDTH_MAX)
622+ rect.left = (MT9P031_WINDOW_WIDTH_MAX - rect.width) / 2;
623+ else
624+ rect.left = __crop->left;
625+ yskip = mt9p031_skip_for_scale(&rect.height, format_bak->height, 8,
626+ MT9P031_WINDOW_HEIGHT_MAX);
627+ if (rect.height + __crop->top > MT9P031_WINDOW_HEIGHT_MAX)
628+ rect.top = (MT9P031_WINDOW_HEIGHT_MAX - rect.height) / 2;
629+ else
630+ rect.top = __crop->top;
631+
632+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u : %u)\n", __func__,
633+ format_bak->width, format_bak->height, format->which);
634+ if (__crop)
635+ *__crop = rect;
636+
637+ __format = mt9p031_get_pad_format(mt9p031, fh, format->pad, format->which);
638+ *__format = *format_bak;
639+ format->format = *format_bak;
640+
641+ mt9p031->xskip = xskip;
642+ mt9p031->yskip = yskip;
643+ mt9p031->rect = *__crop;
644+ return 0;
645+}
646+
647+static int mt9p031_s_stream(struct v4l2_subdev *sd, int enable)
648+{
649+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
650+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
651+ struct v4l2_rect rect = mt9p031->rect;
652+ u16 xskip = mt9p031->xskip;
653+ u16 yskip = mt9p031->yskip;
654+ int ret;
655+
656+ if (enable) {
657+ ret = mt9p031_set_params(client, &rect, xskip, yskip);
658+ if (ret < 0)
659+ return ret;
660+ /* Switch to master "normal" mode */
661+ ret = mt9p031_set_output_control(mt9p031, 0,
662+ MT9P031_OUTPUT_CONTROL_CEN);
663+ } else {
664+ /* Stop sensor readout */
665+ ret = mt9p031_set_output_control(mt9p031,
666+ MT9P031_OUTPUT_CONTROL_CEN, 0);
667+ }
668+ return ret;
669+}
670+
671+static int mt9p031_video_probe(struct i2c_client *client)
672+{
673+ s32 data;
674+
675+ /* Read out the chip version register */
676+ data = reg_read(client, MT9P031_CHIP_VERSION);
677+ if (data != MT9P031_CHIP_VERSION_VALUE) {
678+ dev_err(&client->dev,
679+ "No MT9P031 chip detected, register read %x\n", data);
680+ return -ENODEV;
681+ }
682+
683+ dev_info(&client->dev, "Detected a MT9P031 chip ID %x\n", data);
684+
685+ return 0;
686+}
687+
688+static int mt9p031_set_power(struct v4l2_subdev *sd, int on)
689+{
690+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
691+ int ret = 0;
692+
693+ mutex_lock(&mt9p031->power_lock);
694+
695+ /*
696+ * If the power count is modified from 0 to != 0 or from != 0 to 0,
697+ * update the power state.
698+ */
699+ if (mt9p031->power_count == !on) {
700+ if (on) {
701+ ret = mt9p031_power_on(mt9p031);
702+ if (ret) {
703+ dev_err(mt9p031->subdev.v4l2_dev->dev,
704+ "Failed to enable 2.8v regulator: %d\n", ret);
705+ goto out;
706+ }
707+ } else {
708+ mt9p031_power_off(mt9p031);
709+ }
710+ }
711+
712+ /* Update the power count. */
713+ mt9p031->power_count += on ? 1 : -1;
714+ WARN_ON(mt9p031->power_count < 0);
715+
716+out:
717+ mutex_unlock(&mt9p031->power_lock);
718+ return ret;
719+}
720+
721+static int mt9p031_registered(struct v4l2_subdev *sd)
722+{
723+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
724+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
725+ int ret;
726+
727+ ret = mt9p031_set_power(&mt9p031->subdev, 1);
728+ if (ret) {
729+ dev_err(&client->dev,
730+ "Failed to power on device: %d\n", ret);
731+ goto err_pwron;
732+ }
733+
734+ ret = mt9p031_video_probe(client);
735+ if (ret)
736+ goto err_evprobe;
737+
738+ mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE;
739+ ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0);
740+ if (ret)
741+ goto err_evprobe;
742+
743+ mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
744+ mt9p031_set_power(&mt9p031->subdev, 0);
745+
746+ return 0;
747+err_evprobe:
748+ mt9p031_set_power(&mt9p031->subdev, 0);
749+err_pwron:
750+ return ret;
751+}
752+
753+static int mt9p031_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
754+{
755+ struct mt9p031 *mt9p031;
756+ mt9p031 = container_of(sd, struct mt9p031, subdev);
757+
758+ mt9p031->rect.width = MT9P031_WINDOW_WIDTH_MAX;
759+ mt9p031->rect.height = MT9P031_WINDOW_HEIGHT_MAX;
760+ mt9p031->rect.left = MT9P031_COLUMN_START_DEF;
761+ mt9p031->rect.top = MT9P031_ROW_START_DEF;
762+
763+ mt9p031->format.code = V4L2_MBUS_FMT_SGRBG12_1X12;
764+ mt9p031->format.width = MT9P031_WINDOW_WIDTH_MAX;
765+ mt9p031->format.height = MT9P031_WINDOW_HEIGHT_MAX;
766+ mt9p031->format.field = V4L2_FIELD_NONE;
767+ mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB;
768+
769+ mt9p031->xskip = 1;
770+ mt9p031->yskip = 1;
771+ return mt9p031_set_power(sd, 1);
772+}
773+
774+static int mt9p031_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
775+{
776+ return mt9p031_set_power(sd, 0);
777+}
778+
779+static struct v4l2_subdev_core_ops mt9p031_subdev_core_ops = {
780+ .s_power = mt9p031_set_power,
781+};
782+
783+static struct v4l2_subdev_video_ops mt9p031_subdev_video_ops = {
784+ .s_stream = mt9p031_s_stream,
785+};
786+
787+static struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = {
788+ .enum_mbus_code = mt9p031_enum_mbus_code,
789+ .get_fmt = mt9p031_get_format,
790+ .set_fmt = mt9p031_set_format,
791+ .get_crop = mt9p031_get_crop,
792+ .set_crop = mt9p031_set_crop,
793+};
794+
795+static struct v4l2_subdev_ops mt9p031_subdev_ops = {
796+ .core = &mt9p031_subdev_core_ops,
797+ .video = &mt9p031_subdev_video_ops,
798+ .pad = &mt9p031_subdev_pad_ops,
799+};
800+
801+static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = {
802+ .registered = mt9p031_registered,
803+ .open = mt9p031_open,
804+ .close = mt9p031_close,
805+};
806+
807+static int mt9p031_probe(struct i2c_client *client,
808+ const struct i2c_device_id *did)
809+{
810+ struct mt9p031 *mt9p031;
811+ struct mt9p031_platform_data *pdata = client->dev.platform_data;
812+ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
813+ int ret;
814+
815+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
816+ dev_warn(&adapter->dev,
817+ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
818+ return -EIO;
819+ }
820+
821+ mt9p031 = kzalloc(sizeof(struct mt9p031), GFP_KERNEL);
822+ if (!mt9p031)
823+ return -ENOMEM;
824+
825+ mutex_init(&mt9p031->power_lock);
826+ v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops);
827+ mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops;
828+
829+ mt9p031->pdata = pdata;
830+
831+ mt9p031->reg_1v8 = regulator_get(NULL, "cam_1v8");
832+ if (IS_ERR(mt9p031->reg_1v8)) {
833+ ret = PTR_ERR(mt9p031->reg_1v8);
834+ dev_err(mt9p031->subdev.v4l2_dev->dev,
835+ "Failed 1.8v regulator: %d\n", ret);
836+ goto err_e1v8;
837+ }
838+
839+ mt9p031->reg_2v8 = regulator_get(NULL, "cam_2v8");
840+ if (IS_ERR(mt9p031->reg_2v8)) {
841+ ret = PTR_ERR(mt9p031->reg_2v8);
842+ dev_err(mt9p031->subdev.v4l2_dev->dev,
843+ "Failed 2.8v regulator: %d\n", ret);
844+ goto err_e2v8;
845+ }
846+ return 0;
847+err_e2v8:
848+ regulator_put(mt9p031->reg_1v8);
849+err_e1v8:
850+ kfree(mt9p031);
851+ return ret;
852+}
853+
854+static int mt9p031_remove(struct i2c_client *client)
855+{
856+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
857+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
858+
859+ v4l2_device_unregister_subdev(sd);
860+ media_entity_cleanup(&sd->entity);
861+ regulator_put(mt9p031->reg_2v8);
862+ regulator_put(mt9p031->reg_1v8);
863+ kfree(mt9p031);
864+
865+ return 0;
866+}
867+
868+static const struct i2c_device_id mt9p031_id[] = {
869+ { "mt9p031", 0 },
870+ { }
871+};
872+MODULE_DEVICE_TABLE(i2c, mt9p031_id);
873+
874+static struct i2c_driver mt9p031_i2c_driver = {
875+ .driver = {
876+ .name = "mt9p031",
877+ },
878+ .probe = mt9p031_probe,
879+ .remove = mt9p031_remove,
880+ .id_table = mt9p031_id,
881+};
882+
883+static int __init mt9p031_mod_init(void)
884+{
885+ return i2c_add_driver(&mt9p031_i2c_driver);
886+}
887+
888+static void __exit mt9p031_mod_exit(void)
889+{
890+ i2c_del_driver(&mt9p031_i2c_driver);
891+}
892+
893+module_init(mt9p031_mod_init);
894+module_exit(mt9p031_mod_exit);
895+
896+MODULE_DESCRIPTION("Aptina MT9P031 Camera driver");
897+MODULE_AUTHOR("Bastian Hecht <hechtb@gmail.com>");
898+MODULE_LICENSE("GPL v2");
899diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
900new file mode 100644
901index 0000000..7ee9733
902--- /dev/null
903+++ b/include/media/mt9p031.h
904@@ -0,0 +1,11 @@
905+#ifndef MT9P031_H
906+#define MT9P031_H
907+
908+struct v4l2_subdev;
909+
910+struct mt9p031_platform_data {
911+ int (*set_xclk)(struct v4l2_subdev *subdev, int hz);
912+ int (*reset)(struct v4l2_subdev *subdev, int active);
913+};
914+
915+#endif
916--
9171.6.6.1
918
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch b/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch
deleted file mode 100644
index 2d7ee7ae..00000000
--- a/recipes-kernel/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch
+++ /dev/null
@@ -1,917 +0,0 @@
1From 69f7b0ee14f046e469d616611ee87836e04219b4 Mon Sep 17 00:00:00 2001
2From: Javier Martin <javier.martin@vista-silicon.com>
3Date: Tue, 24 May 2011 16:30:43 +0200
4Subject: [PATCH] Add mt9p031 sensor support.
5
6This RFC includes a power management implementation that causes
7the sensor to show images with horizontal artifacts (usually
8monochrome lines that appear on the image randomly).
9
10Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
11Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
12---
13 drivers/media/video/Kconfig | 7 +
14 drivers/media/video/Makefile | 1 +
15 drivers/media/video/mt9p031.c | 841 +++++++++++++++++++++++++++++++++++++++++
16 include/media/mt9p031.h | 11 +
17 4 files changed, 860 insertions(+), 0 deletions(-)
18 create mode 100644 drivers/media/video/mt9p031.c
19 create mode 100644 include/media/mt9p031.h
20
21diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
22index 00f51dd..8a596cc 100644
23--- a/drivers/media/video/Kconfig
24+++ b/drivers/media/video/Kconfig
25@@ -329,6 +329,13 @@ config VIDEO_OV7670
26 OV7670 VGA camera. It currently only works with the M88ALP01
27 controller.
28
29+config VIDEO_MT9P031
30+ tristate "Aptina MT9P031 support"
31+ depends on I2C && VIDEO_V4L2
32+ ---help---
33+ This is a Video4Linux2 sensor-level driver for the Aptina
34+ (Micron) mt9p031 5 Mpixel camera.
35+
36 config VIDEO_MT9V011
37 tristate "Micron mt9v011 sensor support"
38 depends on I2C && VIDEO_V4L2
39diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
40index ace5d8b..912b29b 100644
41--- a/drivers/media/video/Makefile
42+++ b/drivers/media/video/Makefile
43@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
44 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
45 obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
46 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
47+obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
48 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
49 obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
50 obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
51diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
52new file mode 100644
53index 0000000..04d8812
54--- /dev/null
55+++ b/drivers/media/video/mt9p031.c
56@@ -0,0 +1,841 @@
57+/*
58+ * Driver for MT9P031 CMOS Image Sensor from Aptina
59+ *
60+ * Copyright (C) 2011, Javier Martin <javier.martin@vista-silicon.com>
61+ *
62+ * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
63+ *
64+ * Based on the MT9V032 driver and Bastian Hecht's code.
65+ *
66+ * This program is free software; you can redistribute it and/or modify
67+ * it under the terms of the GNU General Public License version 2 as
68+ * published by the Free Software Foundation.
69+ */
70+
71+#include <linux/delay.h>
72+#include <linux/device.h>
73+#include <linux/i2c.h>
74+#include <linux/log2.h>
75+#include <linux/pm.h>
76+#include <linux/regulator/consumer.h>
77+#include <linux/slab.h>
78+#include <media/v4l2-subdev.h>
79+#include <linux/videodev2.h>
80+
81+#include <media/mt9p031.h>
82+#include <media/v4l2-chip-ident.h>
83+#include <media/v4l2-subdev.h>
84+#include <media/v4l2-device.h>
85+
86+#define MT9P031_PIXCLK_FREQ 54000000
87+
88+/* mt9p031 selected register addresses */
89+#define MT9P031_CHIP_VERSION 0x00
90+#define MT9P031_CHIP_VERSION_VALUE 0x1801
91+#define MT9P031_ROW_START 0x01
92+#define MT9P031_ROW_START_DEF 54
93+#define MT9P031_COLUMN_START 0x02
94+#define MT9P031_COLUMN_START_DEF 16
95+#define MT9P031_WINDOW_HEIGHT 0x03
96+#define MT9P031_WINDOW_WIDTH 0x04
97+#define MT9P031_H_BLANKING 0x05
98+#define MT9P031_H_BLANKING_VALUE 0
99+#define MT9P031_V_BLANKING 0x06
100+#define MT9P031_V_BLANKING_VALUE 25
101+#define MT9P031_OUTPUT_CONTROL 0x07
102+#define MT9P031_OUTPUT_CONTROL_CEN 2
103+#define MT9P031_OUTPUT_CONTROL_SYN 1
104+#define MT9P031_SHUTTER_WIDTH_UPPER 0x08
105+#define MT9P031_SHUTTER_WIDTH 0x09
106+#define MT9P031_PIXEL_CLOCK_CONTROL 0x0a
107+#define MT9P031_FRAME_RESTART 0x0b
108+#define MT9P031_SHUTTER_DELAY 0x0c
109+#define MT9P031_RST 0x0d
110+#define MT9P031_RST_ENABLE 1
111+#define MT9P031_RST_DISABLE 0
112+#define MT9P031_READ_MODE_1 0x1e
113+#define MT9P031_READ_MODE_2 0x20
114+#define MT9P031_READ_MODE_2_ROW_MIR 0x8000
115+#define MT9P031_READ_MODE_2_COL_MIR 0x4000
116+#define MT9P031_ROW_ADDRESS_MODE 0x22
117+#define MT9P031_COLUMN_ADDRESS_MODE 0x23
118+#define MT9P031_GLOBAL_GAIN 0x35
119+
120+#define MT9P031_WINDOW_HEIGHT_MAX 1944
121+#define MT9P031_WINDOW_WIDTH_MAX 2592
122+#define MT9P031_WINDOW_HEIGHT_MIN 2
123+#define MT9P031_WINDOW_WIDTH_MIN 18
124+
125+struct mt9p031 {
126+ struct v4l2_subdev subdev;
127+ struct media_pad pad;
128+ struct v4l2_rect rect; /* Sensor window */
129+ struct v4l2_mbus_framefmt format;
130+ struct mt9p031_platform_data *pdata;
131+ struct mutex power_lock; /* lock to protect power_count */
132+ int power_count;
133+ u16 xskip;
134+ u16 yskip;
135+ /* cache register values */
136+ u16 output_control;
137+ u16 h_blanking;
138+ u16 v_blanking;
139+ u16 column_address_mode;
140+ u16 row_address_mode;
141+ u16 column_start;
142+ u16 row_start;
143+ u16 window_width;
144+ u16 window_height;
145+ struct regulator *reg_1v8;
146+ struct regulator *reg_2v8;
147+};
148+
149+static struct mt9p031 *to_mt9p031(const struct i2c_client *client)
150+{
151+ return container_of(i2c_get_clientdata(client), struct mt9p031, subdev);
152+}
153+
154+static int reg_read(struct i2c_client *client, const u8 reg)
155+{
156+ s32 data = i2c_smbus_read_word_data(client, reg);
157+ return data < 0 ? data : swab16(data);
158+}
159+
160+static int reg_write(struct i2c_client *client, const u8 reg,
161+ const u16 data)
162+{
163+ return i2c_smbus_write_word_data(client, reg, swab16(data));
164+}
165+
166+static int reg_write_cached(struct i2c_client *client, const u8 reg,
167+ const u16 data, u16 *cache)
168+{
169+ int ret;
170+
171+ ret = reg_write(client, reg, data);
172+ if (ret < 0)
173+ return ret;
174+ *cache = data;
175+ return 0;
176+}
177+
178+static int mt9p031_set_output_control(struct mt9p031 *mt9p031, u16 clear,
179+ u16 set)
180+{
181+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
182+ u16 value = (mt9p031->output_control & ~clear) | set;
183+
184+ return reg_write_cached(client, MT9P031_OUTPUT_CONTROL, value,
185+ &mt9p031->output_control);
186+}
187+
188+static int restore_registers(struct i2c_client *client)
189+{
190+ int ret;
191+ struct mt9p031 *mt9p031 = to_mt9p031(client);
192+
193+ /* Disable register update, reconfigure atomically */
194+ ret = mt9p031_set_output_control(mt9p031, 0,
195+ MT9P031_OUTPUT_CONTROL_SYN);
196+ if (ret < 0)
197+ return ret;
198+
199+ /* Blanking and start values - default... */
200+ ret = reg_write(client, MT9P031_H_BLANKING, mt9p031->h_blanking);
201+ if (ret < 0)
202+ return ret;
203+
204+ ret = reg_write(client, MT9P031_V_BLANKING, mt9p031->v_blanking);
205+ if (ret < 0)
206+ return ret;
207+
208+ ret = reg_write(client, MT9P031_COLUMN_ADDRESS_MODE,
209+ mt9p031->column_address_mode);
210+ if (ret < 0)
211+ return ret;
212+
213+ ret = reg_write(client, MT9P031_ROW_ADDRESS_MODE,
214+ mt9p031->row_address_mode);
215+ if (ret < 0)
216+ return ret;
217+
218+ ret = reg_write(client, MT9P031_COLUMN_START,
219+ mt9p031->column_start);
220+ if (ret < 0)
221+ return ret;
222+
223+ ret = reg_write(client, MT9P031_ROW_START,
224+ mt9p031->row_start);
225+ if (ret < 0)
226+ return ret;
227+
228+ ret = reg_write(client, MT9P031_WINDOW_WIDTH,
229+ mt9p031->window_width);
230+ if (ret < 0)
231+ return ret;
232+
233+ ret = reg_write(client, MT9P031_WINDOW_HEIGHT,
234+ mt9p031->window_height);
235+ if (ret < 0)
236+ return ret;
237+
238+ /* Re-enable register update, commit all changes */
239+ ret = mt9p031_set_output_control(mt9p031,
240+ MT9P031_OUTPUT_CONTROL_SYN, 0);
241+ if (ret < 0)
242+ return ret;
243+ return 0;
244+}
245+
246+static int mt9p031_reset(struct i2c_client *client)
247+{
248+ struct mt9p031 *mt9p031 = to_mt9p031(client);
249+ int ret;
250+
251+ /* Disable chip output, synchronous option update */
252+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_ENABLE);
253+ if (ret < 0)
254+ return ret;
255+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_DISABLE);
256+ if (ret < 0)
257+ return ret;
258+ return mt9p031_set_output_control(mt9p031,
259+ MT9P031_OUTPUT_CONTROL_CEN, 0);
260+}
261+
262+static int mt9p031_power_on(struct mt9p031 *mt9p031)
263+{
264+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
265+ int ret;
266+
267+ /* Ensure RESET_BAR is low */
268+ if (mt9p031->pdata->reset)
269+ mt9p031->pdata->reset(&mt9p031->subdev, 1);
270+ /* turn on digital supply first */
271+ ret = regulator_enable(mt9p031->reg_1v8);
272+ if (ret) {
273+ dev_err(&client->dev,
274+ "Failed to enable 1.8v regulator: %d\n", ret);
275+ goto err_1v8;
276+ }
277+ /* now turn on analog supply */
278+ ret = regulator_enable(mt9p031->reg_2v8);
279+ if (ret) {
280+ dev_err(&client->dev,
281+ "Failed to enable 2.8v regulator: %d\n", ret);
282+ goto err_rst;
283+ }
284+ /* Now RESET_BAR must be high */
285+ if (mt9p031->pdata->reset)
286+ mt9p031->pdata->reset(&mt9p031->subdev, 0);
287+
288+ if (mt9p031->pdata->set_xclk)
289+ mt9p031->pdata->set_xclk(&mt9p031->subdev, MT9P031_PIXCLK_FREQ);
290+
291+ /* soft reset */
292+ ret = mt9p031_reset(client);
293+ if (ret < 0) {
294+ dev_err(&client->dev, "Failed to reset the camera\n");
295+ goto err_rst;
296+ }
297+
298+ ret = restore_registers(client);
299+ if (ret < 0) {
300+ dev_err(&client->dev, "Failed to restore registers\n");
301+ goto err_rst;
302+ }
303+
304+ return 0;
305+err_rst:
306+ regulator_disable(mt9p031->reg_1v8);
307+err_1v8:
308+ return ret;
309+
310+}
311+
312+static void mt9p031_power_off(struct mt9p031 *mt9p031)
313+{
314+ if (mt9p031->pdata->set_xclk)
315+ mt9p031->pdata->set_xclk(&mt9p031->subdev, 0);
316+ if (mt9p031->pdata->reset)
317+ mt9p031->pdata->reset(&mt9p031->subdev, 1);
318+ regulator_disable(mt9p031->reg_1v8);
319+ regulator_disable(mt9p031->reg_2v8);
320+}
321+
322+static int mt9p031_enum_mbus_code(struct v4l2_subdev *sd,
323+ struct v4l2_subdev_fh *fh,
324+ struct v4l2_subdev_mbus_code_enum *code)
325+{
326+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
327+
328+ if (code->pad || code->index)
329+ return -EINVAL;
330+
331+ code->code = mt9p031->format.code;
332+
333+ return 0;
334+}
335+
336+static struct v4l2_mbus_framefmt *mt9p031_get_pad_format(
337+ struct mt9p031 *mt9p031,
338+ struct v4l2_subdev_fh *fh,
339+ unsigned int pad, u32 which)
340+{
341+ switch (which) {
342+ case V4L2_SUBDEV_FORMAT_TRY:
343+ return v4l2_subdev_get_try_format(fh, pad);
344+ case V4L2_SUBDEV_FORMAT_ACTIVE:
345+ return &mt9p031->format;
346+ default:
347+ return NULL;
348+ }
349+}
350+
351+static struct v4l2_rect *mt9p031_get_pad_crop(struct mt9p031 *mt9p031,
352+ struct v4l2_subdev_fh *fh, unsigned int pad, u32 which)
353+{
354+ switch (which) {
355+ case V4L2_SUBDEV_FORMAT_TRY:
356+ return v4l2_subdev_get_try_crop(fh, pad);
357+ case V4L2_SUBDEV_FORMAT_ACTIVE:
358+ return &mt9p031->rect;
359+ default:
360+ return NULL;
361+ }
362+}
363+
364+static int mt9p031_get_crop(struct v4l2_subdev *sd,
365+ struct v4l2_subdev_fh *fh,
366+ struct v4l2_subdev_crop *crop)
367+{
368+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
369+ struct v4l2_rect *rect = mt9p031_get_pad_crop(mt9p031, fh, crop->pad,
370+ crop->which);
371+ if (!rect)
372+ return -EINVAL;
373+
374+ crop->rect = *rect;
375+
376+ return 0;
377+}
378+
379+static u16 mt9p031_skip_for_crop(s32 source, s32 *target, s32 max_skip)
380+{
381+ unsigned int skip;
382+
383+ if (source - source / 4 < *target) {
384+ *target = source;
385+ return 1;
386+ }
387+
388+ skip = DIV_ROUND_CLOSEST(source, *target);
389+ if (skip > max_skip)
390+ skip = max_skip;
391+ *target = 2 * DIV_ROUND_UP(source, 2 * skip);
392+
393+ return skip;
394+}
395+
396+static int mt9p031_set_params(struct i2c_client *client,
397+ struct v4l2_rect *rect, u16 xskip, u16 yskip)
398+{
399+ struct mt9p031 *mt9p031 = to_mt9p031(client);
400+ int ret;
401+ u16 xbin, ybin;
402+ const u16 hblank = MT9P031_H_BLANKING_VALUE,
403+ vblank = MT9P031_V_BLANKING_VALUE;
404+ __s32 left, top, width, height;
405+
406+ /*
407+ * TODO: Attention! When implementing horizontal flipping, adjust
408+ * alignment according to R2 "Column Start" description in the datasheet
409+ */
410+ if (xskip & 1) {
411+ xbin = 1;
412+ left = rect->left & (~3);
413+ } else if (xskip & 2) {
414+ xbin = 2;
415+ left = rect->left & (~7);
416+ } else {
417+ xbin = 4;
418+ left = rect->left & (~15);
419+ }
420+ top = rect->top & (~1);
421+ width = rect->width;
422+ height = rect->height;
423+
424+ ybin = min(yskip, (u16)4);
425+
426+ /* Disable register update, reconfigure atomically */
427+ ret = mt9p031_set_output_control(mt9p031, 0,
428+ MT9P031_OUTPUT_CONTROL_SYN);
429+ if (ret < 0)
430+ return ret;
431+
432+ dev_dbg(&client->dev, "skip %u:%u, rect %ux%u@%u:%u\n",
433+ xskip, yskip, rect->width, rect->height, rect->left, rect->top);
434+
435+ /* Blanking and start values - default... */
436+ ret = reg_write_cached(client, MT9P031_H_BLANKING, hblank,
437+ &mt9p031->h_blanking);
438+ if (ret < 0)
439+ return ret;
440+ ret = reg_write_cached(client, MT9P031_V_BLANKING, vblank,
441+ &mt9p031->v_blanking);
442+ if (ret < 0)
443+ return ret;
444+
445+ ret = reg_write_cached(client, MT9P031_COLUMN_ADDRESS_MODE,
446+ ((xbin - 1) << 4) | (xskip - 1),
447+ &mt9p031->column_address_mode);
448+ if (ret < 0)
449+ return ret;
450+ ret = reg_write_cached(client, MT9P031_ROW_ADDRESS_MODE,
451+ ((ybin - 1) << 4) | (yskip - 1),
452+ &mt9p031->row_address_mode);
453+ if (ret < 0)
454+ return ret;
455+
456+ dev_dbg(&client->dev, "new physical left %u, top %u\n",
457+ rect->left, rect->top);
458+
459+ ret = reg_write_cached(client, MT9P031_COLUMN_START,
460+ rect->left + MT9P031_COLUMN_START_DEF,
461+ &mt9p031->column_start);
462+ if (ret < 0)
463+ return ret;
464+ ret = reg_write_cached(client, MT9P031_ROW_START,
465+ rect->top + MT9P031_ROW_START_DEF,
466+ &mt9p031->row_start);
467+ if (ret < 0)
468+ return ret;
469+ ret = reg_write_cached(client, MT9P031_WINDOW_WIDTH,
470+ rect->width - 1,
471+ &mt9p031->window_width);
472+ if (ret < 0)
473+ return ret;
474+ ret = reg_write_cached(client, MT9P031_WINDOW_HEIGHT,
475+ rect->height - 1,
476+ &mt9p031->window_height);
477+ if (ret < 0)
478+ return ret;
479+
480+ /* Re-enable register update, commit all changes */
481+ ret = mt9p031_set_output_control(mt9p031,
482+ MT9P031_OUTPUT_CONTROL_SYN, 0);
483+ if (ret < 0)
484+ return ret;
485+
486+ mt9p031->xskip = xskip;
487+ mt9p031->yskip = yskip;
488+ return ret;
489+}
490+
491+static int mt9p031_set_crop(struct v4l2_subdev *sd,
492+ struct v4l2_subdev_fh *fh,
493+ struct v4l2_subdev_crop *crop)
494+{
495+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
496+ struct v4l2_mbus_framefmt *f;
497+ struct v4l2_rect *c;
498+ struct v4l2_rect rect;
499+ u16 xskip, yskip;
500+ s32 width, height;
501+
502+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u@%u:%u : %u)\n",
503+ __func__, crop->rect.width, crop->rect.height,
504+ crop->rect.left, crop->rect.top, crop->which);
505+
506+ /*
507+ * Clamp the crop rectangle boundaries and align them to a multiple of 2
508+ * pixels.
509+ */
510+ rect.width = ALIGN(clamp(crop->rect.width,
511+ MT9P031_WINDOW_WIDTH_MIN, MT9P031_WINDOW_WIDTH_MAX), 2);
512+ rect.height = ALIGN(clamp(crop->rect.height,
513+ MT9P031_WINDOW_HEIGHT_MIN, MT9P031_WINDOW_HEIGHT_MAX), 2);
514+ rect.left = ALIGN(clamp(crop->rect.left,
515+ 0, MT9P031_WINDOW_WIDTH_MAX - rect.width), 2);
516+ rect.top = ALIGN(clamp(crop->rect.top,
517+ 0, MT9P031_WINDOW_HEIGHT_MAX - rect.height), 2);
518+
519+ c = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, crop->which);
520+
521+ if (rect.width != c->width || rect.height != c->height) {
522+ /*
523+ * Reset the output image size if the crop rectangle size has
524+ * been modified.
525+ */
526+ f = mt9p031_get_pad_format(mt9p031, fh, crop->pad,
527+ crop->which);
528+ width = f->width;
529+ height = f->height;
530+
531+ xskip = mt9p031_skip_for_crop(rect.width, &width, 7);
532+ yskip = mt9p031_skip_for_crop(rect.height, &height, 8);
533+ } else {
534+ xskip = mt9p031->xskip;
535+ yskip = mt9p031->yskip;
536+ f = NULL;
537+ }
538+ if (f) {
539+ f->width = width;
540+ f->height = height;
541+ }
542+
543+ *c = rect;
544+ crop->rect = rect;
545+
546+ mt9p031->xskip = xskip;
547+ mt9p031->yskip = yskip;
548+ mt9p031->rect = *c;
549+ return 0;
550+}
551+
552+static int mt9p031_get_format(struct v4l2_subdev *sd,
553+ struct v4l2_subdev_fh *fh,
554+ struct v4l2_subdev_format *fmt)
555+{
556+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
557+
558+ fmt->format =
559+ *mt9p031_get_pad_format(mt9p031, fh, fmt->pad, fmt->which);
560+ return 0;
561+}
562+
563+static u16 mt9p031_skip_for_scale(s32 *source, s32 target,
564+ s32 max_skip, s32 max)
565+{
566+ unsigned int skip;
567+
568+ if (*source - *source / 4 < target) {
569+ *source = target;
570+ return 1;
571+ }
572+
573+ skip = min(max, *source + target / 2) / target;
574+ if (skip > max_skip)
575+ skip = max_skip;
576+ *source = target * skip;
577+
578+ return skip;
579+}
580+
581+static int mt9p031_fmt_validate(struct v4l2_subdev *sd,
582+ struct v4l2_subdev_format *fmt)
583+{
584+ struct v4l2_mbus_framefmt *format = &fmt->format;
585+
586+ /* Hardcode code and colorspace as sensor only supports one */
587+ format->code = V4L2_MBUS_FMT_SGRBG12_1X12;
588+ format->colorspace = V4L2_COLORSPACE_SRGB;
589+
590+ format->width = clamp_t(int, ALIGN(format->width, 2), 2,
591+ MT9P031_WINDOW_WIDTH_MAX);
592+ format->height = clamp_t(int, ALIGN(format->height, 2), 2,
593+ MT9P031_WINDOW_HEIGHT_MAX);
594+ format->field = V4L2_FIELD_NONE;
595+
596+ return 0;
597+}
598+
599+static int mt9p031_set_format(struct v4l2_subdev *sd,
600+ struct v4l2_subdev_fh *fh,
601+ struct v4l2_subdev_format *format)
602+{
603+ struct v4l2_subdev_format sdf = *format;
604+ struct v4l2_mbus_framefmt *__format, *format_bak = &sdf.format;
605+ struct v4l2_rect *__crop, rect;
606+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
607+ u16 xskip, yskip;
608+ int ret;
609+
610+ __crop = mt9p031_get_pad_crop(mt9p031, fh, format->pad, format->which);
611+
612+ ret = mt9p031_fmt_validate(sd, &sdf);
613+ if (ret < 0)
614+ return ret;
615+ rect.width = __crop->width;
616+ rect.height = __crop->height;
617+
618+ xskip = mt9p031_skip_for_scale(&rect.width, format_bak->width, 7,
619+ MT9P031_WINDOW_WIDTH_MAX);
620+ if (rect.width + __crop->left > MT9P031_WINDOW_WIDTH_MAX)
621+ rect.left = (MT9P031_WINDOW_WIDTH_MAX - rect.width) / 2;
622+ else
623+ rect.left = __crop->left;
624+ yskip = mt9p031_skip_for_scale(&rect.height, format_bak->height, 8,
625+ MT9P031_WINDOW_HEIGHT_MAX);
626+ if (rect.height + __crop->top > MT9P031_WINDOW_HEIGHT_MAX)
627+ rect.top = (MT9P031_WINDOW_HEIGHT_MAX - rect.height) / 2;
628+ else
629+ rect.top = __crop->top;
630+
631+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u : %u)\n", __func__,
632+ format_bak->width, format_bak->height, format->which);
633+ if (__crop)
634+ *__crop = rect;
635+
636+ __format = mt9p031_get_pad_format(mt9p031, fh, format->pad, format->which);
637+ *__format = *format_bak;
638+ format->format = *format_bak;
639+
640+ mt9p031->xskip = xskip;
641+ mt9p031->yskip = yskip;
642+ mt9p031->rect = *__crop;
643+ return 0;
644+}
645+
646+static int mt9p031_s_stream(struct v4l2_subdev *sd, int enable)
647+{
648+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
649+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
650+ struct v4l2_rect rect = mt9p031->rect;
651+ u16 xskip = mt9p031->xskip;
652+ u16 yskip = mt9p031->yskip;
653+ int ret;
654+
655+ if (enable) {
656+ ret = mt9p031_set_params(client, &rect, xskip, yskip);
657+ if (ret < 0)
658+ return ret;
659+ /* Switch to master "normal" mode */
660+ ret = mt9p031_set_output_control(mt9p031, 0,
661+ MT9P031_OUTPUT_CONTROL_CEN);
662+ } else {
663+ /* Stop sensor readout */
664+ ret = mt9p031_set_output_control(mt9p031,
665+ MT9P031_OUTPUT_CONTROL_CEN, 0);
666+ }
667+ return ret;
668+}
669+
670+static int mt9p031_video_probe(struct i2c_client *client)
671+{
672+ s32 data;
673+
674+ /* Read out the chip version register */
675+ data = reg_read(client, MT9P031_CHIP_VERSION);
676+ if (data != MT9P031_CHIP_VERSION_VALUE) {
677+ dev_err(&client->dev,
678+ "No MT9P031 chip detected, register read %x\n", data);
679+ return -ENODEV;
680+ }
681+
682+ dev_info(&client->dev, "Detected a MT9P031 chip ID %x\n", data);
683+
684+ return 0;
685+}
686+
687+static int mt9p031_set_power(struct v4l2_subdev *sd, int on)
688+{
689+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
690+ int ret = 0;
691+
692+ mutex_lock(&mt9p031->power_lock);
693+
694+ /*
695+ * If the power count is modified from 0 to != 0 or from != 0 to 0,
696+ * update the power state.
697+ */
698+ if (mt9p031->power_count == !on) {
699+ if (on) {
700+ ret = mt9p031_power_on(mt9p031);
701+ if (ret) {
702+ dev_err(mt9p031->subdev.v4l2_dev->dev,
703+ "Failed to enable 2.8v regulator: %d\n", ret);
704+ goto out;
705+ }
706+ } else {
707+ mt9p031_power_off(mt9p031);
708+ }
709+ }
710+
711+ /* Update the power count. */
712+ mt9p031->power_count += on ? 1 : -1;
713+ WARN_ON(mt9p031->power_count < 0);
714+
715+out:
716+ mutex_unlock(&mt9p031->power_lock);
717+ return ret;
718+}
719+
720+static int mt9p031_registered(struct v4l2_subdev *sd)
721+{
722+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
723+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
724+ int ret;
725+
726+ ret = mt9p031_set_power(&mt9p031->subdev, 1);
727+ if (ret) {
728+ dev_err(&client->dev,
729+ "Failed to power on device: %d\n", ret);
730+ goto err_pwron;
731+ }
732+
733+ ret = mt9p031_video_probe(client);
734+ if (ret)
735+ goto err_evprobe;
736+
737+ mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE;
738+ ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0);
739+ if (ret)
740+ goto err_evprobe;
741+
742+ mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
743+ mt9p031_set_power(&mt9p031->subdev, 0);
744+
745+ return 0;
746+err_evprobe:
747+ mt9p031_set_power(&mt9p031->subdev, 0);
748+err_pwron:
749+ return ret;
750+}
751+
752+static int mt9p031_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
753+{
754+ struct mt9p031 *mt9p031;
755+ mt9p031 = container_of(sd, struct mt9p031, subdev);
756+
757+ mt9p031->rect.width = MT9P031_WINDOW_WIDTH_MAX;
758+ mt9p031->rect.height = MT9P031_WINDOW_HEIGHT_MAX;
759+ mt9p031->rect.left = MT9P031_COLUMN_START_DEF;
760+ mt9p031->rect.top = MT9P031_ROW_START_DEF;
761+
762+ mt9p031->format.code = V4L2_MBUS_FMT_SGRBG12_1X12;
763+ mt9p031->format.width = MT9P031_WINDOW_WIDTH_MAX;
764+ mt9p031->format.height = MT9P031_WINDOW_HEIGHT_MAX;
765+ mt9p031->format.field = V4L2_FIELD_NONE;
766+ mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB;
767+
768+ mt9p031->xskip = 1;
769+ mt9p031->yskip = 1;
770+ return mt9p031_set_power(sd, 1);
771+}
772+
773+static int mt9p031_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
774+{
775+ return mt9p031_set_power(sd, 0);
776+}
777+
778+static struct v4l2_subdev_core_ops mt9p031_subdev_core_ops = {
779+ .s_power = mt9p031_set_power,
780+};
781+
782+static struct v4l2_subdev_video_ops mt9p031_subdev_video_ops = {
783+ .s_stream = mt9p031_s_stream,
784+};
785+
786+static struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = {
787+ .enum_mbus_code = mt9p031_enum_mbus_code,
788+ .get_fmt = mt9p031_get_format,
789+ .set_fmt = mt9p031_set_format,
790+ .get_crop = mt9p031_get_crop,
791+ .set_crop = mt9p031_set_crop,
792+};
793+
794+static struct v4l2_subdev_ops mt9p031_subdev_ops = {
795+ .core = &mt9p031_subdev_core_ops,
796+ .video = &mt9p031_subdev_video_ops,
797+ .pad = &mt9p031_subdev_pad_ops,
798+};
799+
800+static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = {
801+ .registered = mt9p031_registered,
802+ .open = mt9p031_open,
803+ .close = mt9p031_close,
804+};
805+
806+static int mt9p031_probe(struct i2c_client *client,
807+ const struct i2c_device_id *did)
808+{
809+ struct mt9p031 *mt9p031;
810+ struct mt9p031_platform_data *pdata = client->dev.platform_data;
811+ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
812+ int ret;
813+
814+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
815+ dev_warn(&adapter->dev,
816+ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
817+ return -EIO;
818+ }
819+
820+ mt9p031 = kzalloc(sizeof(struct mt9p031), GFP_KERNEL);
821+ if (!mt9p031)
822+ return -ENOMEM;
823+
824+ mutex_init(&mt9p031->power_lock);
825+ v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops);
826+ mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops;
827+
828+ mt9p031->pdata = pdata;
829+
830+ mt9p031->reg_1v8 = regulator_get(NULL, "cam_1v8");
831+ if (IS_ERR(mt9p031->reg_1v8)) {
832+ ret = PTR_ERR(mt9p031->reg_1v8);
833+ dev_err(mt9p031->subdev.v4l2_dev->dev,
834+ "Failed 1.8v regulator: %d\n", ret);
835+ goto err_e1v8;
836+ }
837+
838+ mt9p031->reg_2v8 = regulator_get(NULL, "cam_2v8");
839+ if (IS_ERR(mt9p031->reg_2v8)) {
840+ ret = PTR_ERR(mt9p031->reg_2v8);
841+ dev_err(mt9p031->subdev.v4l2_dev->dev,
842+ "Failed 2.8v regulator: %d\n", ret);
843+ goto err_e2v8;
844+ }
845+ return 0;
846+err_e2v8:
847+ regulator_put(mt9p031->reg_1v8);
848+err_e1v8:
849+ kfree(mt9p031);
850+ return ret;
851+}
852+
853+static int mt9p031_remove(struct i2c_client *client)
854+{
855+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
856+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
857+
858+ v4l2_device_unregister_subdev(sd);
859+ media_entity_cleanup(&sd->entity);
860+ regulator_put(mt9p031->reg_2v8);
861+ regulator_put(mt9p031->reg_1v8);
862+ kfree(mt9p031);
863+
864+ return 0;
865+}
866+
867+static const struct i2c_device_id mt9p031_id[] = {
868+ { "mt9p031", 0 },
869+ { }
870+};
871+MODULE_DEVICE_TABLE(i2c, mt9p031_id);
872+
873+static struct i2c_driver mt9p031_i2c_driver = {
874+ .driver = {
875+ .name = "mt9p031",
876+ },
877+ .probe = mt9p031_probe,
878+ .remove = mt9p031_remove,
879+ .id_table = mt9p031_id,
880+};
881+
882+static int __init mt9p031_mod_init(void)
883+{
884+ return i2c_add_driver(&mt9p031_i2c_driver);
885+}
886+
887+static void __exit mt9p031_mod_exit(void)
888+{
889+ i2c_del_driver(&mt9p031_i2c_driver);
890+}
891+
892+module_init(mt9p031_mod_init);
893+module_exit(mt9p031_mod_exit);
894+
895+MODULE_DESCRIPTION("Aptina MT9P031 Camera driver");
896+MODULE_AUTHOR("Bastian Hecht <hechtb@gmail.com>");
897+MODULE_LICENSE("GPL v2");
898diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
899new file mode 100644
900index 0000000..ad37eb3
901--- /dev/null
902+++ b/include/media/mt9p031.h
903@@ -0,0 +1,11 @@
904+#ifndef MT9P031_H
905+#define MT9P031_H
906+
907+struct v4l2_subdev;
908+
909+struct mt9p031_platform_data {
910+ int (*set_xclk)(struct v4l2_subdev *subdev, int hz);
911+ int (*reset)(struct v4l2_subdev *subdev, int active);
912+};
913+
914+#endif
915--
9161.6.6.1
917
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch b/recipes-kernel/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch
new file mode 100644
index 00000000..68a762b2
--- /dev/null
+++ b/recipes-kernel/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch
@@ -0,0 +1,142 @@
1From 186ab3a6cd3f1751b4e60044d8207eb95c4b224a Mon Sep 17 00:00:00 2001
2From: Javier Martin <javier.martin@vista-silicon.com>
3Date: Wed, 25 May 2011 10:09:23 +0200
4Subject: [PATCH 2/4] OMAP3BEAGLE: Add support for mt9p031 sensor driver.
5
6isp.h file has to be included as a temporal measure
7since clocks of the isp are not exposed yet.
8
9Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
10---
11 arch/arm/mach-omap2/board-omap3beagle.c | 73 ++++++++++++++++++++++++++++++-
12 1 files changed, 72 insertions(+), 1 deletions(-)
13
14diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
15index 221bfda..9af1cf8 100644
16--- a/arch/arm/mach-omap2/board-omap3beagle.c
17+++ b/arch/arm/mach-omap2/board-omap3beagle.c
18@@ -25,15 +25,21 @@
19 #include <linux/input.h>
20 #include <linux/gpio_keys.h>
21 #include <linux/opp.h>
22+#include <linux/i2c.h>
23+#include <linux/mm.h>
24+#include <linux/videodev2.h>
25
26 #include <linux/mtd/mtd.h>
27 #include <linux/mtd/partitions.h>
28 #include <linux/mtd/nand.h>
29 #include <linux/mmc/host.h>
30
31+#include <linux/gpio.h>
32 #include <linux/regulator/machine.h>
33 #include <linux/i2c/twl.h>
34
35+#include <media/mt9p031.h>
36+
37 #include <mach/hardware.h>
38 #include <asm/mach-types.h>
39 #include <asm/mach/arch.h>
40@@ -48,11 +54,17 @@
41 #include <plat/nand.h>
42 #include <plat/usb.h>
43 #include <plat/omap_device.h>
44+#include <plat/i2c.h>
45
46 #include "mux.h"
47 #include "hsmmc.h"
48 #include "timer-gp.h"
49 #include "pm.h"
50+#include "devices.h"
51+#include "../../../drivers/media/video/omap3isp/isp.h"
52+
53+#define MT9P031_RESET_GPIO 98
54+#define MT9P031_XCLK ISP_XCLK_A
55
56 #define NAND_BLOCK_SIZE SZ_128K
57
58@@ -734,7 +746,7 @@ static int __init omap3_beagle_i2c_init(void)
59 {
60 omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
61 ARRAY_SIZE(beagle_i2c1_boardinfo));
62- omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
63+ omap_register_i2c_bus(2, 100, beagle_i2c2_boardinfo,
64 ARRAY_SIZE(beagle_i2c2_boardinfo));
65 /* Bus 3 is attached to the DVI port where devices like the pico DLP
66 * projector don't work reliably with 400kHz */
67@@ -935,6 +947,60 @@ static void __init beagle_opp_init(void)
68 return;
69 }
70
71+static int beagle_cam_set_xclk(struct v4l2_subdev *subdev, int hz)
72+{
73+ struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
74+ int ret;
75+
76+ ret = isp->platform_cb.set_xclk(isp, hz, MT9P031_XCLK);
77+ return 0;
78+}
79+
80+static int beagle_cam_reset(struct v4l2_subdev *subdev, int active)
81+{
82+ /* Set RESET_BAR to !active */
83+ gpio_set_value(MT9P031_RESET_GPIO, !active);
84+
85+ return 0;
86+}
87+
88+static struct mt9p031_platform_data beagle_mt9p031_platform_data = {
89+ .set_xclk = beagle_cam_set_xclk,
90+ .reset = beagle_cam_reset,
91+};
92+
93+static struct i2c_board_info mt9p031_camera_i2c_device = {
94+ I2C_BOARD_INFO("mt9p031", 0x48),
95+ .platform_data = &beagle_mt9p031_platform_data,
96+};
97+
98+static struct isp_subdev_i2c_board_info mt9p031_camera_subdevs[] = {
99+ {
100+ .board_info = &mt9p031_camera_i2c_device,
101+ .i2c_adapter_id = 2,
102+ },
103+ { NULL, 0, },
104+};
105+
106+static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = {
107+ {
108+ .subdevs = mt9p031_camera_subdevs,
109+ .interface = ISP_INTERFACE_PARALLEL,
110+ .bus = {
111+ .parallel = {
112+ .data_lane_shift = 0,
113+ .clk_pol = 1,
114+ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE,
115+ }
116+ },
117+ },
118+ { },
119+};
120+
121+static struct isp_platform_data beagle_isp_platform_data = {
122+ .subdevs = beagle_camera_subdevs,
123+};
124+
125 static void __init omap3_beagle_init(void)
126 {
127 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
128@@ -1024,6 +1090,11 @@ static void __init omap3_beagle_init(void)
129
130 beagle_display_init();
131 beagle_opp_init();
132+
133+ /* Enable camera */
134+ gpio_request(MT9P031_RESET_GPIO, "cam_rst");
135+ gpio_direction_output(MT9P031_RESET_GPIO, 0);
136+ omap3_init_camera(&beagle_isp_platform_data);
137 }
138
139 early_param("buddy", expansionboard_setup);
140--
1411.6.6.1
142
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch b/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch
new file mode 100644
index 00000000..b7efa4e5
--- /dev/null
+++ b/recipes-kernel/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch
@@ -0,0 +1,34 @@
1From 014b3e447a0a9bbed5e238873fefb1a6c660c6a0 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Wed, 25 May 2011 10:28:29 +0200
4Subject: [PATCH 3/4] OMAP3: beagle: only init camera on 3630
5
6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7---
8 arch/arm/mach-omap2/board-omap3beagle.c | 10 ++++++----
9 1 files changed, 6 insertions(+), 4 deletions(-)
10
11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12index 9af1cf8..80f8ece 100644
13--- a/arch/arm/mach-omap2/board-omap3beagle.c
14+++ b/arch/arm/mach-omap2/board-omap3beagle.c
15@@ -1091,10 +1091,12 @@ static void __init omap3_beagle_init(void)
16 beagle_display_init();
17 beagle_opp_init();
18
19- /* Enable camera */
20- gpio_request(MT9P031_RESET_GPIO, "cam_rst");
21- gpio_direction_output(MT9P031_RESET_GPIO, 0);
22- omap3_init_camera(&beagle_isp_platform_data);
23+ if (cpu_is_omap3630()) {
24+ /* Enable camera */
25+ gpio_request(MT9P031_RESET_GPIO, "cam_rst");
26+ gpio_direction_output(MT9P031_RESET_GPIO, 0);
27+ omap3_init_camera(&beagle_isp_platform_data);
28+ }
29 }
30
31 early_param("buddy", expansionboard_setup);
32--
331.6.6.1
34
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch b/recipes-kernel/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch
new file mode 100644
index 00000000..48e41a54
--- /dev/null
+++ b/recipes-kernel/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch
@@ -0,0 +1,853 @@
1From 9b0b5f99896549524c8f88a70f6cf0c0271d730e Mon Sep 17 00:00:00 2001
2From: Detlev Casanova <detlev.casanova@gmail.com>
3Date: Sun, 28 Nov 2010 19:07:20 +0100
4Subject: [PATCH 4/4] v4l: Add mt9v032 sensor driver
5
6The MT9V032 is a parallel wide VGA sensor from Aptina (formerly Micron)
7controlled through I2C.
8
9The driver creates a V4L2 subdevice. It currently supports binning and
10cropping, and the gain, auto gain, exposure, auto exposure and test
11pattern controls.
12
13Signed-off-by: Detlev Casanova <detlev.casanova@gmail.com>
14Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
15---
16 drivers/media/video/Kconfig | 7 +
17 drivers/media/video/Makefile | 1 +
18 drivers/media/video/mt9v032.c | 773 +++++++++++++++++++++++++++++++++++++++++
19 include/media/mt9v032.h | 12 +
20 4 files changed, 793 insertions(+), 0 deletions(-)
21 create mode 100644 drivers/media/video/mt9v032.c
22 create mode 100644 include/media/mt9v032.h
23
24diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
25index cb87e35..3a5bc57 100644
26--- a/drivers/media/video/Kconfig
27+++ b/drivers/media/video/Kconfig
28@@ -344,6 +344,13 @@ config VIDEO_MT9V011
29 mt0v011 1.3 Mpixel camera. It currently only works with the
30 em28xx driver.
31
32+config VIDEO_MT9V032
33+ tristate "Micron MT9V032 sensor support"
34+ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
35+ ---help---
36+ This is a Video4Linux2 sensor-level driver for the Micron
37+ MT9V032 752x480 CMOS sensor.
38+
39 config VIDEO_TCM825X
40 tristate "TCM825x camera sensor support"
41 depends on I2C && VIDEO_V4L2
42diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
43index 912b29b..6679c6a 100644
44--- a/drivers/media/video/Makefile
45+++ b/drivers/media/video/Makefile
46@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
47 obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
48 obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
49 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
50+obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
51 obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
52 obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
53
54diff --git a/drivers/media/video/mt9v032.c b/drivers/media/video/mt9v032.c
55new file mode 100644
56index 0000000..c64e1dc
57--- /dev/null
58+++ b/drivers/media/video/mt9v032.c
59@@ -0,0 +1,773 @@
60+/*
61+ * Driver for MT9V032 CMOS Image Sensor from Micron
62+ *
63+ * Copyright (C) 2010, Laurent Pinchart <laurent.pinchart@ideasonboard.com>
64+ *
65+ * Based on the MT9M001 driver,
66+ *
67+ * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
68+ *
69+ * This program is free software; you can redistribute it and/or modify
70+ * it under the terms of the GNU General Public License version 2 as
71+ * published by the Free Software Foundation.
72+ */
73+
74+#include <linux/delay.h>
75+#include <linux/i2c.h>
76+#include <linux/log2.h>
77+#include <linux/mutex.h>
78+#include <linux/slab.h>
79+#include <linux/videodev2.h>
80+#include <linux/v4l2-mediabus.h>
81+
82+#include <media/mt9v032.h>
83+#include <media/v4l2-ctrls.h>
84+#include <media/v4l2-device.h>
85+#include <media/v4l2-subdev.h>
86+
87+#define MT9V032_PIXEL_ARRAY_HEIGHT 492
88+#define MT9V032_PIXEL_ARRAY_WIDTH 782
89+
90+#define MT9V032_CHIP_VERSION 0x00
91+#define MT9V032_CHIP_ID_REV1 0x1311
92+#define MT9V032_CHIP_ID_REV3 0x1313
93+#define MT9V032_COLUMN_START 0x01
94+#define MT9V032_COLUMN_START_MIN 1
95+#define MT9V032_COLUMN_START_DEF 1
96+#define MT9V032_COLUMN_START_MAX 752
97+#define MT9V032_ROW_START 0x02
98+#define MT9V032_ROW_START_MIN 4
99+#define MT9V032_ROW_START_DEF 5
100+#define MT9V032_ROW_START_MAX 482
101+#define MT9V032_WINDOW_HEIGHT 0x03
102+#define MT9V032_WINDOW_HEIGHT_MIN 1
103+#define MT9V032_WINDOW_HEIGHT_DEF 480
104+#define MT9V032_WINDOW_HEIGHT_MAX 480
105+#define MT9V032_WINDOW_WIDTH 0x04
106+#define MT9V032_WINDOW_WIDTH_MIN 1
107+#define MT9V032_WINDOW_WIDTH_DEF 752
108+#define MT9V032_WINDOW_WIDTH_MAX 752
109+#define MT9V032_HORIZONTAL_BLANKING 0x05
110+#define MT9V032_HORIZONTAL_BLANKING_MIN 43
111+#define MT9V032_HORIZONTAL_BLANKING_MAX 1023
112+#define MT9V032_VERTICAL_BLANKING 0x06
113+#define MT9V032_VERTICAL_BLANKING_MIN 4
114+#define MT9V032_VERTICAL_BLANKING_MAX 3000
115+#define MT9V032_CHIP_CONTROL 0x07
116+#define MT9V032_CHIP_CONTROL_MASTER_MODE (1 << 3)
117+#define MT9V032_CHIP_CONTROL_DOUT_ENABLE (1 << 7)
118+#define MT9V032_CHIP_CONTROL_SEQUENTIAL (1 << 8)
119+#define MT9V032_SHUTTER_WIDTH1 0x08
120+#define MT9V032_SHUTTER_WIDTH2 0x09
121+#define MT9V032_SHUTTER_WIDTH_CONTROL 0x0a
122+#define MT9V032_TOTAL_SHUTTER_WIDTH 0x0b
123+#define MT9V032_TOTAL_SHUTTER_WIDTH_MIN 1
124+#define MT9V032_TOTAL_SHUTTER_WIDTH_DEF 480
125+#define MT9V032_TOTAL_SHUTTER_WIDTH_MAX 32767
126+#define MT9V032_RESET 0x0c
127+#define MT9V032_READ_MODE 0x0d
128+#define MT9V032_READ_MODE_ROW_BIN_MASK (3 << 0)
129+#define MT9V032_READ_MODE_ROW_BIN_SHIFT 0
130+#define MT9V032_READ_MODE_COLUMN_BIN_MASK (3 << 2)
131+#define MT9V032_READ_MODE_COLUMN_BIN_SHIFT 2
132+#define MT9V032_READ_MODE_ROW_FLIP (1 << 4)
133+#define MT9V032_READ_MODE_COLUMN_FLIP (1 << 5)
134+#define MT9V032_READ_MODE_DARK_COLUMNS (1 << 6)
135+#define MT9V032_READ_MODE_DARK_ROWS (1 << 7)
136+#define MT9V032_PIXEL_OPERATION_MODE 0x0f
137+#define MT9V032_PIXEL_OPERATION_MODE_COLOR (1 << 2)
138+#define MT9V032_PIXEL_OPERATION_MODE_HDR (1 << 6)
139+#define MT9V032_ANALOG_GAIN 0x35
140+#define MT9V032_ANALOG_GAIN_MIN 16
141+#define MT9V032_ANALOG_GAIN_DEF 16
142+#define MT9V032_ANALOG_GAIN_MAX 64
143+#define MT9V032_MAX_ANALOG_GAIN 0x36
144+#define MT9V032_MAX_ANALOG_GAIN_MAX 127
145+#define MT9V032_FRAME_DARK_AVERAGE 0x42
146+#define MT9V032_DARK_AVG_THRESH 0x46
147+#define MT9V032_DARK_AVG_LOW_THRESH_MASK (255 << 0)
148+#define MT9V032_DARK_AVG_LOW_THRESH_SHIFT 0
149+#define MT9V032_DARK_AVG_HIGH_THRESH_MASK (255 << 8)
150+#define MT9V032_DARK_AVG_HIGH_THRESH_SHIFT 8
151+#define MT9V032_ROW_NOISE_CORR_CONTROL 0x70
152+#define MT9V032_ROW_NOISE_CORR_ENABLE (1 << 5)
153+#define MT9V032_ROW_NOISE_CORR_USE_BLK_AVG (1 << 7)
154+#define MT9V032_PIXEL_CLOCK 0x74
155+#define MT9V032_PIXEL_CLOCK_INV_LINE (1 << 0)
156+#define MT9V032_PIXEL_CLOCK_INV_FRAME (1 << 1)
157+#define MT9V032_PIXEL_CLOCK_XOR_LINE (1 << 2)
158+#define MT9V032_PIXEL_CLOCK_CONT_LINE (1 << 3)
159+#define MT9V032_PIXEL_CLOCK_INV_PXL_CLK (1 << 4)
160+#define MT9V032_TEST_PATTERN 0x7f
161+#define MT9V032_TEST_PATTERN_DATA_MASK (1023 << 0)
162+#define MT9V032_TEST_PATTERN_DATA_SHIFT 0
163+#define MT9V032_TEST_PATTERN_USE_DATA (1 << 10)
164+#define MT9V032_TEST_PATTERN_GRAY_MASK (3 << 11)
165+#define MT9V032_TEST_PATTERN_GRAY_NONE (0 << 11)
166+#define MT9V032_TEST_PATTERN_GRAY_VERTICAL (1 << 11)
167+#define MT9V032_TEST_PATTERN_GRAY_HORIZONTAL (2 << 11)
168+#define MT9V032_TEST_PATTERN_GRAY_DIAGONAL (3 << 11)
169+#define MT9V032_TEST_PATTERN_ENABLE (1 << 13)
170+#define MT9V032_TEST_PATTERN_FLIP (1 << 14)
171+#define MT9V032_AEC_AGC_ENABLE 0xaf
172+#define MT9V032_AEC_ENABLE (1 << 0)
173+#define MT9V032_AGC_ENABLE (1 << 1)
174+#define MT9V032_THERMAL_INFO 0xc1
175+
176+struct mt9v032 {
177+ struct v4l2_subdev subdev;
178+ struct media_pad pad;
179+
180+ struct v4l2_mbus_framefmt format;
181+ struct v4l2_rect crop;
182+
183+ struct v4l2_ctrl_handler ctrls;
184+
185+ struct mutex power_lock;
186+ int power_count;
187+
188+ struct mt9v032_platform_data *pdata;
189+ u16 chip_control;
190+ u16 aec_agc;
191+};
192+
193+static struct mt9v032 *to_mt9v032(struct v4l2_subdev *sd)
194+{
195+ return container_of(sd, struct mt9v032, subdev);
196+}
197+
198+static int mt9v032_read(struct i2c_client *client, const u8 reg)
199+{
200+ s32 data = i2c_smbus_read_word_data(client, reg);
201+ dev_dbg(&client->dev, "%s: read 0x%04x from 0x%02x\n", __func__,
202+ swab16(data), reg);
203+ return data < 0 ? data : swab16(data);
204+}
205+
206+static int mt9v032_write(struct i2c_client *client, const u8 reg,
207+ const u16 data)
208+{
209+ dev_dbg(&client->dev, "%s: writing 0x%04x to 0x%02x\n", __func__,
210+ data, reg);
211+ return i2c_smbus_write_word_data(client, reg, swab16(data));
212+}
213+
214+static int mt9v032_set_chip_control(struct mt9v032 *mt9v032, u16 clear, u16 set)
215+{
216+ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
217+ u16 value = (mt9v032->chip_control & ~clear) | set;
218+ int ret;
219+
220+ ret = mt9v032_write(client, MT9V032_CHIP_CONTROL, value);
221+ if (ret < 0)
222+ return ret;
223+
224+ mt9v032->chip_control = value;
225+ return 0;
226+}
227+
228+static int
229+mt9v032_update_aec_agc(struct mt9v032 *mt9v032, u16 which, int enable)
230+{
231+ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
232+ u16 value = mt9v032->aec_agc;
233+ int ret;
234+
235+ if (enable)
236+ value |= which;
237+ else
238+ value &= ~which;
239+
240+ ret = mt9v032_write(client, MT9V032_AEC_AGC_ENABLE, value);
241+ if (ret < 0)
242+ return ret;
243+
244+ mt9v032->aec_agc = value;
245+ return 0;
246+}
247+
248+static int mt9v032_power_on(struct mt9v032 *mt9v032)
249+{
250+ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
251+ int ret;
252+
253+ if (mt9v032->pdata->set_clock) {
254+ mt9v032->pdata->set_clock(&mt9v032->subdev, 25000000);
255+ udelay(1);
256+ }
257+
258+ /* Reset the chip and stop data read out */
259+ ret = mt9v032_write(client, MT9V032_RESET, 1);
260+ if (ret < 0)
261+ return ret;
262+
263+ ret = mt9v032_write(client, MT9V032_RESET, 0);
264+ if (ret < 0)
265+ return ret;
266+
267+ return mt9v032_write(client, MT9V032_CHIP_CONTROL, 0);
268+}
269+
270+static void mt9v032_power_off(struct mt9v032 *mt9v032)
271+{
272+ if (mt9v032->pdata->set_clock)
273+ mt9v032->pdata->set_clock(&mt9v032->subdev, 0);
274+}
275+
276+static int __mt9v032_set_power(struct mt9v032 *mt9v032, bool on)
277+{
278+ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
279+ int ret;
280+
281+ if (!on) {
282+ mt9v032_power_off(mt9v032);
283+ return 0;
284+ }
285+
286+ ret = mt9v032_power_on(mt9v032);
287+ if (ret < 0)
288+ return ret;
289+
290+ /* Configure the pixel clock polarity */
291+ if (mt9v032->pdata && mt9v032->pdata->clk_pol) {
292+ ret = mt9v032_write(client, MT9V032_PIXEL_CLOCK,
293+ MT9V032_PIXEL_CLOCK_INV_PXL_CLK);
294+ if (ret < 0)
295+ return ret;
296+ }
297+
298+ /* Disable the noise correction algorithm and restore the controls. */
299+ ret = mt9v032_write(client, MT9V032_ROW_NOISE_CORR_CONTROL, 0);
300+ if (ret < 0)
301+ return ret;
302+
303+ return v4l2_ctrl_handler_setup(&mt9v032->ctrls);
304+}
305+
306+/* -----------------------------------------------------------------------------
307+ * V4L2 subdev video operations
308+ */
309+
310+static struct v4l2_mbus_framefmt *
311+__mt9v032_get_pad_format(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh,
312+ unsigned int pad, enum v4l2_subdev_format_whence which)
313+{
314+ switch (which) {
315+ case V4L2_SUBDEV_FORMAT_TRY:
316+ return v4l2_subdev_get_try_format(fh, pad);
317+ case V4L2_SUBDEV_FORMAT_ACTIVE:
318+ return &mt9v032->format;
319+ default:
320+ return NULL;
321+ }
322+}
323+
324+static struct v4l2_rect *
325+__mt9v032_get_pad_crop(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh,
326+ unsigned int pad, enum v4l2_subdev_format_whence which)
327+{
328+ switch (which) {
329+ case V4L2_SUBDEV_FORMAT_TRY:
330+ return v4l2_subdev_get_try_crop(fh, pad);
331+ case V4L2_SUBDEV_FORMAT_ACTIVE:
332+ return &mt9v032->crop;
333+ default:
334+ return NULL;
335+ }
336+}
337+
338+static int mt9v032_s_stream(struct v4l2_subdev *subdev, int enable)
339+{
340+ const u16 mode = MT9V032_CHIP_CONTROL_MASTER_MODE
341+ | MT9V032_CHIP_CONTROL_DOUT_ENABLE
342+ | MT9V032_CHIP_CONTROL_SEQUENTIAL;
343+ struct i2c_client *client = v4l2_get_subdevdata(subdev);
344+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
345+ struct v4l2_mbus_framefmt *format = &mt9v032->format;
346+ struct v4l2_rect *crop = &mt9v032->crop;
347+ unsigned int hratio;
348+ unsigned int vratio;
349+ int ret;
350+
351+ if (!enable)
352+ return mt9v032_set_chip_control(mt9v032, mode, 0);
353+
354+ /* Configure the window size and row/column bin */
355+ hratio = DIV_ROUND_CLOSEST(crop->width, format->width);
356+ vratio = DIV_ROUND_CLOSEST(crop->height, format->height);
357+
358+ ret = mt9v032_write(client, MT9V032_READ_MODE,
359+ (hratio - 1) << MT9V032_READ_MODE_ROW_BIN_SHIFT |
360+ (vratio - 1) << MT9V032_READ_MODE_COLUMN_BIN_SHIFT);
361+ if (ret < 0)
362+ return ret;
363+
364+ ret = mt9v032_write(client, MT9V032_COLUMN_START, crop->left);
365+ if (ret < 0)
366+ return ret;
367+
368+ ret = mt9v032_write(client, MT9V032_ROW_START, crop->top);
369+ if (ret < 0)
370+ return ret;
371+
372+ ret = mt9v032_write(client, MT9V032_WINDOW_WIDTH, crop->width);
373+ if (ret < 0)
374+ return ret;
375+
376+ ret = mt9v032_write(client, MT9V032_WINDOW_HEIGHT, crop->height);
377+ if (ret < 0)
378+ return ret;
379+
380+ ret = mt9v032_write(client, MT9V032_HORIZONTAL_BLANKING,
381+ max(43, 660 - crop->width));
382+ if (ret < 0)
383+ return ret;
384+
385+ /* Switch to master "normal" mode */
386+ return mt9v032_set_chip_control(mt9v032, 0, mode);
387+}
388+
389+static int mt9v032_enum_mbus_code(struct v4l2_subdev *subdev,
390+ struct v4l2_subdev_fh *fh,
391+ struct v4l2_subdev_mbus_code_enum *code)
392+{
393+ if (code->index > 0)
394+ return -EINVAL;
395+
396+ code->code = V4L2_MBUS_FMT_SGRBG10_1X10;
397+ return 0;
398+}
399+
400+static int mt9v032_enum_frame_size(struct v4l2_subdev *subdev,
401+ struct v4l2_subdev_fh *fh,
402+ struct v4l2_subdev_frame_size_enum *fse)
403+{
404+ if (fse->index >= 8 || fse->code != V4L2_MBUS_FMT_SGRBG10_1X10)
405+ return -EINVAL;
406+
407+ fse->min_width = MT9V032_WINDOW_WIDTH_DEF / fse->index;
408+ fse->max_width = fse->min_width;
409+ fse->min_height = MT9V032_WINDOW_HEIGHT_DEF / fse->index;
410+ fse->max_height = fse->min_height;
411+
412+ return 0;
413+}
414+
415+static int mt9v032_get_format(struct v4l2_subdev *subdev,
416+ struct v4l2_subdev_fh *fh,
417+ struct v4l2_subdev_format *format)
418+{
419+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
420+
421+ format->format = *__mt9v032_get_pad_format(mt9v032, fh, format->pad,
422+ format->which);
423+ return 0;
424+}
425+
426+static int mt9v032_set_format(struct v4l2_subdev *subdev,
427+ struct v4l2_subdev_fh *fh,
428+ struct v4l2_subdev_format *format)
429+{
430+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
431+ struct v4l2_mbus_framefmt *__format;
432+ struct v4l2_rect *__crop;
433+ unsigned int width;
434+ unsigned int height;
435+ unsigned int hratio;
436+ unsigned int vratio;
437+
438+ __crop = __mt9v032_get_pad_crop(mt9v032, fh, format->pad,
439+ format->which);
440+
441+ /* Clamp the width and height to avoid dividing by zero. */
442+ width = clamp_t(unsigned int, ALIGN(format->format.width, 2),
443+ max(__crop->width / 8, MT9V032_WINDOW_WIDTH_MIN),
444+ __crop->width);
445+ height = clamp_t(unsigned int, ALIGN(format->format.height, 2),
446+ max(__crop->height / 8, MT9V032_WINDOW_HEIGHT_MIN),
447+ __crop->height);
448+
449+ hratio = DIV_ROUND_CLOSEST(__crop->width, width);
450+ vratio = DIV_ROUND_CLOSEST(__crop->height, height);
451+
452+ __format = __mt9v032_get_pad_format(mt9v032, fh, format->pad,
453+ format->which);
454+ __format->width = __crop->width / hratio;
455+ __format->height = __crop->height / vratio;
456+
457+ format->format = *__format;
458+
459+ return 0;
460+}
461+
462+static int mt9v032_get_crop(struct v4l2_subdev *subdev,
463+ struct v4l2_subdev_fh *fh,
464+ struct v4l2_subdev_crop *crop)
465+{
466+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
467+
468+ crop->rect = *__mt9v032_get_pad_crop(mt9v032, fh, crop->pad,
469+ crop->which);
470+ return 0;
471+}
472+
473+static int mt9v032_set_crop(struct v4l2_subdev *subdev,
474+ struct v4l2_subdev_fh *fh,
475+ struct v4l2_subdev_crop *crop)
476+{
477+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
478+ struct v4l2_mbus_framefmt *__format;
479+ struct v4l2_rect *__crop;
480+ struct v4l2_rect rect;
481+
482+ /* Clamp the crop rectangle boundaries and align them to a non multiple
483+ * of 2 pixels to ensure a GRBG Bayer pattern.
484+ */
485+ rect.left = clamp(ALIGN(crop->rect.left + 1, 2) - 1,
486+ MT9V032_COLUMN_START_MIN,
487+ MT9V032_COLUMN_START_MAX);
488+ rect.top = clamp(ALIGN(crop->rect.top + 1, 2) - 1,
489+ MT9V032_ROW_START_MIN,
490+ MT9V032_ROW_START_MAX);
491+ rect.width = clamp(ALIGN(crop->rect.width, 2),
492+ MT9V032_WINDOW_WIDTH_MIN,
493+ MT9V032_WINDOW_WIDTH_MAX);
494+ rect.height = clamp(ALIGN(crop->rect.height, 2),
495+ MT9V032_WINDOW_HEIGHT_MIN,
496+ MT9V032_WINDOW_HEIGHT_MAX);
497+
498+ rect.width = min(rect.width, MT9V032_PIXEL_ARRAY_WIDTH - rect.left);
499+ rect.height = min(rect.height, MT9V032_PIXEL_ARRAY_HEIGHT - rect.top);
500+
501+ __crop = __mt9v032_get_pad_crop(mt9v032, fh, crop->pad, crop->which);
502+
503+ if (rect.width != __crop->width || rect.height != __crop->height) {
504+ /* Reset the output image size if the crop rectangle size has
505+ * been modified.
506+ */
507+ __format = __mt9v032_get_pad_format(mt9v032, fh, crop->pad,
508+ crop->which);
509+ __format->width = rect.width;
510+ __format->height = rect.height;
511+ }
512+
513+ *__crop = rect;
514+ crop->rect = rect;
515+
516+ return 0;
517+}
518+
519+/* -----------------------------------------------------------------------------
520+ * V4L2 subdev control operations
521+ */
522+
523+#define V4L2_CID_TEST_PATTERN (V4L2_CID_USER_BASE | 0x1001)
524+
525+static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
526+{
527+ struct mt9v032 *mt9v032 =
528+ container_of(ctrl->handler, struct mt9v032, ctrls);
529+ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
530+ u16 data;
531+
532+ switch (ctrl->id) {
533+ case V4L2_CID_AUTOGAIN:
534+ return mt9v032_update_aec_agc(mt9v032, MT9V032_AGC_ENABLE,
535+ ctrl->val);
536+
537+ case V4L2_CID_GAIN:
538+ return mt9v032_write(client, MT9V032_ANALOG_GAIN, ctrl->val);
539+
540+ case V4L2_CID_EXPOSURE_AUTO:
541+ return mt9v032_update_aec_agc(mt9v032, MT9V032_AEC_ENABLE,
542+ ctrl->val);
543+
544+ case V4L2_CID_EXPOSURE:
545+ return mt9v032_write(client, MT9V032_TOTAL_SHUTTER_WIDTH,
546+ ctrl->val);
547+
548+ case V4L2_CID_TEST_PATTERN:
549+ switch (ctrl->val) {
550+ case 0:
551+ data = 0;
552+ break;
553+ case 1:
554+ data = MT9V032_TEST_PATTERN_GRAY_VERTICAL
555+ | MT9V032_TEST_PATTERN_ENABLE;
556+ break;
557+ case 2:
558+ data = MT9V032_TEST_PATTERN_GRAY_HORIZONTAL
559+ | MT9V032_TEST_PATTERN_ENABLE;
560+ break;
561+ case 3:
562+ data = MT9V032_TEST_PATTERN_GRAY_DIAGONAL
563+ | MT9V032_TEST_PATTERN_ENABLE;
564+ break;
565+ default:
566+ data = (ctrl->val << MT9V032_TEST_PATTERN_DATA_SHIFT)
567+ | MT9V032_TEST_PATTERN_USE_DATA
568+ | MT9V032_TEST_PATTERN_ENABLE
569+ | MT9V032_TEST_PATTERN_FLIP;
570+ break;
571+ }
572+
573+ return mt9v032_write(client, MT9V032_TEST_PATTERN, data);
574+ }
575+
576+ return 0;
577+}
578+
579+static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
580+ .s_ctrl = mt9v032_s_ctrl,
581+};
582+
583+static const struct v4l2_ctrl_config mt9v032_ctrls[] = {
584+ {
585+ .ops = &mt9v032_ctrl_ops,
586+ .id = V4L2_CID_TEST_PATTERN,
587+ .type = V4L2_CTRL_TYPE_INTEGER,
588+ .name = "Test pattern",
589+ .min = 0,
590+ .max = 1023,
591+ .step = 1,
592+ .def = 0,
593+ .flags = 0,
594+ }
595+};
596+
597+/* -----------------------------------------------------------------------------
598+ * V4L2 subdev core operations
599+ */
600+
601+static int mt9v032_set_power(struct v4l2_subdev *subdev, int on)
602+{
603+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
604+ int ret = 0;
605+
606+ mutex_lock(&mt9v032->power_lock);
607+
608+ /* If the power count is modified from 0 to != 0 or from != 0 to 0,
609+ * update the power state.
610+ */
611+ if (mt9v032->power_count == !on) {
612+ ret = __mt9v032_set_power(mt9v032, !!on);
613+ if (ret < 0)
614+ goto done;
615+ }
616+
617+ /* Update the power count. */
618+ mt9v032->power_count += on ? 1 : -1;
619+ WARN_ON(mt9v032->power_count < 0);
620+
621+done:
622+ mutex_unlock(&mt9v032->power_lock);
623+ return ret;
624+}
625+
626+/* -----------------------------------------------------------------------------
627+ * V4L2 subdev internal operations
628+ */
629+
630+static int mt9v032_registered(struct v4l2_subdev *subdev)
631+{
632+ struct i2c_client *client = v4l2_get_subdevdata(subdev);
633+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
634+ s32 data;
635+ int ret;
636+
637+ dev_info(&client->dev, "Probing MT9V032 at address 0x%02x\n",
638+ client->addr);
639+
640+ ret = mt9v032_power_on(mt9v032);
641+ if (ret < 0) {
642+ dev_err(&client->dev, "MT9V032 power up failed\n");
643+ return ret;
644+ }
645+
646+ /* Read and check the sensor version */
647+ data = mt9v032_read(client, MT9V032_CHIP_VERSION);
648+ if (data != MT9V032_CHIP_ID_REV1 && data != MT9V032_CHIP_ID_REV3) {
649+ dev_err(&client->dev, "MT9V032 not detected, wrong version "
650+ "0x%04x\n", data);
651+ return -ENODEV;
652+ }
653+
654+ mt9v032_power_off(mt9v032);
655+
656+ dev_info(&client->dev, "MT9V032 detected at address 0x%02x\n",
657+ client->addr);
658+
659+ return ret;
660+}
661+
662+static int mt9v032_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
663+{
664+ struct v4l2_mbus_framefmt *format;
665+ struct v4l2_rect *crop;
666+
667+ crop = v4l2_subdev_get_try_crop(fh, 0);
668+ crop->left = MT9V032_COLUMN_START_DEF;
669+ crop->top = MT9V032_ROW_START_DEF;
670+ crop->width = MT9V032_WINDOW_WIDTH_DEF;
671+ crop->height = MT9V032_WINDOW_HEIGHT_DEF;
672+
673+ format = v4l2_subdev_get_try_format(fh, 0);
674+ format->code = V4L2_MBUS_FMT_SGRBG10_1X10;
675+ format->width = MT9V032_WINDOW_WIDTH_DEF;
676+ format->height = MT9V032_WINDOW_HEIGHT_DEF;
677+ format->field = V4L2_FIELD_NONE;
678+ format->colorspace = V4L2_COLORSPACE_SRGB;
679+
680+ return mt9v032_set_power(subdev, 1);
681+}
682+
683+static int mt9v032_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
684+{
685+ return mt9v032_set_power(subdev, 0);
686+}
687+
688+static struct v4l2_subdev_core_ops mt9v032_subdev_core_ops = {
689+ .s_power = mt9v032_set_power,
690+};
691+
692+static struct v4l2_subdev_video_ops mt9v032_subdev_video_ops = {
693+ .s_stream = mt9v032_s_stream,
694+};
695+
696+static struct v4l2_subdev_pad_ops mt9v032_subdev_pad_ops = {
697+ .enum_mbus_code = mt9v032_enum_mbus_code,
698+ .enum_frame_size = mt9v032_enum_frame_size,
699+ .get_fmt = mt9v032_get_format,
700+ .set_fmt = mt9v032_set_format,
701+ .get_crop = mt9v032_get_crop,
702+ .set_crop = mt9v032_set_crop,
703+};
704+
705+static struct v4l2_subdev_ops mt9v032_subdev_ops = {
706+ .core = &mt9v032_subdev_core_ops,
707+ .video = &mt9v032_subdev_video_ops,
708+ .pad = &mt9v032_subdev_pad_ops,
709+};
710+
711+static const struct v4l2_subdev_internal_ops mt9v032_subdev_internal_ops = {
712+ .registered = mt9v032_registered,
713+ .open = mt9v032_open,
714+ .close = mt9v032_close,
715+};
716+
717+/* -----------------------------------------------------------------------------
718+ * Driver initialization and probing
719+ */
720+
721+static int mt9v032_probe(struct i2c_client *client,
722+ const struct i2c_device_id *did)
723+{
724+ struct mt9v032 *mt9v032;
725+ unsigned int i;
726+ int ret;
727+
728+ if (!i2c_check_functionality(client->adapter,
729+ I2C_FUNC_SMBUS_WORD_DATA)) {
730+ dev_warn(&client->adapter->dev,
731+ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
732+ return -EIO;
733+ }
734+
735+ mt9v032 = kzalloc(sizeof(*mt9v032), GFP_KERNEL);
736+ if (!mt9v032)
737+ return -ENOMEM;
738+
739+ mutex_init(&mt9v032->power_lock);
740+ mt9v032->pdata = client->dev.platform_data;
741+
742+ v4l2_ctrl_handler_init(&mt9v032->ctrls, ARRAY_SIZE(mt9v032_ctrls) + 4);
743+
744+ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
745+ V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
746+ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
747+ V4L2_CID_GAIN, MT9V032_ANALOG_GAIN_MIN,
748+ MT9V032_ANALOG_GAIN_MAX, 1, MT9V032_ANALOG_GAIN_DEF);
749+ v4l2_ctrl_new_std_menu(&mt9v032->ctrls, &mt9v032_ctrl_ops,
750+ V4L2_CID_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, 0,
751+ V4L2_EXPOSURE_AUTO);
752+ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
753+ V4L2_CID_EXPOSURE, MT9V032_TOTAL_SHUTTER_WIDTH_MIN,
754+ MT9V032_TOTAL_SHUTTER_WIDTH_MAX, 1,
755+ MT9V032_TOTAL_SHUTTER_WIDTH_DEF);
756+
757+ for (i = 0; i < ARRAY_SIZE(mt9v032_ctrls); ++i)
758+ v4l2_ctrl_new_custom(&mt9v032->ctrls, &mt9v032_ctrls[i], NULL);
759+
760+ mt9v032->subdev.ctrl_handler = &mt9v032->ctrls;
761+
762+ if (mt9v032->ctrls.error)
763+ printk(KERN_INFO "%s: control initialization error %d\n",
764+ __func__, mt9v032->ctrls.error);
765+
766+ mt9v032->crop.left = MT9V032_COLUMN_START_DEF;
767+ mt9v032->crop.top = MT9V032_ROW_START_DEF;
768+ mt9v032->crop.width = MT9V032_WINDOW_WIDTH_DEF;
769+ mt9v032->crop.height = MT9V032_WINDOW_HEIGHT_DEF;
770+
771+ mt9v032->format.code = V4L2_MBUS_FMT_SGRBG10_1X10;
772+ mt9v032->format.width = MT9V032_WINDOW_WIDTH_DEF;
773+ mt9v032->format.height = MT9V032_WINDOW_HEIGHT_DEF;
774+ mt9v032->format.field = V4L2_FIELD_NONE;
775+ mt9v032->format.colorspace = V4L2_COLORSPACE_SRGB;
776+
777+ mt9v032->aec_agc = MT9V032_AEC_ENABLE | MT9V032_AGC_ENABLE;
778+
779+ v4l2_i2c_subdev_init(&mt9v032->subdev, client, &mt9v032_subdev_ops);
780+ mt9v032->subdev.internal_ops = &mt9v032_subdev_internal_ops;
781+ mt9v032->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
782+
783+ mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE;
784+ ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0);
785+ if (ret < 0)
786+ kfree(mt9v032);
787+
788+ return ret;
789+}
790+
791+static int mt9v032_remove(struct i2c_client *client)
792+{
793+ struct v4l2_subdev *subdev = i2c_get_clientdata(client);
794+ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
795+
796+ v4l2_device_unregister_subdev(subdev);
797+ media_entity_cleanup(&subdev->entity);
798+ kfree(mt9v032);
799+ return 0;
800+}
801+
802+static const struct i2c_device_id mt9v032_id[] = {
803+ { "mt9v032", 0 },
804+ { }
805+};
806+MODULE_DEVICE_TABLE(i2c, mt9v032_id);
807+
808+static struct i2c_driver mt9v032_driver = {
809+ .driver = {
810+ .name = "mt9v032",
811+ },
812+ .probe = mt9v032_probe,
813+ .remove = mt9v032_remove,
814+ .id_table = mt9v032_id,
815+};
816+
817+static int __init mt9v032_init(void)
818+{
819+ return i2c_add_driver(&mt9v032_driver);
820+}
821+
822+static void __exit mt9v032_exit(void)
823+{
824+ i2c_del_driver(&mt9v032_driver);
825+}
826+
827+module_init(mt9v032_init);
828+module_exit(mt9v032_exit);
829+
830+MODULE_DESCRIPTION("Aptina MT9V032 Camera driver");
831+MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
832+MODULE_LICENSE("GPL");
833diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h
834new file mode 100644
835index 0000000..5e27f9b
836--- /dev/null
837+++ b/include/media/mt9v032.h
838@@ -0,0 +1,12 @@
839+#ifndef _MEDIA_MT9V032_H
840+#define _MEDIA_MT9V032_H
841+
842+struct v4l2_subdev;
843+
844+struct mt9v032_platform_data {
845+ unsigned int clk_pol:1;
846+
847+ void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate);
848+};
849+
850+#endif
851--
8521.6.6.1
853
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch
index 2de60ca2..86eafe37 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch
@@ -1,4 +1,4 @@
1From fc4833337f5386c40eaf41d533fb5fcbd38d6a1d Mon Sep 17 00:00:00 2001 1From 8812fba541092702d6a40ea23ff60bcb504365fd Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Thu, 12 May 2011 07:59:52 -0500 3Date: Thu, 12 May 2011 07:59:52 -0500
4Subject: [PATCH 1/6] OMAP2+: cpufreq: free up table on exit 4Subject: [PATCH 1/6] OMAP2+: cpufreq: free up table on exit
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch
index fb7ada2e..ee27578d 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch
@@ -1,4 +1,4 @@
1From bbd8caaeda861dfa69882c34d8556b541f822ae2 Mon Sep 17 00:00:00 2001 1From 1dce7658788943a8085323ef87111cdcdb335d1d Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Thu, 12 May 2011 08:14:41 -0500 3Date: Thu, 12 May 2011 08:14:41 -0500
4Subject: [PATCH 2/6] OMAP2+: cpufreq: handle invalid cpufreq table 4Subject: [PATCH 2/6] OMAP2+: cpufreq: handle invalid cpufreq table
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch
index 1cf78ebb..3064d504 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch
@@ -1,4 +1,4 @@
1From 47eeee58d9321e827e68ea3b914988db6b1635da Mon Sep 17 00:00:00 2001 1From 61c5ce4da03eda42e69cf225fddac9c910506db5 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Thu, 12 May 2011 16:27:45 -0700 3Date: Thu, 12 May 2011 16:27:45 -0700
4Subject: [PATCH 3/6] OMAP2+: cpufreq: minor comment cleanup 4Subject: [PATCH 3/6] OMAP2+: cpufreq: minor comment cleanup
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch
index a7f84df9..24a721a0 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch
@@ -1,4 +1,4 @@
1From d972d3f4eb53c261f8496176b429287b97e297d0 Mon Sep 17 00:00:00 2001 1From 4910bff43db304f58fef625d54e573d554066a78 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Fri, 13 May 2011 05:34:35 -0700 3Date: Fri, 13 May 2011 05:34:35 -0700
4Subject: [PATCH 4/6] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available 4Subject: [PATCH 4/6] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch
index 2bbab2f4..f5493b3b 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch
@@ -1,4 +1,4 @@
1From dec271e2e15103120df35be942884f577d6a768c Mon Sep 17 00:00:00 2001 1From e8d1f8ed3f2ed7c2e9ee51adfd322868d4195ecf Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Fri, 13 May 2011 05:43:49 -0700 3Date: Fri, 13 May 2011 05:43:49 -0700
4Subject: [PATCH 5/6] OMAP2+: cpufreq: use cpufreq_frequency_table_target 4Subject: [PATCH 5/6] OMAP2+: cpufreq: use cpufreq_frequency_table_target
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch
index 2595023c..0727ebcd 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch
@@ -1,4 +1,4 @@
1From d7559c9bd5225ad2e57e8c798dc1301396e05ce1 Mon Sep 17 00:00:00 2001 1From 9303bae0e4acf8a8b3b0c682d6655a656fc776bf Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Wed, 18 May 2011 01:48:23 -0500 3Date: Wed, 18 May 2011 01:48:23 -0500
4Subject: [PATCH 6/6] OMAP2+: cpufreq: fix freq_table leak 4Subject: [PATCH 6/6] OMAP2+: cpufreq: fix freq_table leak
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch
index e8a250b3..03385720 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch
@@ -1,4 +1,4 @@
1From b581872eacd6342a890b1c6d2596c16fac5875b5 Mon Sep 17 00:00:00 2001 1From 078a7006a32248c98d40ef79bbeb85a0879de734 Mon Sep 17 00:00:00 2001
2From: Mike Turquette <mturquette@ti.com> 2From: Mike Turquette <mturquette@ti.com>
3Date: Tue, 17 May 2011 09:35:54 -0500 3Date: Tue, 17 May 2011 09:35:54 -0500
4Subject: [PATCH 1/2] cpufreq: helpers for walking the frequency table 4Subject: [PATCH 1/2] cpufreq: helpers for walking the frequency table
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch
index 96154e9b..70fa625e 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch
@@ -1,4 +1,4 @@
1From 0faab5e374817718add80a132f6fc90943971a61 Mon Sep 17 00:00:00 2001 1From f31dabf5b6158584da56e7186ada6d2a80d5654e Mon Sep 17 00:00:00 2001
2From: Mike Turquette <mturquette@ti.com> 2From: Mike Turquette <mturquette@ti.com>
3Date: Tue, 17 May 2011 09:43:09 -0500 3Date: Tue, 17 May 2011 09:43:09 -0500
4Subject: [PATCH 2/2] cpufreq: introduce hotplug governor 4Subject: [PATCH 2/2] cpufreq: introduce hotplug governor
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch
index 823eff30..5093df3d 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch
@@ -1,4 +1,4 @@
1From a2564b1a8a946ddaf64930b48ec279b87bc758ca Mon Sep 17 00:00:00 2001 1From 2a72620933492b6be114a287e7188c47ee1f6844 Mon Sep 17 00:00:00 2001
2From: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com> 2From: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
3Date: Wed, 11 Aug 2010 17:02:43 -0700 3Date: Wed, 11 Aug 2010 17:02:43 -0700
4Subject: [PATCH 1/8] OMAP: CPUfreq: ensure driver initializes after cpufreq framework and governors 4Subject: [PATCH 1/8] OMAP: CPUfreq: ensure driver initializes after cpufreq framework and governors
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch
index d8a0de2e..5ef85b55 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch
@@ -1,4 +1,4 @@
1From cb564063772d73261a8dd24d9285a37e8db49cd4 Mon Sep 17 00:00:00 2001 1From ec7b7d1f27887ec5d76a2d4175e54cedcfa379da Mon Sep 17 00:00:00 2001
2From: Kevin Hilman <khilman@deeprootsystems.com> 2From: Kevin Hilman <khilman@deeprootsystems.com>
3Date: Wed, 11 Aug 2010 17:05:38 -0700 3Date: Wed, 11 Aug 2010 17:05:38 -0700
4Subject: [PATCH 2/8] OMAP: CPUfreq: ensure policy is fully initialized 4Subject: [PATCH 2/8] OMAP: CPUfreq: ensure policy is fully initialized
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
index 7861cebf..8593ee4d 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
@@ -1,4 +1,4 @@
1From 6702f624ad5c5e1eba57f9efe889f64333f9e022 Mon Sep 17 00:00:00 2001 1From 5f6e9a6011a5eedc51fc8157fffcae5b7fdf87e7 Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Mon, 10 Nov 2008 17:00:25 +0530 3Date: Mon, 10 Nov 2008 17:00:25 +0530
4Subject: [PATCH 3/8] OMAP3 PM: CPUFreq driver for OMAP3 4Subject: [PATCH 3/8] OMAP3 PM: CPUFreq driver for OMAP3
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch
index 062c537a..aa9cd485 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch
@@ -1,4 +1,4 @@
1From 71849b3531c66af5f925deb1deb60a3722d62463 Mon Sep 17 00:00:00 2001 1From 1f013ab3b839edb583a276b5591a744dc4308bf8 Mon Sep 17 00:00:00 2001
2From: Silesh C V <silesh@ti.com> 2From: Silesh C V <silesh@ti.com>
3Date: Wed, 29 Sep 2010 14:52:54 +0530 3Date: Wed, 29 Sep 2010 14:52:54 +0530
4Subject: [PATCH 4/8] OMAP: PM: CPUFREQ: Fix conditional compilation 4Subject: [PATCH 4/8] OMAP: PM: CPUFREQ: Fix conditional compilation
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch
index 19432f3a..f3432a2c 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch
@@ -1,4 +1,4 @@
1From 6d6506387d617a934bc4f8476e8f06a11e21b043 Mon Sep 17 00:00:00 2001 1From 43e22afa61f3624628c8344bcae9e95f0cc8525a Mon Sep 17 00:00:00 2001
2From: Kevin Hilman <khilman@deeprootsystems.com> 2From: Kevin Hilman <khilman@deeprootsystems.com>
3Date: Tue, 16 Nov 2010 11:48:41 -0800 3Date: Tue, 16 Nov 2010 11:48:41 -0800
4Subject: [PATCH 5/8] cpufreq: fixup after new OPP layer merged 4Subject: [PATCH 5/8] cpufreq: fixup after new OPP layer merged
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch
index 22e93c0a..cf80cb79 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch
@@ -1,4 +1,4 @@
1From d93e9bf14c8b5194c0db64ae7daae80c228bfc04 Mon Sep 17 00:00:00 2001 1From 2a3ca1bc3f842bab22873e2d9d002e0a736d0f19 Mon Sep 17 00:00:00 2001
2From: Santosh Shilimkar <santosh.shilimkar@ti.com> 2From: Santosh Shilimkar <santosh.shilimkar@ti.com>
3Date: Mon, 14 Mar 2011 17:08:48 +0530 3Date: Mon, 14 Mar 2011 17:08:48 +0530
4Subject: [PATCH 6/8] OMAP: cpufreq: Split OMAP1 and OMAP2PLUS CPUfreq drivers. 4Subject: [PATCH 6/8] OMAP: cpufreq: Split OMAP1 and OMAP2PLUS CPUfreq drivers.
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch
index 810873a6..51c1b3ea 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch
@@ -1,4 +1,4 @@
1From 1d829a2213997f903aacfffcf184e3705be38026 Mon Sep 17 00:00:00 2001 1From 7e421930c287f42bed624ad65250c16deaeae50f Mon Sep 17 00:00:00 2001
2From: Santosh Shilimkar <santosh.shilimkar@ti.com> 2From: Santosh Shilimkar <santosh.shilimkar@ti.com>
3Date: Mon, 14 Mar 2011 17:08:49 +0530 3Date: Mon, 14 Mar 2011 17:08:49 +0530
4Subject: [PATCH 7/8] OMAP2PLUS: cpufreq: Add SMP support to cater OMAP4430 4Subject: [PATCH 7/8] OMAP2PLUS: cpufreq: Add SMP support to cater OMAP4430
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch
index fd0c11ce..a2480818 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch
@@ -1,4 +1,4 @@
1From a216121073a645a3b9965f06a0813d77b3f467ca Mon Sep 17 00:00:00 2001 1From 92c6a90a264c5803fc239a7304e073cd1517658b Mon Sep 17 00:00:00 2001
2From: Jarkko Nikula <jhnikula@gmail.com> 2From: Jarkko Nikula <jhnikula@gmail.com>
3Date: Thu, 14 Apr 2011 16:21:58 +0300 3Date: Thu, 14 Apr 2011 16:21:58 +0300
4Subject: [PATCH 8/8] OMAP2PLUS: cpufreq: Fix typo when attempting to set mpu_clk for OMAP4 4Subject: [PATCH 8/8] OMAP2PLUS: cpufreq: Fix typo when attempting to set mpu_clk for OMAP4
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch
index d030c519..76ac4aba 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch
@@ -1,4 +1,4 @@
1From d19005cc07645703a61d4645c343ed586919575d Mon Sep 17 00:00:00 2001 1From ec3154869b4d2fb10e3d455ec8af1e248d9c972b Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 5 Apr 2011 15:22:31 +0530 3Date: Tue, 5 Apr 2011 15:22:31 +0530
4Subject: [PATCH 1/6] OMAP2+: clockdomain: Add an api to read idle mode 4Subject: [PATCH 1/6] OMAP2+: clockdomain: Add an api to read idle mode
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch
index fa79d074..a0471ef9 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch
@@ -1,4 +1,4 @@
1From 2863828e636c1766c6d2de85c900f6656f4b6675 Mon Sep 17 00:00:00 2001 1From 85b9e8fe08a8c85096be91cb8eb60d5450dac71d Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 5 Apr 2011 15:22:36 +0530 3Date: Tue, 5 Apr 2011 15:22:36 +0530
4Subject: [PATCH 2/6] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle 4Subject: [PATCH 2/6] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch
index 65a4fcbf..99c0b746 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch
@@ -1,4 +1,4 @@
1From dc352655af9c356f5c2db95c88718ed3a996569b Mon Sep 17 00:00:00 2001 1From 6dc3e54ade4c042c6e798fb6f17ff65b9357bc89 Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 5 Apr 2011 15:22:41 +0530 3Date: Tue, 5 Apr 2011 15:22:41 +0530
4Subject: [PATCH 3/6] OMAP2+: PM: Initialise sleep_switch to a non-valid value 4Subject: [PATCH 3/6] OMAP2+: PM: Initialise sleep_switch to a non-valid value
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch
index 7a94488f..fe8a4966 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch
@@ -1,4 +1,4 @@
1From 59bfd35cfef1c0b9c2c078082a47f957c27fa2fd Mon Sep 17 00:00:00 2001 1From 828597d32fc3926e2c9e6c57adcc50c7eac824de Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 5 Apr 2011 15:22:48 +0530 3Date: Tue, 5 Apr 2011 15:22:48 +0530
4Subject: [PATCH 4/6] OMAP2+: PM: idle clkdms only if already in idle 4Subject: [PATCH 4/6] OMAP2+: PM: idle clkdms only if already in idle
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch
index 0e9a2ee0..aeeda597 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch
@@ -1,4 +1,4 @@
1From 8bde567522cb85c91f49858a9026d3ec24283331 Mon Sep 17 00:00:00 2001 1From 6ecf0ebe9d520748b217a016ef8a0b239805a42c Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 29 Mar 2011 22:37:43 +0530 3Date: Tue, 29 Mar 2011 22:37:43 +0530
4Subject: [PATCH 5/6] OMAP2+: hwmod: Follow the recomended PRCM sequence 4Subject: [PATCH 5/6] OMAP2+: hwmod: Follow the recomended PRCM sequence
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch
index 8c902575..e95c9f83 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch
@@ -1,4 +1,4 @@
1From 06ef3c33307622a7c4ab0f7cbfaf0163a1be5a81 Mon Sep 17 00:00:00 2001 1From 0af36cc0dcf5a6654e25eb33509fe0bc44a1dd81 Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com> 2From: Rajendra Nayak <rnayak@ti.com>
3Date: Tue, 2 Mar 2010 17:25:30 +0530 3Date: Tue, 2 Mar 2010 17:25:30 +0530
4Subject: [PATCH 6/6] OMAP: Serial: Check wk_st only if present 4Subject: [PATCH 6/6] OMAP: Serial: Check wk_st only if present
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch
index f1a5bbbc..f80c07ec 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch
@@ -1,4 +1,4 @@
1From 26d1f5966161349845884ae3c8f558d2580f1eb9 Mon Sep 17 00:00:00 2001 1From f505147f6352faaf3d70b00a757279d56e2ef78b Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Sat, 12 Feb 2011 17:27:14 +0530 3Date: Sat, 12 Feb 2011 17:27:14 +0530
4Subject: [PATCH 01/12] OMAP3+: voltage: remove spurious pr_notice for debugfs 4Subject: [PATCH 01/12] OMAP3+: voltage: remove spurious pr_notice for debugfs
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch
index 186c6846..dc800647 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch
@@ -1,4 +1,4 @@
1From f9e0aa8fa5538ddd92e12c5a062e78b0ae5e47e9 Mon Sep 17 00:00:00 2001 1From 79f5f1bb1c1a0f004e41660742a0bf736744ad0e Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Sun, 13 Mar 2011 09:07:23 +0530 3Date: Sun, 13 Mar 2011 09:07:23 +0530
4Subject: [PATCH 02/12] OMAP4: PM: remove redundant #ifdef CONFIG_PM 4Subject: [PATCH 02/12] OMAP4: PM: remove redundant #ifdef CONFIG_PM
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch
index 8e6a11bb..a17d2bb5 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch
@@ -1,4 +1,4 @@
1From c57f8521c772b2a934dc090d68d7ca3b33c99a46 Mon Sep 17 00:00:00 2001 1From b0ed051910c29c99e604ad4eb06d480199fcbd34 Mon Sep 17 00:00:00 2001
2From: Aaro Koskinen <aaro.koskinen@nokia.com> 2From: Aaro Koskinen <aaro.koskinen@nokia.com>
3Date: Thu, 24 Mar 2011 18:35:31 +0200 3Date: Thu, 24 Mar 2011 18:35:31 +0200
4Subject: [PATCH 03/12] OMAP3+: smartreflex: fix sr_late_init() error path in probe 4Subject: [PATCH 03/12] OMAP3+: smartreflex: fix sr_late_init() error path in probe
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch
index 335f092a..5ca9678f 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch
@@ -1,4 +1,4 @@
1From e09d0dd5be3f582aaf4626b3be0eeba42ca598bd Mon Sep 17 00:00:00 2001 1From d494d209b9b3c1cb13981a9756818f2822379a13 Mon Sep 17 00:00:00 2001
2From: Aaro Koskinen <aaro.koskinen@nokia.com> 2From: Aaro Koskinen <aaro.koskinen@nokia.com>
3Date: Thu, 24 Mar 2011 18:35:32 +0200 3Date: Thu, 24 Mar 2011 18:35:32 +0200
4Subject: [PATCH 04/12] OMAP3+: smartreflex: request the memory region 4Subject: [PATCH 04/12] OMAP3+: smartreflex: request the memory region
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch
index 7783da7c..a9da9699 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch
@@ -1,4 +1,4 @@
1From ca7c837b7f6c37c86d0646774a60d82848557411 Mon Sep 17 00:00:00 2001 1From 7553d0119d9f62a809d21993deaac2a745251c3b Mon Sep 17 00:00:00 2001
2From: Aaro Koskinen <aaro.koskinen@nokia.com> 2From: Aaro Koskinen <aaro.koskinen@nokia.com>
3Date: Thu, 24 Mar 2011 18:35:33 +0200 3Date: Thu, 24 Mar 2011 18:35:33 +0200
4Subject: [PATCH 05/12] OMAP3+: smartreflex: fix ioremap leak on probe error 4Subject: [PATCH 05/12] OMAP3+: smartreflex: fix ioremap leak on probe error
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch
index 8c5fe19d..8f76fc37 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch
@@ -1,4 +1,4 @@
1From 11af4217e7e6c2c21d1fe9e5f317a5baabf9a361 Mon Sep 17 00:00:00 2001 1From cdb1237e4829a7912fe4e78e73f20bda9ea22d6d Mon Sep 17 00:00:00 2001
2From: Aaro Koskinen <aaro.koskinen@nokia.com> 2From: Aaro Koskinen <aaro.koskinen@nokia.com>
3Date: Thu, 24 Mar 2011 18:35:34 +0200 3Date: Thu, 24 Mar 2011 18:35:34 +0200
4Subject: [PATCH 06/12] OMAP3+: smartreflex: delete instance from sr_list on probe error 4Subject: [PATCH 06/12] OMAP3+: smartreflex: delete instance from sr_list on probe error
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch
index 1f4d43c8..897ddb0d 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch
@@ -1,4 +1,4 @@
1From d4ead89805d1146f79a3204467eecb19dcdc442a Mon Sep 17 00:00:00 2001 1From abfa4bd473f227d2d0b42367c5aeaf6e16214a95 Mon Sep 17 00:00:00 2001
2From: Aaro Koskinen <aaro.koskinen@nokia.com> 2From: Aaro Koskinen <aaro.koskinen@nokia.com>
3Date: Thu, 24 Mar 2011 18:35:35 +0200 3Date: Thu, 24 Mar 2011 18:35:35 +0200
4Subject: [PATCH 07/12] OMAP3+: smartreflex: delete debugfs entries on probe error 4Subject: [PATCH 07/12] OMAP3+: smartreflex: delete debugfs entries on probe error
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch
index 185454e3..72183c44 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch
@@ -1,4 +1,4 @@
1From 9f4d8f56ce3268ee3e2efc9489d50d66d361f32d Mon Sep 17 00:00:00 2001 1From f8a6387ba73da6c8fe4281449b85f1825f2403bb Mon Sep 17 00:00:00 2001
2From: Jean Pihet <j-pihet@ti.com> 2From: Jean Pihet <j-pihet@ti.com>
3Date: Fri, 29 Apr 2011 11:26:22 +0200 3Date: Fri, 29 Apr 2011 11:26:22 +0200
4Subject: [PATCH 08/12] OMAP3 cpuidle: remove useless SDP specific timings 4Subject: [PATCH 08/12] OMAP3 cpuidle: remove useless SDP specific timings
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch
index 88a45ba3..2e5414c7 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch
@@ -1,4 +1,4 @@
1From 62629e3664ff1e3c9b34b94b81eafa153671e1ed Mon Sep 17 00:00:00 2001 1From d7992ea7da87a0802fa2b65819bf0e3adc5ba502 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Mon, 14 Feb 2011 12:16:36 +0530 3Date: Mon, 14 Feb 2011 12:16:36 +0530
4Subject: [PATCH 09/12] OMAP3+: SR: make notify independent of class 4Subject: [PATCH 09/12] OMAP3+: SR: make notify independent of class
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch
index da171b02..10ada915 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch
@@ -1,4 +1,4 @@
1From 4aa0f416a44a7053d223f80a8e4be9d0ebdd31ae Mon Sep 17 00:00:00 2001 1From 1f8185e181d5b9c1f47ce5f858dad3bba2be240d Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Mon, 14 Feb 2011 12:41:10 +0530 3Date: Mon, 14 Feb 2011 12:41:10 +0530
4Subject: [PATCH 10/12] OMAP3+: SR: disable interrupt by default 4Subject: [PATCH 10/12] OMAP3+: SR: disable interrupt by default
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
index 925beddc..99176652 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
@@ -1,4 +1,4 @@
1From aa44b466398b8b104c07ff1b7209509300fc4f47 Mon Sep 17 00:00:00 2001 1From 488e6ec1262fd56c62b09874fcf8557709f30ef2 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Mon, 14 Feb 2011 21:14:17 +0530 3Date: Mon, 14 Feb 2011 21:14:17 +0530
4Subject: [PATCH 11/12] OMAP3+: SR: enable/disable SR only on need 4Subject: [PATCH 11/12] OMAP3+: SR: enable/disable SR only on need
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch
index 7241112e..e8dddc1c 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch
@@ -1,4 +1,4 @@
1From 0ea922a6c65ea07b685ec05085dd5d3ec4ac87e2 Mon Sep 17 00:00:00 2001 1From 5e50b744aeca31be1c93790e048fc69c2f77c6c9 Mon Sep 17 00:00:00 2001
2From: Nishanth Menon <nm@ti.com> 2From: Nishanth Menon <nm@ti.com>
3Date: Mon, 14 Feb 2011 12:33:13 +0530 3Date: Mon, 14 Feb 2011 12:33:13 +0530
4Subject: [PATCH 12/12] OMAP3+: SR: fix cosmetic indentation 4Subject: [PATCH 12/12] OMAP3+: SR: fix cosmetic indentation
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch
index 3d836a0f..24700eed 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch
@@ -1,7 +1,7 @@
1From 6c106e173b2b0be58ba68e800d0e1bdd731174c4 Mon Sep 17 00:00:00 2001 1From 19d9727973e7b0c5f8983a1a5ae3b0a02e062bab Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@ti.com> 2From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3Date: Thu, 7 Apr 2011 15:28:47 +0300 3Date: Thu, 7 Apr 2011 15:28:47 +0300
4Subject: [PATCH 01/30] OMAP: DSS2: DSI: fix use_sys_clk & highfreq 4Subject: [PATCH 01/31] OMAP: DSS2: DSI: fix use_sys_clk & highfreq
5 5
6use_sys_clk and highfreq fields in dsi.current_cinfo were never set. 6use_sys_clk and highfreq fields in dsi.current_cinfo were never set.
7Luckily they weren't used anywhere so it didn't cause any problems. 7Luckily they weren't used anywhere so it didn't cause any problems.
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch
index e32b8e9b..7ab7f4d7 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch
@@ -1,7 +1,7 @@
1From c440fa0e7472cbe20b783de7ed14ffa8a9f3290f Mon Sep 17 00:00:00 2001 1From 2bc828d1b81d857238dc8b1f29e38e466469e352 Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@ti.com> 2From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3Date: Mon, 4 Apr 2011 10:02:53 +0300 3Date: Mon, 4 Apr 2011 10:02:53 +0300
4Subject: [PATCH 02/30] OMAP: DSS2: DSI: fix dsi_dump_clocks() 4Subject: [PATCH 02/31] OMAP: DSS2: DSI: fix dsi_dump_clocks()
5 5
6On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock 6On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock
7(CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that 7(CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch
index 93beabbd..0bef2d2f 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch
@@ -1,7 +1,7 @@
1From d6e2082fe2d1abd4bb8d1492d28f5f76f09e6121 Mon Sep 17 00:00:00 2001 1From 29d6de29d3d0d2ac9fe0572cd4e0485757eca550 Mon Sep 17 00:00:00 2001
2From: Archit Taneja <archit@ti.com> 2From: Archit Taneja <archit@ti.com>
3Date: Thu, 31 Mar 2011 13:23:35 +0530 3Date: Thu, 31 Mar 2011 13:23:35 +0530
4Subject: [PATCH 03/30] OMAP2PLUS: DSS2: Fix: Return correct lcd clock source for OMAP2/3 4Subject: [PATCH 03/31] OMAP2PLUS: DSS2: Fix: Return correct lcd clock source for OMAP2/3
5 5
6dss.lcd_clk_source is set to the default value DSS_CLK_SRC_FCK at dss_init. 6dss.lcd_clk_source is set to the default value DSS_CLK_SRC_FCK at dss_init.
7For OMAP2 and OMAP3, the dss.lcd_clk_source should always be the same as 7For OMAP2 and OMAP3, the dss.lcd_clk_source should always be the same as
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch
index fcf8f897..f204b87e 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch
@@ -1,7 +1,7 @@
1From 513d8f83be6a3e9a4b7f1ef23656ac84b109d7a8 Mon Sep 17 00:00:00 2001 1From e7665ffb72cbc890b8494c687b335e3e242231d9 Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@ti.com> 2From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3Date: Fri, 15 Apr 2011 10:42:59 +0300 3Date: Fri, 15 Apr 2011 10:42:59 +0300
4Subject: [PATCH 04/30] OMAP: DSS: DSI: Fix DSI PLL power bug 4Subject: [PATCH 04/31] OMAP: DSS: DSI: Fix DSI PLL power bug
5 5
6OMAP3630 has a HW bug causing DSI PLL power command POWER_ON_DIV (0x3) 6OMAP3630 has a HW bug causing DSI PLL power command POWER_ON_DIV (0x3)
7to not work properly. The bug prevents us from enabling DSI PLL power 7to not work properly. The bug prevents us from enabling DSI PLL power
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch
index be520fd1..8d4b175b 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch
@@ -1,7 +1,7 @@
1From e9b70efca1b15f5e743cccacb925156ca99878a7 Mon Sep 17 00:00:00 2001 1From c84fbf480062086f93f99c27817e4d2d91593511 Mon Sep 17 00:00:00 2001
2From: Tomi Valkeinen <tomi.valkeinen@ti.com> 2From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3Date: Fri, 8 Apr 2011 09:30:27 +0300 3Date: Fri, 8 Apr 2011 09:30:27 +0300
4Subject: [PATCH 05/30] OMAP: DSS2: fix panel Kconfig dependencies 4Subject: [PATCH 05/31] OMAP: DSS2: fix panel Kconfig dependencies
5 5
6All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the 6All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the
7dependency. 7dependency.
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch
index eeb41a25..e7751c58 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch
@@ -1,7 +1,7 @@
1From bf7e98aa062cf6a78e7f68089609f5693d5ca72b Mon Sep 17 00:00:00 2001 1From 756700075d8ebd5979f3ea2d20f44356c417dfe4 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Tue, 19 Jan 2010 21:19:15 -0800 3Date: Tue, 19 Jan 2010 21:19:15 -0800
4Subject: [PATCH 06/30] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output 4Subject: [PATCH 06/31] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output
5 5
6also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp 6also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch
index c9ecaddf..3cd3ff98 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch
@@ -1,7 +1,7 @@
1From bb5ff1aa2cf586b544d17b9afa00a347eeeb7012 Mon Sep 17 00:00:00 2001 1From bbfdb465c2970b1cd18fd0ae5adf99e61cfd530e Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Sat, 19 Dec 2009 06:52:43 -0800 3Date: Sat, 19 Dec 2009 06:52:43 -0800
4Subject: [PATCH 07/30] video: add timings for hd720 4Subject: [PATCH 07/31] video: add timings for hd720
5 5
6--- 6---
7 drivers/video/modedb.c | 4 ++++ 7 drivers/video/modedb.c | 4 ++++
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch
index 2baf826c..b798199c 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch
@@ -1,7 +1,7 @@
1From b01ef0758c3ab86173b13d2da2d6850f520dfe80 Mon Sep 17 00:00:00 2001 1From 45b1b2aefac18adf9246b56f82355597b26e997b Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <sakoman@gmail.com> 2From: Steve Sakoman <sakoman@gmail.com>
3Date: Tue, 15 Dec 2009 15:17:44 -0800 3Date: Tue, 15 Dec 2009 15:17:44 -0800
4Subject: [PATCH 08/30] drivers: net: smsc911x: return ENODEV if device is not found 4Subject: [PATCH 08/31] drivers: net: smsc911x: return ENODEV if device is not found
5 5
6Signed-off-by: Steve Sakoman <sakoman@gmail.com> 6Signed-off-by: Steve Sakoman <sakoman@gmail.com>
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch
index fab3b182..80b09dd5 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch
@@ -1,7 +1,7 @@
1From 5a26a8992c0baa8ff0944f0e09b1aee4dd5e3450 Mon Sep 17 00:00:00 2001 1From fda068cf87fc12f12aeaea2e428d78afac43c19b Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <sakoman@gmail.com> 2From: Steve Sakoman <sakoman@gmail.com>
3Date: Tue, 15 Dec 2009 15:24:10 -0800 3Date: Tue, 15 Dec 2009 15:24:10 -0800
4Subject: [PATCH 09/30] drivers: input: touchscreen: ads7846: return ENODEV if device is not found 4Subject: [PATCH 09/31] drivers: input: touchscreen: ads7846: return ENODEV if device is not found
5 5
6Signed-off-by: Steve Sakoman <sakoman@gmail.com> 6Signed-off-by: Steve Sakoman <sakoman@gmail.com>
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch
index 876b47aa..ef74568f 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch
@@ -1,7 +1,7 @@
1From 03ae041e2cee01b98b8c6d46a94a2b9025f74e14 Mon Sep 17 00:00:00 2001 1From 44940d48b3d535072e6a4d225173c3115bacc75b Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 3 Mar 2011 13:29:30 -0800 3Date: Thu, 3 Mar 2011 13:29:30 -0800
4Subject: [PATCH 10/30] Revert "omap2_mcspi: Flush posted writes" 4Subject: [PATCH 10/31] Revert "omap2_mcspi: Flush posted writes"
5 5
6This reverts commit a330ce2001b290c59fe98c37e981683ef0a75fdf. 6This reverts commit a330ce2001b290c59fe98c37e981683ef0a75fdf.
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch
index 78f69116..0f39a8a7 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch
@@ -1,7 +1,7 @@
1From 94b2b9670eb5e0af73bd98a991bee9856fe0e654 Mon Sep 17 00:00:00 2001 1From b4a56c6ec6df1af55b75608ff7c7cbf91660eb91 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Fri, 19 Nov 2010 15:11:19 -0800 3Date: Fri, 19 Nov 2010 15:11:19 -0800
4Subject: [PATCH 11/30] Revert "omap_hsmmc: improve interrupt synchronisation" 4Subject: [PATCH 11/31] Revert "omap_hsmmc: improve interrupt synchronisation"
5 5
6This reverts commit b417577d3b9bbb06a4ddc9aa955af9bd503f7242. 6This reverts commit b417577d3b9bbb06a4ddc9aa955af9bd503f7242.
7 7
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch
index 3d51fca7..4c061455 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch
@@ -1,7 +1,7 @@
1From 0efaa4ad5c5040db8cfa729145ed64c5ff878e9e Mon Sep 17 00:00:00 2001 1From 796b0fc090132a5ea3849bd3177cb88c64ad2160 Mon Sep 17 00:00:00 2001
2From: David Vrabel <david.vrabel@csr.com> 2From: David Vrabel <david.vrabel@csr.com>
3Date: Fri, 2 Apr 2010 08:41:47 -0700 3Date: Fri, 2 Apr 2010 08:41:47 -0700
4Subject: [PATCH 12/30] Don't turn SDIO cards off to save power. Doing so will lose all internal state in the card. 4Subject: [PATCH 12/31] Don't turn SDIO cards off to save power. Doing so will lose all internal state in the card.
5 5
6Signed-off-by: David Vrabel <david.vrabel@csr.com> 6Signed-off-by: David Vrabel <david.vrabel@csr.com>
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch
index 6756886e..29f5e172 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch
@@ -1,7 +1,7 @@
1From 008e668e53c5d230910d1b97deaff99ec2259e71 Mon Sep 17 00:00:00 2001 1From 9231d1d9fac779c95809dedf95fde64738b4186f Mon Sep 17 00:00:00 2001
2From: David Vrabel <david.vrabel@csr.com> 2From: David Vrabel <david.vrabel@csr.com>
3Date: Fri, 2 Apr 2010 08:42:22 -0700 3Date: Fri, 2 Apr 2010 08:42:22 -0700
4Subject: [PATCH 13/30] Enable the use of SDIO card interrupts. 4Subject: [PATCH 13/31] Enable the use of SDIO card interrupts.
5 5
6FCLK must be enabled while SDIO interrupts are enabled or the MMC 6FCLK must be enabled while SDIO interrupts are enabled or the MMC
7module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in 7module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch
index 8d95f94d..962e664b 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch
@@ -1,7 +1,7 @@
1From 39a7aa6274c0d63acadc95a242f1a2ad47c1c680 Mon Sep 17 00:00:00 2001 1From e94f62ff96d19547c5a0d9e99691f19fe91c451a Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 17 Dec 2009 12:45:20 -0800 3Date: Thu, 17 Dec 2009 12:45:20 -0800
4Subject: [PATCH 14/30] soc: codecs: Enable audio capture by default for twl4030 4Subject: [PATCH 14/31] soc: codecs: Enable audio capture by default for twl4030
5 5
6--- 6---
7 sound/soc/codecs/twl4030.c | 4 ++-- 7 sound/soc/codecs/twl4030.c | 4 ++--
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch
index 5979d074..60bf6e2e 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch
@@ -1,7 +1,7 @@
1From add8f3f1d3592c2976124062f70b88dd3e3f7673 Mon Sep 17 00:00:00 2001 1From fadce249fe7562795ce9f8fc92f8aa7a586725dc Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Wed, 29 Dec 2010 11:39:16 -0800 3Date: Wed, 29 Dec 2010 11:39:16 -0800
4Subject: [PATCH 15/30] soc: codecs: twl4030: Turn on mic bias by default 4Subject: [PATCH 15/31] soc: codecs: twl4030: Turn on mic bias by default
5 5
6--- 6---
7 sound/soc/codecs/twl4030.c | 2 +- 7 sound/soc/codecs/twl4030.c | 2 +-
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
index 11f6d4c5..23447476 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
@@ -1,7 +1,7 @@
1From 859eda7a9b4ff6240006b65679a3e04ecd7c474a Mon Sep 17 00:00:00 2001 1From a49740bb7066dbbf1b7f6bda73cdc45169202ebf Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 4 Feb 2010 12:26:22 -0800 3Date: Thu, 4 Feb 2010 12:26:22 -0800
4Subject: [PATCH 16/30] RTC: add support for backup battery recharge 4Subject: [PATCH 16/31] RTC: add support for backup battery recharge
5 5
6--- 6---
7 drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++ 7 drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch
index ead233db..a95b3132 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch
@@ -1,7 +1,7 @@
1From 31482a8ae0ca57e0e530564e589b16bfb2bbb93c Mon Sep 17 00:00:00 2001 1From e4e17b2fa3aa84e14303d2270a49f1ac9bf25b5c Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Sun, 24 Jan 2010 09:33:56 -0800 3Date: Sun, 24 Jan 2010 09:33:56 -0800
4Subject: [PATCH 17/30] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test 4Subject: [PATCH 17/31] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test
5 5
6otherwise it is not executed on systems that use non-twl regulators 6otherwise it is not executed on systems that use non-twl regulators
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch
index 77cf64f0..0083bde1 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch
@@ -1,7 +1,7 @@
1From 41b834aed6b2902683102eacff56428158792187 Mon Sep 17 00:00:00 2001 1From 80c2126f5bf63ea2d033310e030cac5229865a9a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Bernhard=20W=C3=B6rndl-Aichriedler?= <bwa@xdevelop.at> 2From: =?UTF-8?q?Bernhard=20W=C3=B6rndl-Aichriedler?= <bwa@xdevelop.at>
3Date: Sat, 15 May 2010 16:34:05 +0200 3Date: Sat, 15 May 2010 16:34:05 +0200
4Subject: [PATCH 18/30] Add power-off support for the TWL4030 companion 4Subject: [PATCH 18/31] Add power-off support for the TWL4030 companion
5 5
6This patch adds support for the power-off on shutdown feature of the TWL4030 6This patch adds support for the power-off on shutdown feature of the TWL4030
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch
index 5c4c6570..66434759 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch
@@ -1,7 +1,7 @@
1From 98ee7c7f078aa79db223967040598a49c46931fe Mon Sep 17 00:00:00 2001 1From d4f736154c4a873a12408d0d094e2152a4c4dc96 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Thu, 17 Dec 2009 14:27:15 -0800 3Date: Thu, 17 Dec 2009 14:27:15 -0800
4Subject: [PATCH 19/30] ARM: OMAP: Add twl4030 madc support to Overo 4Subject: [PATCH 19/31] ARM: OMAP: Add twl4030 madc support to Overo
5 5
6Signed-off-by: Steve Sakoman <steve@sakoman.com> 6Signed-off-by: Steve Sakoman <steve@sakoman.com>
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch
index afd2a999..75321503 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch
@@ -1,7 +1,7 @@
1From 2efc7dd29df90a4e248c080797b1511db0399d67 Mon Sep 17 00:00:00 2001 1From 4f5e04f8fcc6e6835aad7dde949c1cb82b5eaa45 Mon Sep 17 00:00:00 2001
2From: Keerthy <j-keerthy@ti.com> 2From: Keerthy <j-keerthy@ti.com>
3Date: Wed, 4 May 2011 01:14:50 +0530 3Date: Wed, 4 May 2011 01:14:50 +0530
4Subject: [PATCH 20/30] Enabling Hwmon driver for twl4030-madc 4Subject: [PATCH 20/31] Enabling Hwmon driver for twl4030-madc
5 5
6Signed-off-by: Keerthy <j-keerthy@ti.com> 6Signed-off-by: Keerthy <j-keerthy@ti.com>
7--- 7---
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch
index 805a35ef..65c26308 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch
@@ -1,7 +1,7 @@
1From 31b6b44adffe954ece851daff092f628a951712e Mon Sep 17 00:00:00 2001 1From faa15ccdcc5690ba83d4d09049222df35f40719d Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Sat, 23 Jan 2010 06:26:54 -0800 3Date: Sat, 23 Jan 2010 06:26:54 -0800
4Subject: [PATCH 21/30] mfd: twl-core: enable madc clock 4Subject: [PATCH 21/31] mfd: twl-core: enable madc clock
5 5
6Now that the madc driver has been merged it is also necessary to enable the clock to the madc block 6Now that the madc driver has been merged it is also necessary to enable the clock to the madc block
7 7
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch
index 809f3ed1..780012a1 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch
@@ -1,7 +1,7 @@
1From e0dc7f9a7d63c8cd5e4183cf5626ec11e272e3e0 Mon Sep 17 00:00:00 2001 1From b94621613e7ece11e6408efe33ceb724892645d1 Mon Sep 17 00:00:00 2001
2From: Ilkka Koskinen <ilkka.koskinen@nokia.com> 2From: Ilkka Koskinen <ilkka.koskinen@nokia.com>
3Date: Wed, 16 Mar 2011 16:07:14 +0000 3Date: Wed, 16 Mar 2011 16:07:14 +0000
4Subject: [PATCH 22/30] rtc-twl: Switch to using threaded irq 4Subject: [PATCH 22/31] rtc-twl: Switch to using threaded irq
5 5
6--- 6---
7 drivers/rtc/rtc-twl.c | 2 +- 7 drivers/rtc/rtc-twl.c | 2 +-
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch
index 4afc7e17..bb9408a8 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch
@@ -1,7 +1,7 @@
1From 80ac44d7f93ac3b8db9921feed4080c8dc572c0f Mon Sep 17 00:00:00 2001 1From 9a400cd7d8af58a7ba9dadaf6208c3f6ec9bb8a5 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Wed, 24 Feb 2010 10:37:22 -0800 3Date: Wed, 24 Feb 2010 10:37:22 -0800
4Subject: [PATCH 23/30] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options 4Subject: [PATCH 23/31] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options
5 5
6--- 6---
7 arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++ 7 arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
index 9aac69d0..ce27c938 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
@@ -1,7 +1,7 @@
1From 3b7393eb41684f3f44e8c15bbba4ab0e830f8810 Mon Sep 17 00:00:00 2001 1From 26a79f408bd41ad7b4a47f2683909d3fc1575eab Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Wed, 12 Jan 2011 05:54:55 -0800 3Date: Wed, 12 Jan 2011 05:54:55 -0800
4Subject: [PATCH 24/30] omap: mmc: Adjust dto to eliminate timeout errors 4Subject: [PATCH 24/31] omap: mmc: Adjust dto to eliminate timeout errors
5 5
6A number of SD card types were experiencing timeout errors. This 6A number of SD card types were experiencing timeout errors. This
7could also lead to data corruption in some cases. 7could also lead to data corruption in some cases.
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch
index b0828c2e..f16ee2f1 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch
@@ -1,7 +1,7 @@
1From 5c688ec6e6f046d2c8b3821964971149b0c30fc7 Mon Sep 17 00:00:00 2001 1From a13b58ba9d6e0aa0fe0d2dc5b51de545cea2ee9e Mon Sep 17 00:00:00 2001
2From: Charles Manning <cdhmanning@gmail.com> 2From: Charles Manning <cdhmanning@gmail.com>
3Date: Tue, 18 Jan 2011 11:25:25 +1300 3Date: Tue, 18 Jan 2011 11:25:25 +1300
4Subject: [PATCH 25/30] omap: Fix mtd subpage read alignment 4Subject: [PATCH 25/31] omap: Fix mtd subpage read alignment
5 5
6This allows the omap2 prefetch engine to work properly for subpage 6This allows the omap2 prefetch engine to work properly for subpage
7reads. Without this ECC errors will stop UBIFS from working. 7reads. Without this ECC errors will stop UBIFS from working.
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch
index b9b235a0..4a424c9b 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch
@@ -1,7 +1,7 @@
1From 3592c2e24b0af79aa2fb181a9825d5b72e2f68dd Mon Sep 17 00:00:00 2001 1From e0756b50ed72ebe28c768c9e17ee7811cc3cc53c Mon Sep 17 00:00:00 2001
2From: Charles Manning <manningc2@actrix.gen.nz> 2From: Charles Manning <manningc2@actrix.gen.nz>
3Date: Thu, 16 Dec 2010 20:35:56 -0800 3Date: Thu, 16 Dec 2010 20:35:56 -0800
4Subject: [PATCH 26/30] mtd: nand: omap2: Force all buffer reads to u32 alignment 4Subject: [PATCH 26/31] mtd: nand: omap2: Force all buffer reads to u32 alignment
5 5
6--- 6---
7 drivers/mtd/nand/omap2.c | 12 ++++++++++++ 7 drivers/mtd/nand/omap2.c | 12 ++++++++++++
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
index bd283faf..2427df5f 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
@@ -1,7 +1,7 @@
1From 22a6c2c3d2dafd4084945472fbeed2a94893ddb4 Mon Sep 17 00:00:00 2001 1From 263890438c545107c50be16e628926531949c1fa Mon Sep 17 00:00:00 2001
2From: kishore kadiyala <kishore.kadiyala@ti.com> 2From: kishore kadiyala <kishore.kadiyala@ti.com>
3Date: Mon, 2 May 2011 11:10:38 +0000 3Date: Mon, 2 May 2011 11:10:38 +0000
4Subject: [PATCH 27/30] omap : nand : fix subpage ecc issue with prefetch 4Subject: [PATCH 27/31] omap : nand : fix subpage ecc issue with prefetch
5 5
6For prefetch engine, read and write got broken in commit '2c01946c'. 6For prefetch engine, read and write got broken in commit '2c01946c'.
7We never hit a scenario of not getting 'gpmc_prefetch_enable' 7We never hit a scenario of not getting 'gpmc_prefetch_enable'
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch
index 80b44aeb..bdbe1fea 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch
@@ -1,7 +1,7 @@
1From 7c2667ccc5741129830c0188b50c347e3cc4edd5 Mon Sep 17 00:00:00 2001 1From d83a600cbe0cfca8c8fd9f5566dd45166cc9e142 Mon Sep 17 00:00:00 2001
2From: Scott Ellis <scottellis.developer@gmail.com> 2From: Scott Ellis <scottellis.developer@gmail.com>
3Date: Sun, 23 Jan 2011 20:39:35 -0800 3Date: Sun, 23 Jan 2011 20:39:35 -0800
4Subject: [PATCH 28/30] OMAP: Overo: Add support for spidev 4Subject: [PATCH 28/31] OMAP: Overo: Add support for spidev
5 5
6--- 6---
7 arch/arm/mach-omap2/board-overo.c | 16 ++++++++++++++++ 7 arch/arm/mach-omap2/board-overo.c | 16 ++++++++++++++++
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch
index 30fba1bc..236865db 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch
@@ -1,7 +1,7 @@
1From e6b1af4def888530e5dfeaaf4338f248e9d0f677 Mon Sep 17 00:00:00 2001 1From 083250cd6541b75535707c1d416cfa3a45ad19a9 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Mon, 2 May 2011 16:14:34 -0700 3Date: Mon, 2 May 2011 16:14:34 -0700
4Subject: [PATCH 29/30] unionfs: Add support for unionfs 2.5.9 4Subject: [PATCH 29/31] unionfs: Add support for unionfs 2.5.9
5 5
6--- 6---
7 Documentation/filesystems/00-INDEX | 2 + 7 Documentation/filesystems/00-INDEX | 2 +
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch
index 67112a31..30010faa 100644
--- a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch
@@ -1,7 +1,7 @@
1From 9f9d70c4d1caf249ab36c656c5e89db91d7c981b Mon Sep 17 00:00:00 2001 1From ab3ce8260342b568029c051c5e526526696a27f6 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com> 2From: Steve Sakoman <steve@sakoman.com>
3Date: Mon, 23 May 2011 12:16:50 -0700 3Date: Mon, 23 May 2011 12:16:50 -0700
4Subject: [PATCH 30/30] omap: Change omap_device activate latency messages from pr_warning to pr_debug 4Subject: [PATCH 30/31] omap: Change omap_device activate latency messages from pr_warning to pr_debug
5 5
6Messages can be safely ignored, so reduce console noise 6Messages can be safely ignored, so reduce console noise
7 7
diff --git a/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch
new file mode 100644
index 00000000..c50db1b3
--- /dev/null
+++ b/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch
@@ -0,0 +1,105 @@
1From c79191ab97d2b006c59c7dce4bfcdce48d66ec03 Mon Sep 17 00:00:00 2001
2From: Steve Sakoman <steve@sakoman.com>
3Date: Tue, 24 May 2011 20:36:07 -0700
4Subject: [PATCH 31/31] omap: overo: Add opp init
5
6omap: overo: Add opp init
7
8Work in progress
9
10Signed-off-by: Steve Sakoman <steve@sakoman.com>
11---
12 arch/arm/mach-omap2/board-overo.c | 49 +++++++++++++++++++++++++++++++++++++
13 1 files changed, 49 insertions(+), 0 deletions(-)
14
15diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
16index 05dd3eb..8c2d21f 100644
17--- a/arch/arm/mach-omap2/board-overo.c
18+++ b/arch/arm/mach-omap2/board-overo.c
19@@ -25,6 +25,7 @@
20 #include <linux/init.h>
21 #include <linux/io.h>
22 #include <linux/kernel.h>
23+#include <linux/opp.h>
24 #include <linux/platform_device.h>
25 #include <linux/i2c/twl.h>
26 #include <linux/regulator/machine.h>
27@@ -43,6 +44,7 @@
28
29 #include <plat/board.h>
30 #include <plat/common.h>
31+#include <plat/omap_device.h>
32 #include <plat/display.h>
33 #include <plat/panel-generic-dpi.h>
34 #include <mach/gpio.h>
35@@ -54,6 +56,7 @@
36 #include <plat/usb.h>
37
38 #include "mux.h"
39+#include "pm.h"
40 #include "sdram-micron-mt46h32m32lf-6.h"
41 #include "hsmmc.h"
42
43@@ -755,6 +758,51 @@ static struct omap_musb_board_data musb_board_data = {
44 .power = 100,
45 };
46
47+static void __init overo_opp_init(void)
48+{
49+ int r = 0;
50+
51+ /* Initialize the omap3 opp table */
52+ if (omap3_opp_init()) {
53+ pr_err("%s: opp default init failed\n", __func__);
54+ return;
55+ }
56+
57+ /* Custom OPP enabled for 36/3730 */
58+ if (cpu_is_omap3630()) {
59+ struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
60+ struct omap_hwmod *dh = omap_hwmod_lookup("iva");
61+ struct device *dev;
62+
63+ if (!mh || !dh) {
64+ pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
65+ __func__, mh, dh);
66+ return;
67+ }
68+ /* Enable MPU 1GHz and lower opps */
69+ dev = &mh->od->pdev.dev;
70+ r = opp_enable(dev, 1000000000);
71+
72+ /* Enable IVA 800MHz and lower opps */
73+ dev = &dh->od->pdev.dev;
74+ r |= opp_enable(dev, 800000000);
75+
76+ if (r) {
77+ pr_err("%s: failed to enable higher opp %d\n",
78+ __func__, r);
79+ /*
80+ * Cleanup - disable the higher freqs - we dont care
81+ * about the results
82+ */
83+ dev = &mh->od->pdev.dev;
84+ opp_disable(dev, 1000000000);
85+ dev = &dh->od->pdev.dev;
86+ opp_disable(dev, 800000000);
87+ }
88+ }
89+ return;
90+}
91+
92 static void __init overo_init(void)
93 {
94 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
95@@ -770,6 +818,7 @@ static void __init overo_init(void)
96 overo_display_init();
97 overo_init_led();
98 overo_init_keys();
99+ overo_opp_init();
100
101 /* Ensure SDRC pins are mux'd for self-refresh */
102 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
103--
1041.6.6.1
105
diff --git a/recipes-kernel/linux/linux-omap_2.6.39.bb b/recipes-kernel/linux/linux-omap_2.6.39.bb
index db11bf91..25ad5b23 100644
--- a/recipes-kernel/linux/linux-omap_2.6.39.bb
+++ b/recipes-kernel/linux/linux-omap_2.6.39.bb
@@ -7,7 +7,7 @@ COMPATIBLE_MACHINE = "(beagleboard)"
7 7
8# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc 8# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
9SRCREV_pn-${PN} = "v2.6.39" 9SRCREV_pn-${PN} = "v2.6.39"
10MACHINE_KERNEL_PR_append = "d" 10MACHINE_KERNEL_PR_append = "e"
11 11
12FILESPATHPKG_prepend = "linux-omap-2.6.39:" 12FILESPATHPKG_prepend = "linux-omap-2.6.39:"
13 13
@@ -45,6 +45,7 @@ SRC_URI_append = " \
45 file://sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch \ 45 file://sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch \
46 file://sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch \ 46 file://sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch \
47 file://sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch \ 47 file://sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch \
48 file://sakoman/0031-omap-overo-Add-opp-init.patch \
48 \ 49 \
49 file://beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch \ 50 file://beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch \
50 file://beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch \ 51 file://beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch \
@@ -52,7 +53,10 @@ SRC_URI_append = " \
52 file://beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch \ 53 file://beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch \
53 file://beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch \ 54 file://beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch \
54 \ 55 \
55 file://camera/0001-Add-mt9p031-sensor-support.patch \ 56 file://camera/0001-Add-mt9p031-sensor-driver.patch \
57 file://camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch \
58 file://camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch \
59 file://camera/0004-v4l-Add-mt9v032-sensor-driver.patch \
56 \ 60 \
57 file://pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch \ 61 file://pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch \
58 file://pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch \ 62 file://pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch \