From 24513855be5e8d8f2b23236fee5587bd73333072 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 26 May 2011 16:22:08 +0200 Subject: linux-omap 2.6.39: sync with meta-texasinstruments Signed-off-by: Koen Kooi --- ...e-add-support-for-beagleboard-xM-revision.patch | 2 +- ...P3-beagle-add-support-for-expansionboards.patch | 2 +- .../0003-OMAP3-beagle-add-MADC-support.patch | 2 +- ...eagle-add-regulators-for-camera-interface.patch | 27 +- .../0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch | 6 +- .../linux/linux-omap-2.6.39/beagleboard/defconfig | 7 +- .../camera/0001-Add-mt9p031-sensor-driver.patch | 918 +++++++++++++++++++++ .../camera/0001-Add-mt9p031-sensor-support.patch | 917 -------------------- ...GLE-Add-support-for-mt9p031-sensor-driver.patch | 142 ++++ ...003-OMAP3-beagle-only-init-camera-on-3630.patch | 34 + .../0004-v4l-Add-mt9v032-sensor-driver.patch | 853 +++++++++++++++++++ .../0001-OMAP2-cpufreq-free-up-table-on-exit.patch | 2 +- ...MAP2-cpufreq-handle-invalid-cpufreq-table.patch | 2 +- .../0003-OMAP2-cpufreq-minor-comment-cleanup.patch | 2 +- ...eq-use-clk_init_cpufreq_table-if-OPPs-not.patch | 2 +- ...pufreq-use-cpufreq_frequency_table_target.patch | 2 +- .../0006-OMAP2-cpufreq-fix-freq_table-leak.patch | 2 +- ...q-helpers-for-walking-the-frequency-table.patch | 2 +- .../0002-cpufreq-introduce-hotplug-governor.patch | 2 +- ...q-ensure-driver-initializes-after-cpufreq.patch | 2 +- ...PUfreq-ensure-policy-is-fully-initialized.patch | 2 +- .../0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch | 2 +- ...AP-PM-CPUFREQ-Fix-conditional-compilation.patch | 2 +- ...-cpufreq-fixup-after-new-OPP-layer-merged.patch | 2 +- ...q-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch | 2 +- ...cpufreq-Add-SMP-support-to-cater-OMAP4430.patch | 2 +- ...pufreq-Fix-typo-when-attempting-to-set-mp.patch | 2 +- ...-clockdomain-Add-an-api-to-read-idle-mode.patch | 2 +- ...kdomain-Add-SoC-support-for-clkdm_is_idle.patch | 2 +- ...itialise-sleep_switch-to-a-non-valid-valu.patch | 2 +- ...P2-PM-idle-clkdms-only-if-already-in-idle.patch | 2 +- ...hwmod-Follow-the-recomended-PRCM-sequence.patch | 2 +- ...6-OMAP-Serial-Check-wk_st-only-if-present.patch | 2 +- ...age-remove-spurious-pr_notice-for-debugfs.patch | 2 +- ...OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch | 2 +- ...reflex-fix-sr_late_init-error-path-in-pro.patch | 2 +- ...AP3-smartreflex-request-the-memory-region.patch | 2 +- ...artreflex-fix-ioremap-leak-on-probe-error.patch | 2 +- ...reflex-delete-instance-from-sr_list-on-pr.patch | 2 +- ...reflex-delete-debugfs-entries-on-probe-er.patch | 2 +- ...uidle-remove-useless-SDP-specific-timings.patch | 2 +- ...OMAP3-SR-make-notify-independent-of-class.patch | 2 +- ...010-OMAP3-SR-disable-interrupt-by-default.patch | 2 +- ...1-OMAP3-SR-enable-disable-SR-only-on-need.patch | 2 +- .../0012-OMAP3-SR-fix-cosmetic-indentation.patch | 2 +- ...01-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch | 4 +- .../0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch | 4 +- ...SS2-Fix-Return-correct-lcd-clock-source-f.patch | 4 +- .../0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch | 4 +- ...-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch | 4 +- ...dd-bootarg-for-selecting-svideo-or-compos.patch | 4 +- .../sakoman/0007-video-add-timings-for-hd720.patch | 4 +- ...-smsc911x-return-ENODEV-if-device-is-not-.patch | 4 +- ...ut-touchscreen-ads7846-return-ENODEV-if-d.patch | 4 +- ...10-Revert-omap2_mcspi-Flush-posted-writes.patch | 4 +- ...p_hsmmc-improve-interrupt-synchronisation.patch | 4 +- ...SDIO-cards-off-to-save-power.-Doing-so-wi.patch | 4 +- ...13-Enable-the-use-of-SDIO-card-interrupts.patch | 4 +- ...Enable-audio-capture-by-default-for-twl40.patch | 4 +- ...odecs-twl4030-Turn-on-mic-bias-by-default.patch | 4 +- ...C-add-support-for-backup-battery-recharge.patch | 4 +- ...mc-twl4030-move-clock-input-selection-pri.patch | 4 +- ...wer-off-support-for-the-TWL4030-companion.patch | 4 +- ...RM-OMAP-Add-twl4030-madc-support-to-Overo.patch | 4 +- ...20-Enabling-Hwmon-driver-for-twl4030-madc.patch | 4 +- .../0021-mfd-twl-core-enable-madc-clock.patch | 4 +- ...0022-rtc-twl-Switch-to-using-threaded-irq.patch | 4 +- ...tomatically-set-musb-mode-in-platform-dat.patch | 4 +- ...mc-Adjust-dto-to-eliminate-timeout-errors.patch | 4 +- .../0025-omap-Fix-mtd-subpage-read-alignment.patch | 4 +- ...ap2-Force-all-buffer-reads-to-u32-alignme.patch | 4 +- ...-nand-fix-subpage-ecc-issue-with-prefetch.patch | 4 +- .../0028-OMAP-Overo-Add-support-for-spidev.patch | 4 +- ...029-unionfs-Add-support-for-unionfs-2.5.9.patch | 4 +- ...-omap_device-activate-latency-messages-fr.patch | 4 +- .../sakoman/0031-omap-overo-Add-opp-init.patch | 105 +++ 76 files changed, 2178 insertions(+), 1025 deletions(-) create mode 100644 recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch delete mode 100644 recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch create mode 100644 recipes/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch create mode 100644 recipes/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch create mode 100644 recipes/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch create mode 100644 recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch (limited to 'recipes/linux/linux-omap-2.6.39') diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch b/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch index 30063f9de5..2bd76c3cec 100644 --- a/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch +++ b/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch @@ -1,4 +1,4 @@ -From 2dd4bf287ad066e3d9e82c239782fb649c6f7fe7 Mon Sep 17 00:00:00 2001 +From 812ef26f4be80d12facd62adce971ec9fe64a144 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 20 May 2011 12:48:37 +0200 Subject: [PATCH 1/5] OMAP3: beagle: add support for beagleboard xM revision C diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch b/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch index f815a58ac4..ab63acf561 100644 --- a/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch +++ b/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch @@ -1,4 +1,4 @@ -From 258a21a495a9ba2238081cd473b4796cd61a60e7 Mon Sep 17 00:00:00 2001 +From e87dd8c997e212b8c14468c869c83d6953da3c34 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 20 May 2011 13:06:24 +0200 Subject: [PATCH 2/5] OMAP3: beagle: add support for expansionboards diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch b/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch index 0f5c0bd56c..7984a30ece 100644 --- a/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch +++ b/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch @@ -1,4 +1,4 @@ -From b6deb9a9c3a0c8b9afc981cbca20ff73fa7a8d8c Mon Sep 17 00:00:00 2001 +From 140a5cddce807e20e32a5ddcf7c00a758ff5016d Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sat, 21 May 2011 16:18:30 +0200 Subject: [PATCH 3/5] OMAP3: beagle: add MADC support diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch b/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch index 900502d2bb..29ebb401cf 100644 --- a/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch +++ b/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch @@ -1,15 +1,15 @@ -From 0ba8b335b9dd023784ef493b524d6335bfcd453a Mon Sep 17 00:00:00 2001 +From 482c65c01edad75e2b8a3fa07f0fc914e3c9b9d9 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 25 May 2011 08:56:06 +0200 Subject: [PATCH 4/5] OMAP3: beagle: add regulators for camera interface Signed-off-by: Koen Kooi --- - arch/arm/mach-omap2/board-omap3beagle.c | 40 +++++++++++++++++++++++++++++++ - 1 files changed, 40 insertions(+), 0 deletions(-) + arch/arm/mach-omap2/board-omap3beagle.c | 50 +++++++++++++++++++++++++++++++ + 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c -index da4ba50..52ea11a 100644 +index da4ba50..211cbdf 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -453,6 +453,44 @@ static struct regulator_consumer_supply beagle_vsim_supply = { @@ -57,7 +57,24 @@ index da4ba50..52ea11a 100644 static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { -@@ -651,6 +689,8 @@ static struct twl4030_platform_data beagle_twldata = { +@@ -504,6 +542,16 @@ static int beagle_twl_gpio_setup(struct device *dev, + pr_err("%s: unable to configure EHCI_nOC\n", __func__); + } + ++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { ++ /* ++ * Power on camera interface - only on pre-production, not ++ * needed on production boards ++ */ ++ gpio_request(gpio + 2, "CAM_EN"); ++ gpio_direction_output(gpio + 2, 1); ++ } ++ ++ + /* + * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active + * high / others active low) +@@ -651,6 +699,8 @@ static struct twl4030_platform_data beagle_twldata = { .vsim = &beagle_vsim, .vdac = &beagle_vdac, .vpll2 = &beagle_vpll2, diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch b/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch index a555c9319b..c0e31042ae 100644 --- a/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch +++ b/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch @@ -1,4 +1,4 @@ -From 5b0f364b7e017d422b01c0e3297d0b68119f95f0 Mon Sep 17 00:00:00 2001 +From 6654672586808d22510d06d54464f4fe32ae6e80 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 25 May 2011 08:57:40 +0200 Subject: [PATCH 5/5] OMAP3: beagle: HACK! add in 1GHz OPP @@ -9,10 +9,10 @@ Signed-off-by: Koen Kooi 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c -index 52ea11a..cf95173 100644 +index 211cbdf..221bfda 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c -@@ -901,11 +901,13 @@ static void __init beagle_opp_init(void) +@@ -911,11 +911,13 @@ static void __init beagle_opp_init(void) /* Enable MPU 1GHz and lower opps */ dev = &mh->od->pdev.dev; r = opp_enable(dev, 800000000); diff --git a/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig b/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig index e2502650e0..c2c9e55ae7 100644 --- a/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig +++ b/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux/arm 2.6.39 Kernel Configuration -# Wed May 25 09:25:56 2011 +# Thu May 26 10:49:51 2011 # CONFIG_ARM=y CONFIG_HAVE_PWM=y @@ -2041,8 +2041,9 @@ CONFIG_VIDEO_ADV7180=m # CONFIG_VIDEO_BT866 is not set # CONFIG_VIDEO_KS0127 is not set CONFIG_VIDEO_OV7670=m -CONFIG_VIDEO_MT9P031=m +CONFIG_VIDEO_MT9P031=y CONFIG_VIDEO_MT9V011=m +CONFIG_VIDEO_MT9V032=y # CONFIG_VIDEO_TCM825X is not set # CONFIG_VIDEO_SAA7110 is not set CONFIG_VIDEO_SAA711X=m @@ -2090,7 +2091,7 @@ CONFIG_VIDEO_TIMBERDALE=m CONFIG_VIDEO_SR030PC30=m CONFIG_VIDEO_NOON010PC30=m CONFIG_VIDEO_OMAP3=y -# CONFIG_VIDEO_OMAP3_DEBUG is not set +CONFIG_VIDEO_OMAP3_DEBUG=y # CONFIG_SOC_CAMERA is not set CONFIG_V4L_USB_DRIVERS=y CONFIG_USB_VIDEO_CLASS=m diff --git a/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch b/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch new file mode 100644 index 0000000000..9746415fdc --- /dev/null +++ b/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-driver.patch @@ -0,0 +1,918 @@ +From 327e65fc0d86911bda7c1f37fb5c3534d1b2c849 Mon Sep 17 00:00:00 2001 +From: Javier Martin +Date: Thu, 26 May 2011 07:20:53 +0000 +Subject: [PATCH 1/4] Add mt9p031 sensor driver. + +This patch applies on 2.6.39 (commit 61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf). +It has some power management issue which causes horizontal random lines on +the image. If we do not disable 1v8 regulator, the problem disappears. +I would like to get some help on fixing whatever the problem with power +management is. + +Signed-off-by: Javier Martin +--- + drivers/media/video/Kconfig | 7 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9p031.c | 841 +++++++++++++++++++++++++++++++++++++++++ + include/media/mt9p031.h | 11 + + 4 files changed, 860 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9p031.c + create mode 100644 include/media/mt9p031.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index 00f51dd..cb87e35 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -329,6 +329,13 @@ config VIDEO_OV7670 + OV7670 VGA camera. It currently only works with the M88ALP01 + controller. + ++config VIDEO_MT9P031 ++ tristate "Aptina MT9P031 support" ++ depends on I2C && VIDEO_V4L2 ++ ---help--- ++ This is a Video4Linux2 sensor-level driver for the Aptina ++ (Micron) mt9p031 5 Mpixel camera. ++ + config VIDEO_MT9V011 + tristate "Micron mt9v011 sensor support" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index ace5d8b..912b29b 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o + obj-$(CONFIG_VIDEO_OV7670) += ov7670.o + obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o + obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o ++obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o + obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o + obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o + obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o +diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c +new file mode 100644 +index 0000000..242bea9 +--- /dev/null ++++ b/drivers/media/video/mt9p031.c +@@ -0,0 +1,841 @@ ++/* ++ * Driver for MT9P031 CMOS Image Sensor from Aptina ++ * ++ * Copyright (C) 2011, Javier Martin ++ * ++ * Copyright (C) 2011, Guennadi Liakhovetski ++ * ++ * Based on the MT9V032 driver and Bastian Hecht's code. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#define MT9P031_PIXCLK_FREQ 54000000 ++ ++/* mt9p031 selected register addresses */ ++#define MT9P031_CHIP_VERSION 0x00 ++#define MT9P031_CHIP_VERSION_VALUE 0x1801 ++#define MT9P031_ROW_START 0x01 ++#define MT9P031_ROW_START_DEF 54 ++#define MT9P031_COLUMN_START 0x02 ++#define MT9P031_COLUMN_START_DEF 16 ++#define MT9P031_WINDOW_HEIGHT 0x03 ++#define MT9P031_WINDOW_WIDTH 0x04 ++#define MT9P031_H_BLANKING 0x05 ++#define MT9P031_H_BLANKING_VALUE 0 ++#define MT9P031_V_BLANKING 0x06 ++#define MT9P031_V_BLANKING_VALUE 25 ++#define MT9P031_OUTPUT_CONTROL 0x07 ++#define MT9P031_OUTPUT_CONTROL_CEN 2 ++#define MT9P031_OUTPUT_CONTROL_SYN 1 ++#define MT9P031_SHUTTER_WIDTH_UPPER 0x08 ++#define MT9P031_SHUTTER_WIDTH 0x09 ++#define MT9P031_PIXEL_CLOCK_CONTROL 0x0a ++#define MT9P031_FRAME_RESTART 0x0b ++#define MT9P031_SHUTTER_DELAY 0x0c ++#define MT9P031_RST 0x0d ++#define MT9P031_RST_ENABLE 1 ++#define MT9P031_RST_DISABLE 0 ++#define MT9P031_READ_MODE_1 0x1e ++#define MT9P031_READ_MODE_2 0x20 ++#define MT9P031_READ_MODE_2_ROW_MIR 0x8000 ++#define MT9P031_READ_MODE_2_COL_MIR 0x4000 ++#define MT9P031_ROW_ADDRESS_MODE 0x22 ++#define MT9P031_COLUMN_ADDRESS_MODE 0x23 ++#define MT9P031_GLOBAL_GAIN 0x35 ++ ++#define MT9P031_WINDOW_HEIGHT_MAX 1944 ++#define MT9P031_WINDOW_WIDTH_MAX 2592 ++#define MT9P031_WINDOW_HEIGHT_MIN 2 ++#define MT9P031_WINDOW_WIDTH_MIN 18 ++ ++struct mt9p031 { ++ struct v4l2_subdev subdev; ++ struct media_pad pad; ++ struct v4l2_rect rect; /* Sensor window */ ++ struct v4l2_mbus_framefmt format; ++ struct mt9p031_platform_data *pdata; ++ struct mutex power_lock; /* lock to protect power_count */ ++ int power_count; ++ u16 xskip; ++ u16 yskip; ++ /* cache register values */ ++ u16 output_control; ++ u16 h_blanking; ++ u16 v_blanking; ++ u16 column_address_mode; ++ u16 row_address_mode; ++ u16 column_start; ++ u16 row_start; ++ u16 window_width; ++ u16 window_height; ++ struct regulator *reg_1v8; ++ struct regulator *reg_2v8; ++}; ++ ++static struct mt9p031 *to_mt9p031(const struct i2c_client *client) ++{ ++ return container_of(i2c_get_clientdata(client), struct mt9p031, subdev); ++} ++ ++static int reg_read(struct i2c_client *client, const u8 reg) ++{ ++ s32 data = i2c_smbus_read_word_data(client, reg); ++ return data < 0 ? data : swab16(data); ++} ++ ++static int reg_write(struct i2c_client *client, const u8 reg, ++ const u16 data) ++{ ++ return i2c_smbus_write_word_data(client, reg, swab16(data)); ++} ++ ++static int reg_write_cached(struct i2c_client *client, const u8 reg, ++ const u16 data, u16 *cache) ++{ ++ int ret; ++ ++ ret = reg_write(client, reg, data); ++ if (ret < 0) ++ return ret; ++ *cache = data; ++ return 0; ++} ++ ++static int mt9p031_set_output_control(struct mt9p031 *mt9p031, u16 clear, ++ u16 set) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); ++ u16 value = (mt9p031->output_control & ~clear) | set; ++ ++ return reg_write_cached(client, MT9P031_OUTPUT_CONTROL, value, ++ &mt9p031->output_control); ++} ++ ++static int restore_registers(struct i2c_client *client) ++{ ++ int ret; ++ struct mt9p031 *mt9p031 = to_mt9p031(client); ++ ++ /* Disable register update, reconfigure atomically */ ++ ret = mt9p031_set_output_control(mt9p031, 0, ++ MT9P031_OUTPUT_CONTROL_SYN); ++ if (ret < 0) ++ return ret; ++ ++ /* Blanking and start values - default... */ ++ ret = reg_write(client, MT9P031_H_BLANKING, mt9p031->h_blanking); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_V_BLANKING, mt9p031->v_blanking); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_COLUMN_ADDRESS_MODE, ++ mt9p031->column_address_mode); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_ROW_ADDRESS_MODE, ++ mt9p031->row_address_mode); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_COLUMN_START, ++ mt9p031->column_start); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_ROW_START, ++ mt9p031->row_start); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_WINDOW_WIDTH, ++ mt9p031->window_width); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write(client, MT9P031_WINDOW_HEIGHT, ++ mt9p031->window_height); ++ if (ret < 0) ++ return ret; ++ ++ /* Re-enable register update, commit all changes */ ++ ret = mt9p031_set_output_control(mt9p031, ++ MT9P031_OUTPUT_CONTROL_SYN, 0); ++ if (ret < 0) ++ return ret; ++ return 0; ++} ++ ++static int mt9p031_reset(struct i2c_client *client) ++{ ++ struct mt9p031 *mt9p031 = to_mt9p031(client); ++ int ret; ++ ++ /* Disable chip output, synchronous option update */ ++ ret = reg_write(client, MT9P031_RST, MT9P031_RST_ENABLE); ++ if (ret < 0) ++ return ret; ++ ret = reg_write(client, MT9P031_RST, MT9P031_RST_DISABLE); ++ if (ret < 0) ++ return ret; ++ return mt9p031_set_output_control(mt9p031, ++ MT9P031_OUTPUT_CONTROL_CEN, 0); ++} ++ ++static int mt9p031_power_on(struct mt9p031 *mt9p031) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); ++ int ret; ++ ++ /* Ensure RESET_BAR is low */ ++ if (mt9p031->pdata->reset) ++ mt9p031->pdata->reset(&mt9p031->subdev, 1); ++ /* turn on digital supply first */ ++ ret = regulator_enable(mt9p031->reg_1v8); ++ if (ret) { ++ dev_err(&client->dev, ++ "Failed to enable 1.8v regulator: %d\n", ret); ++ goto err_1v8; ++ } ++ /* now turn on analog supply */ ++ ret = regulator_enable(mt9p031->reg_2v8); ++ if (ret) { ++ dev_err(&client->dev, ++ "Failed to enable 2.8v regulator: %d\n", ret); ++ goto err_rst; ++ } ++ /* Now RESET_BAR must be high */ ++ if (mt9p031->pdata->reset) ++ mt9p031->pdata->reset(&mt9p031->subdev, 0); ++ ++ if (mt9p031->pdata->set_xclk) ++ mt9p031->pdata->set_xclk(&mt9p031->subdev, MT9P031_PIXCLK_FREQ); ++ ++ /* soft reset */ ++ ret = mt9p031_reset(client); ++ if (ret < 0) { ++ dev_err(&client->dev, "Failed to reset the camera\n"); ++ goto err_rst; ++ } ++ ++ ret = restore_registers(client); ++ if (ret < 0) { ++ dev_err(&client->dev, "Failed to restore registers\n"); ++ goto err_rst; ++ } ++ ++ return 0; ++err_rst: ++ regulator_disable(mt9p031->reg_1v8); ++err_1v8: ++ return ret; ++ ++} ++ ++static void mt9p031_power_off(struct mt9p031 *mt9p031) ++{ ++ if (mt9p031->pdata->set_xclk) ++ mt9p031->pdata->set_xclk(&mt9p031->subdev, 0); ++ if (mt9p031->pdata->reset) ++ mt9p031->pdata->reset(&mt9p031->subdev, 1); ++ regulator_disable(mt9p031->reg_1v8); ++ regulator_disable(mt9p031->reg_2v8); ++} ++ ++static int mt9p031_enum_mbus_code(struct v4l2_subdev *sd, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ ++ if (code->pad || code->index) ++ return -EINVAL; ++ ++ code->code = mt9p031->format.code; ++ ++ return 0; ++} ++ ++static struct v4l2_mbus_framefmt *mt9p031_get_pad_format( ++ struct mt9p031 *mt9p031, ++ struct v4l2_subdev_fh *fh, ++ unsigned int pad, u32 which) ++{ ++ switch (which) { ++ case V4L2_SUBDEV_FORMAT_TRY: ++ return v4l2_subdev_get_try_format(fh, pad); ++ case V4L2_SUBDEV_FORMAT_ACTIVE: ++ return &mt9p031->format; ++ default: ++ return NULL; ++ } ++} ++ ++static struct v4l2_rect *mt9p031_get_pad_crop(struct mt9p031 *mt9p031, ++ struct v4l2_subdev_fh *fh, unsigned int pad, u32 which) ++{ ++ switch (which) { ++ case V4L2_SUBDEV_FORMAT_TRY: ++ return v4l2_subdev_get_try_crop(fh, pad); ++ case V4L2_SUBDEV_FORMAT_ACTIVE: ++ return &mt9p031->rect; ++ default: ++ return NULL; ++ } ++} ++ ++static int mt9p031_get_crop(struct v4l2_subdev *sd, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_crop *crop) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ struct v4l2_rect *rect = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, ++ crop->which); ++ if (!rect) ++ return -EINVAL; ++ ++ crop->rect = *rect; ++ ++ return 0; ++} ++ ++static u16 mt9p031_skip_for_crop(s32 source, s32 *target, s32 max_skip) ++{ ++ unsigned int skip; ++ ++ if (source - source / 4 < *target) { ++ *target = source; ++ return 1; ++ } ++ ++ skip = DIV_ROUND_CLOSEST(source, *target); ++ if (skip > max_skip) ++ skip = max_skip; ++ *target = 2 * DIV_ROUND_UP(source, 2 * skip); ++ ++ return skip; ++} ++ ++static int mt9p031_set_params(struct i2c_client *client, ++ struct v4l2_rect *rect, u16 xskip, u16 yskip) ++{ ++ struct mt9p031 *mt9p031 = to_mt9p031(client); ++ int ret; ++ u16 xbin, ybin; ++ const u16 hblank = MT9P031_H_BLANKING_VALUE, ++ vblank = MT9P031_V_BLANKING_VALUE; ++ __s32 left, top, width, height; ++ ++ /* ++ * TODO: Attention! When implementing horizontal flipping, adjust ++ * alignment according to R2 "Column Start" description in the datasheet ++ */ ++ if (xskip & 1) { ++ xbin = 1; ++ left = rect->left & (~3); ++ } else if (xskip & 2) { ++ xbin = 2; ++ left = rect->left & (~7); ++ } else { ++ xbin = 4; ++ left = rect->left & (~15); ++ } ++ top = rect->top & (~1); ++ width = rect->width; ++ height = rect->height; ++ ++ ybin = min(yskip, (u16)4); ++ ++ /* Disable register update, reconfigure atomically */ ++ ret = mt9p031_set_output_control(mt9p031, 0, ++ MT9P031_OUTPUT_CONTROL_SYN); ++ if (ret < 0) ++ return ret; ++ ++ dev_dbg(&client->dev, "skip %u:%u, rect %ux%u@%u:%u\n", ++ xskip, yskip, rect->width, rect->height, rect->left, rect->top); ++ ++ /* Blanking and start values - default... */ ++ ret = reg_write_cached(client, MT9P031_H_BLANKING, hblank, ++ &mt9p031->h_blanking); ++ if (ret < 0) ++ return ret; ++ ret = reg_write_cached(client, MT9P031_V_BLANKING, vblank, ++ &mt9p031->v_blanking); ++ if (ret < 0) ++ return ret; ++ ++ ret = reg_write_cached(client, MT9P031_COLUMN_ADDRESS_MODE, ++ ((xbin - 1) << 4) | (xskip - 1), ++ &mt9p031->column_address_mode); ++ if (ret < 0) ++ return ret; ++ ret = reg_write_cached(client, MT9P031_ROW_ADDRESS_MODE, ++ ((ybin - 1) << 4) | (yskip - 1), ++ &mt9p031->row_address_mode); ++ if (ret < 0) ++ return ret; ++ ++ dev_dbg(&client->dev, "new physical left %u, top %u\n", ++ rect->left, rect->top); ++ ++ ret = reg_write_cached(client, MT9P031_COLUMN_START, ++ rect->left + MT9P031_COLUMN_START_DEF, ++ &mt9p031->column_start); ++ if (ret < 0) ++ return ret; ++ ret = reg_write_cached(client, MT9P031_ROW_START, ++ rect->top + MT9P031_ROW_START_DEF, ++ &mt9p031->row_start); ++ if (ret < 0) ++ return ret; ++ ret = reg_write_cached(client, MT9P031_WINDOW_WIDTH, ++ rect->width - 1, ++ &mt9p031->window_width); ++ if (ret < 0) ++ return ret; ++ ret = reg_write_cached(client, MT9P031_WINDOW_HEIGHT, ++ rect->height - 1, ++ &mt9p031->window_height); ++ if (ret < 0) ++ return ret; ++ ++ /* Re-enable register update, commit all changes */ ++ ret = mt9p031_set_output_control(mt9p031, ++ MT9P031_OUTPUT_CONTROL_SYN, 0); ++ if (ret < 0) ++ return ret; ++ ++ mt9p031->xskip = xskip; ++ mt9p031->yskip = yskip; ++ return ret; ++} ++ ++static int mt9p031_set_crop(struct v4l2_subdev *sd, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_crop *crop) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ struct v4l2_mbus_framefmt *f; ++ struct v4l2_rect *c; ++ struct v4l2_rect rect; ++ u16 xskip, yskip; ++ s32 width, height; ++ ++ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u@%u:%u : %u)\n", ++ __func__, crop->rect.width, crop->rect.height, ++ crop->rect.left, crop->rect.top, crop->which); ++ ++ /* ++ * Clamp the crop rectangle boundaries and align them to a multiple of 2 ++ * pixels. ++ */ ++ rect.width = ALIGN(clamp(crop->rect.width, ++ MT9P031_WINDOW_WIDTH_MIN, MT9P031_WINDOW_WIDTH_MAX), 2); ++ rect.height = ALIGN(clamp(crop->rect.height, ++ MT9P031_WINDOW_HEIGHT_MIN, MT9P031_WINDOW_HEIGHT_MAX), 2); ++ rect.left = ALIGN(clamp(crop->rect.left, ++ 0, MT9P031_WINDOW_WIDTH_MAX - rect.width), 2); ++ rect.top = ALIGN(clamp(crop->rect.top, ++ 0, MT9P031_WINDOW_HEIGHT_MAX - rect.height), 2); ++ ++ c = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, crop->which); ++ ++ if (rect.width != c->width || rect.height != c->height) { ++ /* ++ * Reset the output image size if the crop rectangle size has ++ * been modified. ++ */ ++ f = mt9p031_get_pad_format(mt9p031, fh, crop->pad, ++ crop->which); ++ width = f->width; ++ height = f->height; ++ ++ xskip = mt9p031_skip_for_crop(rect.width, &width, 7); ++ yskip = mt9p031_skip_for_crop(rect.height, &height, 8); ++ } else { ++ xskip = mt9p031->xskip; ++ yskip = mt9p031->yskip; ++ f = NULL; ++ } ++ if (f) { ++ f->width = width; ++ f->height = height; ++ } ++ ++ *c = rect; ++ crop->rect = rect; ++ ++ mt9p031->xskip = xskip; ++ mt9p031->yskip = yskip; ++ mt9p031->rect = *c; ++ return 0; ++} ++ ++static int mt9p031_get_format(struct v4l2_subdev *sd, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ ++ fmt->format = ++ *mt9p031_get_pad_format(mt9p031, fh, fmt->pad, fmt->which); ++ return 0; ++} ++ ++static u16 mt9p031_skip_for_scale(s32 *source, s32 target, ++ s32 max_skip, s32 max) ++{ ++ unsigned int skip; ++ ++ if (*source - *source / 4 < target) { ++ *source = target; ++ return 1; ++ } ++ ++ skip = min(max, *source + target / 2) / target; ++ if (skip > max_skip) ++ skip = max_skip; ++ *source = target * skip; ++ ++ return skip; ++} ++ ++static int mt9p031_fmt_validate(struct v4l2_subdev *sd, ++ struct v4l2_subdev_format *fmt) ++{ ++ struct v4l2_mbus_framefmt *format = &fmt->format; ++ ++ /* Hardcode code and colorspace as sensor only supports one */ ++ format->code = V4L2_MBUS_FMT_SGRBG12_1X12; ++ format->colorspace = V4L2_COLORSPACE_SRGB; ++ ++ format->width = clamp_t(int, ALIGN(format->width, 2), 2, ++ MT9P031_WINDOW_WIDTH_MAX); ++ format->height = clamp_t(int, ALIGN(format->height, 2), 2, ++ MT9P031_WINDOW_HEIGHT_MAX); ++ format->field = V4L2_FIELD_NONE; ++ ++ return 0; ++} ++ ++static int mt9p031_set_format(struct v4l2_subdev *sd, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_format *format) ++{ ++ struct v4l2_subdev_format sdf = *format; ++ struct v4l2_mbus_framefmt *__format, *format_bak = &sdf.format; ++ struct v4l2_rect *__crop, rect; ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ u16 xskip, yskip; ++ int ret; ++ ++ __crop = mt9p031_get_pad_crop(mt9p031, fh, format->pad, format->which); ++ ++ ret = mt9p031_fmt_validate(sd, &sdf); ++ if (ret < 0) ++ return ret; ++ rect.width = __crop->width; ++ rect.height = __crop->height; ++ ++ xskip = mt9p031_skip_for_scale(&rect.width, format_bak->width, 7, ++ MT9P031_WINDOW_WIDTH_MAX); ++ if (rect.width + __crop->left > MT9P031_WINDOW_WIDTH_MAX) ++ rect.left = (MT9P031_WINDOW_WIDTH_MAX - rect.width) / 2; ++ else ++ rect.left = __crop->left; ++ yskip = mt9p031_skip_for_scale(&rect.height, format_bak->height, 8, ++ MT9P031_WINDOW_HEIGHT_MAX); ++ if (rect.height + __crop->top > MT9P031_WINDOW_HEIGHT_MAX) ++ rect.top = (MT9P031_WINDOW_HEIGHT_MAX - rect.height) / 2; ++ else ++ rect.top = __crop->top; ++ ++ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u : %u)\n", __func__, ++ format_bak->width, format_bak->height, format->which); ++ if (__crop) ++ *__crop = rect; ++ ++ __format = mt9p031_get_pad_format(mt9p031, fh, format->pad, format->which); ++ *__format = *format_bak; ++ format->format = *format_bak; ++ ++ mt9p031->xskip = xskip; ++ mt9p031->yskip = yskip; ++ mt9p031->rect = *__crop; ++ return 0; ++} ++ ++static int mt9p031_s_stream(struct v4l2_subdev *sd, int enable) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); ++ struct v4l2_rect rect = mt9p031->rect; ++ u16 xskip = mt9p031->xskip; ++ u16 yskip = mt9p031->yskip; ++ int ret; ++ ++ if (enable) { ++ ret = mt9p031_set_params(client, &rect, xskip, yskip); ++ if (ret < 0) ++ return ret; ++ /* Switch to master "normal" mode */ ++ ret = mt9p031_set_output_control(mt9p031, 0, ++ MT9P031_OUTPUT_CONTROL_CEN); ++ } else { ++ /* Stop sensor readout */ ++ ret = mt9p031_set_output_control(mt9p031, ++ MT9P031_OUTPUT_CONTROL_CEN, 0); ++ } ++ return ret; ++} ++ ++static int mt9p031_video_probe(struct i2c_client *client) ++{ ++ s32 data; ++ ++ /* Read out the chip version register */ ++ data = reg_read(client, MT9P031_CHIP_VERSION); ++ if (data != MT9P031_CHIP_VERSION_VALUE) { ++ dev_err(&client->dev, ++ "No MT9P031 chip detected, register read %x\n", data); ++ return -ENODEV; ++ } ++ ++ dev_info(&client->dev, "Detected a MT9P031 chip ID %x\n", data); ++ ++ return 0; ++} ++ ++static int mt9p031_set_power(struct v4l2_subdev *sd, int on) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ int ret = 0; ++ ++ mutex_lock(&mt9p031->power_lock); ++ ++ /* ++ * If the power count is modified from 0 to != 0 or from != 0 to 0, ++ * update the power state. ++ */ ++ if (mt9p031->power_count == !on) { ++ if (on) { ++ ret = mt9p031_power_on(mt9p031); ++ if (ret) { ++ dev_err(mt9p031->subdev.v4l2_dev->dev, ++ "Failed to enable 2.8v regulator: %d\n", ret); ++ goto out; ++ } ++ } else { ++ mt9p031_power_off(mt9p031); ++ } ++ } ++ ++ /* Update the power count. */ ++ mt9p031->power_count += on ? 1 : -1; ++ WARN_ON(mt9p031->power_count < 0); ++ ++out: ++ mutex_unlock(&mt9p031->power_lock); ++ return ret; ++} ++ ++static int mt9p031_registered(struct v4l2_subdev *sd) ++{ ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); ++ int ret; ++ ++ ret = mt9p031_set_power(&mt9p031->subdev, 1); ++ if (ret) { ++ dev_err(&client->dev, ++ "Failed to power on device: %d\n", ret); ++ goto err_pwron; ++ } ++ ++ ret = mt9p031_video_probe(client); ++ if (ret) ++ goto err_evprobe; ++ ++ mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE; ++ ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0); ++ if (ret) ++ goto err_evprobe; ++ ++ mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; ++ mt9p031_set_power(&mt9p031->subdev, 0); ++ ++ return 0; ++err_evprobe: ++ mt9p031_set_power(&mt9p031->subdev, 0); ++err_pwron: ++ return ret; ++} ++ ++static int mt9p031_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ struct mt9p031 *mt9p031; ++ mt9p031 = container_of(sd, struct mt9p031, subdev); ++ ++ mt9p031->rect.width = MT9P031_WINDOW_WIDTH_MAX; ++ mt9p031->rect.height = MT9P031_WINDOW_HEIGHT_MAX; ++ mt9p031->rect.left = MT9P031_COLUMN_START_DEF; ++ mt9p031->rect.top = MT9P031_ROW_START_DEF; ++ ++ mt9p031->format.code = V4L2_MBUS_FMT_SGRBG12_1X12; ++ mt9p031->format.width = MT9P031_WINDOW_WIDTH_MAX; ++ mt9p031->format.height = MT9P031_WINDOW_HEIGHT_MAX; ++ mt9p031->format.field = V4L2_FIELD_NONE; ++ mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB; ++ ++ mt9p031->xskip = 1; ++ mt9p031->yskip = 1; ++ return mt9p031_set_power(sd, 1); ++} ++ ++static int mt9p031_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) ++{ ++ return mt9p031_set_power(sd, 0); ++} ++ ++static struct v4l2_subdev_core_ops mt9p031_subdev_core_ops = { ++ .s_power = mt9p031_set_power, ++}; ++ ++static struct v4l2_subdev_video_ops mt9p031_subdev_video_ops = { ++ .s_stream = mt9p031_s_stream, ++}; ++ ++static struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = { ++ .enum_mbus_code = mt9p031_enum_mbus_code, ++ .get_fmt = mt9p031_get_format, ++ .set_fmt = mt9p031_set_format, ++ .get_crop = mt9p031_get_crop, ++ .set_crop = mt9p031_set_crop, ++}; ++ ++static struct v4l2_subdev_ops mt9p031_subdev_ops = { ++ .core = &mt9p031_subdev_core_ops, ++ .video = &mt9p031_subdev_video_ops, ++ .pad = &mt9p031_subdev_pad_ops, ++}; ++ ++static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = { ++ .registered = mt9p031_registered, ++ .open = mt9p031_open, ++ .close = mt9p031_close, ++}; ++ ++static int mt9p031_probe(struct i2c_client *client, ++ const struct i2c_device_id *did) ++{ ++ struct mt9p031 *mt9p031; ++ struct mt9p031_platform_data *pdata = client->dev.platform_data; ++ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); ++ int ret; ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { ++ dev_warn(&adapter->dev, ++ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n"); ++ return -EIO; ++ } ++ ++ mt9p031 = kzalloc(sizeof(struct mt9p031), GFP_KERNEL); ++ if (!mt9p031) ++ return -ENOMEM; ++ ++ mutex_init(&mt9p031->power_lock); ++ v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops); ++ mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops; ++ ++ mt9p031->pdata = pdata; ++ ++ mt9p031->reg_1v8 = regulator_get(NULL, "cam_1v8"); ++ if (IS_ERR(mt9p031->reg_1v8)) { ++ ret = PTR_ERR(mt9p031->reg_1v8); ++ dev_err(mt9p031->subdev.v4l2_dev->dev, ++ "Failed 1.8v regulator: %d\n", ret); ++ goto err_e1v8; ++ } ++ ++ mt9p031->reg_2v8 = regulator_get(NULL, "cam_2v8"); ++ if (IS_ERR(mt9p031->reg_2v8)) { ++ ret = PTR_ERR(mt9p031->reg_2v8); ++ dev_err(mt9p031->subdev.v4l2_dev->dev, ++ "Failed 2.8v regulator: %d\n", ret); ++ goto err_e2v8; ++ } ++ return 0; ++err_e2v8: ++ regulator_put(mt9p031->reg_1v8); ++err_e1v8: ++ kfree(mt9p031); ++ return ret; ++} ++ ++static int mt9p031_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *sd = i2c_get_clientdata(client); ++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); ++ ++ v4l2_device_unregister_subdev(sd); ++ media_entity_cleanup(&sd->entity); ++ regulator_put(mt9p031->reg_2v8); ++ regulator_put(mt9p031->reg_1v8); ++ kfree(mt9p031); ++ ++ return 0; ++} ++ ++static const struct i2c_device_id mt9p031_id[] = { ++ { "mt9p031", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, mt9p031_id); ++ ++static struct i2c_driver mt9p031_i2c_driver = { ++ .driver = { ++ .name = "mt9p031", ++ }, ++ .probe = mt9p031_probe, ++ .remove = mt9p031_remove, ++ .id_table = mt9p031_id, ++}; ++ ++static int __init mt9p031_mod_init(void) ++{ ++ return i2c_add_driver(&mt9p031_i2c_driver); ++} ++ ++static void __exit mt9p031_mod_exit(void) ++{ ++ i2c_del_driver(&mt9p031_i2c_driver); ++} ++ ++module_init(mt9p031_mod_init); ++module_exit(mt9p031_mod_exit); ++ ++MODULE_DESCRIPTION("Aptina MT9P031 Camera driver"); ++MODULE_AUTHOR("Bastian Hecht "); ++MODULE_LICENSE("GPL v2"); +diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h +new file mode 100644 +index 0000000..7ee9733 +--- /dev/null ++++ b/include/media/mt9p031.h +@@ -0,0 +1,11 @@ ++#ifndef MT9P031_H ++#define MT9P031_H ++ ++struct v4l2_subdev; ++ ++struct mt9p031_platform_data { ++ int (*set_xclk)(struct v4l2_subdev *subdev, int hz); ++ int (*reset)(struct v4l2_subdev *subdev, int active); ++}; ++ ++#endif +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch b/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch deleted file mode 100644 index 2d7ee7ae89..0000000000 --- a/recipes/linux/linux-omap-2.6.39/camera/0001-Add-mt9p031-sensor-support.patch +++ /dev/null @@ -1,917 +0,0 @@ -From 69f7b0ee14f046e469d616611ee87836e04219b4 Mon Sep 17 00:00:00 2001 -From: Javier Martin -Date: Tue, 24 May 2011 16:30:43 +0200 -Subject: [PATCH] Add mt9p031 sensor support. - -This RFC includes a power management implementation that causes -the sensor to show images with horizontal artifacts (usually -monochrome lines that appear on the image randomly). - -Signed-off-by: Javier Martin -Signed-off-by: Koen Kooi ---- - drivers/media/video/Kconfig | 7 + - drivers/media/video/Makefile | 1 + - drivers/media/video/mt9p031.c | 841 +++++++++++++++++++++++++++++++++++++++++ - include/media/mt9p031.h | 11 + - 4 files changed, 860 insertions(+), 0 deletions(-) - create mode 100644 drivers/media/video/mt9p031.c - create mode 100644 include/media/mt9p031.h - -diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig -index 00f51dd..8a596cc 100644 ---- a/drivers/media/video/Kconfig -+++ b/drivers/media/video/Kconfig -@@ -329,6 +329,13 @@ config VIDEO_OV7670 - OV7670 VGA camera. It currently only works with the M88ALP01 - controller. - -+config VIDEO_MT9P031 -+ tristate "Aptina MT9P031 support" -+ depends on I2C && VIDEO_V4L2 -+ ---help--- -+ This is a Video4Linux2 sensor-level driver for the Aptina -+ (Micron) mt9p031 5 Mpixel camera. -+ - config VIDEO_MT9V011 - tristate "Micron mt9v011 sensor support" - depends on I2C && VIDEO_V4L2 -diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile -index ace5d8b..912b29b 100644 ---- a/drivers/media/video/Makefile -+++ b/drivers/media/video/Makefile -@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o - obj-$(CONFIG_VIDEO_OV7670) += ov7670.o - obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o - obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o -+obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o - obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o - obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o - obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o -diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c -new file mode 100644 -index 0000000..04d8812 ---- /dev/null -+++ b/drivers/media/video/mt9p031.c -@@ -0,0 +1,841 @@ -+/* -+ * Driver for MT9P031 CMOS Image Sensor from Aptina -+ * -+ * Copyright (C) 2011, Javier Martin -+ * -+ * Copyright (C) 2011, Guennadi Liakhovetski -+ * -+ * Based on the MT9V032 driver and Bastian Hecht's code. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#define MT9P031_PIXCLK_FREQ 54000000 -+ -+/* mt9p031 selected register addresses */ -+#define MT9P031_CHIP_VERSION 0x00 -+#define MT9P031_CHIP_VERSION_VALUE 0x1801 -+#define MT9P031_ROW_START 0x01 -+#define MT9P031_ROW_START_DEF 54 -+#define MT9P031_COLUMN_START 0x02 -+#define MT9P031_COLUMN_START_DEF 16 -+#define MT9P031_WINDOW_HEIGHT 0x03 -+#define MT9P031_WINDOW_WIDTH 0x04 -+#define MT9P031_H_BLANKING 0x05 -+#define MT9P031_H_BLANKING_VALUE 0 -+#define MT9P031_V_BLANKING 0x06 -+#define MT9P031_V_BLANKING_VALUE 25 -+#define MT9P031_OUTPUT_CONTROL 0x07 -+#define MT9P031_OUTPUT_CONTROL_CEN 2 -+#define MT9P031_OUTPUT_CONTROL_SYN 1 -+#define MT9P031_SHUTTER_WIDTH_UPPER 0x08 -+#define MT9P031_SHUTTER_WIDTH 0x09 -+#define MT9P031_PIXEL_CLOCK_CONTROL 0x0a -+#define MT9P031_FRAME_RESTART 0x0b -+#define MT9P031_SHUTTER_DELAY 0x0c -+#define MT9P031_RST 0x0d -+#define MT9P031_RST_ENABLE 1 -+#define MT9P031_RST_DISABLE 0 -+#define MT9P031_READ_MODE_1 0x1e -+#define MT9P031_READ_MODE_2 0x20 -+#define MT9P031_READ_MODE_2_ROW_MIR 0x8000 -+#define MT9P031_READ_MODE_2_COL_MIR 0x4000 -+#define MT9P031_ROW_ADDRESS_MODE 0x22 -+#define MT9P031_COLUMN_ADDRESS_MODE 0x23 -+#define MT9P031_GLOBAL_GAIN 0x35 -+ -+#define MT9P031_WINDOW_HEIGHT_MAX 1944 -+#define MT9P031_WINDOW_WIDTH_MAX 2592 -+#define MT9P031_WINDOW_HEIGHT_MIN 2 -+#define MT9P031_WINDOW_WIDTH_MIN 18 -+ -+struct mt9p031 { -+ struct v4l2_subdev subdev; -+ struct media_pad pad; -+ struct v4l2_rect rect; /* Sensor window */ -+ struct v4l2_mbus_framefmt format; -+ struct mt9p031_platform_data *pdata; -+ struct mutex power_lock; /* lock to protect power_count */ -+ int power_count; -+ u16 xskip; -+ u16 yskip; -+ /* cache register values */ -+ u16 output_control; -+ u16 h_blanking; -+ u16 v_blanking; -+ u16 column_address_mode; -+ u16 row_address_mode; -+ u16 column_start; -+ u16 row_start; -+ u16 window_width; -+ u16 window_height; -+ struct regulator *reg_1v8; -+ struct regulator *reg_2v8; -+}; -+ -+static struct mt9p031 *to_mt9p031(const struct i2c_client *client) -+{ -+ return container_of(i2c_get_clientdata(client), struct mt9p031, subdev); -+} -+ -+static int reg_read(struct i2c_client *client, const u8 reg) -+{ -+ s32 data = i2c_smbus_read_word_data(client, reg); -+ return data < 0 ? data : swab16(data); -+} -+ -+static int reg_write(struct i2c_client *client, const u8 reg, -+ const u16 data) -+{ -+ return i2c_smbus_write_word_data(client, reg, swab16(data)); -+} -+ -+static int reg_write_cached(struct i2c_client *client, const u8 reg, -+ const u16 data, u16 *cache) -+{ -+ int ret; -+ -+ ret = reg_write(client, reg, data); -+ if (ret < 0) -+ return ret; -+ *cache = data; -+ return 0; -+} -+ -+static int mt9p031_set_output_control(struct mt9p031 *mt9p031, u16 clear, -+ u16 set) -+{ -+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); -+ u16 value = (mt9p031->output_control & ~clear) | set; -+ -+ return reg_write_cached(client, MT9P031_OUTPUT_CONTROL, value, -+ &mt9p031->output_control); -+} -+ -+static int restore_registers(struct i2c_client *client) -+{ -+ int ret; -+ struct mt9p031 *mt9p031 = to_mt9p031(client); -+ -+ /* Disable register update, reconfigure atomically */ -+ ret = mt9p031_set_output_control(mt9p031, 0, -+ MT9P031_OUTPUT_CONTROL_SYN); -+ if (ret < 0) -+ return ret; -+ -+ /* Blanking and start values - default... */ -+ ret = reg_write(client, MT9P031_H_BLANKING, mt9p031->h_blanking); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_V_BLANKING, mt9p031->v_blanking); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_COLUMN_ADDRESS_MODE, -+ mt9p031->column_address_mode); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_ROW_ADDRESS_MODE, -+ mt9p031->row_address_mode); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_COLUMN_START, -+ mt9p031->column_start); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_ROW_START, -+ mt9p031->row_start); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_WINDOW_WIDTH, -+ mt9p031->window_width); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write(client, MT9P031_WINDOW_HEIGHT, -+ mt9p031->window_height); -+ if (ret < 0) -+ return ret; -+ -+ /* Re-enable register update, commit all changes */ -+ ret = mt9p031_set_output_control(mt9p031, -+ MT9P031_OUTPUT_CONTROL_SYN, 0); -+ if (ret < 0) -+ return ret; -+ return 0; -+} -+ -+static int mt9p031_reset(struct i2c_client *client) -+{ -+ struct mt9p031 *mt9p031 = to_mt9p031(client); -+ int ret; -+ -+ /* Disable chip output, synchronous option update */ -+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_ENABLE); -+ if (ret < 0) -+ return ret; -+ ret = reg_write(client, MT9P031_RST, MT9P031_RST_DISABLE); -+ if (ret < 0) -+ return ret; -+ return mt9p031_set_output_control(mt9p031, -+ MT9P031_OUTPUT_CONTROL_CEN, 0); -+} -+ -+static int mt9p031_power_on(struct mt9p031 *mt9p031) -+{ -+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); -+ int ret; -+ -+ /* Ensure RESET_BAR is low */ -+ if (mt9p031->pdata->reset) -+ mt9p031->pdata->reset(&mt9p031->subdev, 1); -+ /* turn on digital supply first */ -+ ret = regulator_enable(mt9p031->reg_1v8); -+ if (ret) { -+ dev_err(&client->dev, -+ "Failed to enable 1.8v regulator: %d\n", ret); -+ goto err_1v8; -+ } -+ /* now turn on analog supply */ -+ ret = regulator_enable(mt9p031->reg_2v8); -+ if (ret) { -+ dev_err(&client->dev, -+ "Failed to enable 2.8v regulator: %d\n", ret); -+ goto err_rst; -+ } -+ /* Now RESET_BAR must be high */ -+ if (mt9p031->pdata->reset) -+ mt9p031->pdata->reset(&mt9p031->subdev, 0); -+ -+ if (mt9p031->pdata->set_xclk) -+ mt9p031->pdata->set_xclk(&mt9p031->subdev, MT9P031_PIXCLK_FREQ); -+ -+ /* soft reset */ -+ ret = mt9p031_reset(client); -+ if (ret < 0) { -+ dev_err(&client->dev, "Failed to reset the camera\n"); -+ goto err_rst; -+ } -+ -+ ret = restore_registers(client); -+ if (ret < 0) { -+ dev_err(&client->dev, "Failed to restore registers\n"); -+ goto err_rst; -+ } -+ -+ return 0; -+err_rst: -+ regulator_disable(mt9p031->reg_1v8); -+err_1v8: -+ return ret; -+ -+} -+ -+static void mt9p031_power_off(struct mt9p031 *mt9p031) -+{ -+ if (mt9p031->pdata->set_xclk) -+ mt9p031->pdata->set_xclk(&mt9p031->subdev, 0); -+ if (mt9p031->pdata->reset) -+ mt9p031->pdata->reset(&mt9p031->subdev, 1); -+ regulator_disable(mt9p031->reg_1v8); -+ regulator_disable(mt9p031->reg_2v8); -+} -+ -+static int mt9p031_enum_mbus_code(struct v4l2_subdev *sd, -+ struct v4l2_subdev_fh *fh, -+ struct v4l2_subdev_mbus_code_enum *code) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ -+ if (code->pad || code->index) -+ return -EINVAL; -+ -+ code->code = mt9p031->format.code; -+ -+ return 0; -+} -+ -+static struct v4l2_mbus_framefmt *mt9p031_get_pad_format( -+ struct mt9p031 *mt9p031, -+ struct v4l2_subdev_fh *fh, -+ unsigned int pad, u32 which) -+{ -+ switch (which) { -+ case V4L2_SUBDEV_FORMAT_TRY: -+ return v4l2_subdev_get_try_format(fh, pad); -+ case V4L2_SUBDEV_FORMAT_ACTIVE: -+ return &mt9p031->format; -+ default: -+ return NULL; -+ } -+} -+ -+static struct v4l2_rect *mt9p031_get_pad_crop(struct mt9p031 *mt9p031, -+ struct v4l2_subdev_fh *fh, unsigned int pad, u32 which) -+{ -+ switch (which) { -+ case V4L2_SUBDEV_FORMAT_TRY: -+ return v4l2_subdev_get_try_crop(fh, pad); -+ case V4L2_SUBDEV_FORMAT_ACTIVE: -+ return &mt9p031->rect; -+ default: -+ return NULL; -+ } -+} -+ -+static int mt9p031_get_crop(struct v4l2_subdev *sd, -+ struct v4l2_subdev_fh *fh, -+ struct v4l2_subdev_crop *crop) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ struct v4l2_rect *rect = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, -+ crop->which); -+ if (!rect) -+ return -EINVAL; -+ -+ crop->rect = *rect; -+ -+ return 0; -+} -+ -+static u16 mt9p031_skip_for_crop(s32 source, s32 *target, s32 max_skip) -+{ -+ unsigned int skip; -+ -+ if (source - source / 4 < *target) { -+ *target = source; -+ return 1; -+ } -+ -+ skip = DIV_ROUND_CLOSEST(source, *target); -+ if (skip > max_skip) -+ skip = max_skip; -+ *target = 2 * DIV_ROUND_UP(source, 2 * skip); -+ -+ return skip; -+} -+ -+static int mt9p031_set_params(struct i2c_client *client, -+ struct v4l2_rect *rect, u16 xskip, u16 yskip) -+{ -+ struct mt9p031 *mt9p031 = to_mt9p031(client); -+ int ret; -+ u16 xbin, ybin; -+ const u16 hblank = MT9P031_H_BLANKING_VALUE, -+ vblank = MT9P031_V_BLANKING_VALUE; -+ __s32 left, top, width, height; -+ -+ /* -+ * TODO: Attention! When implementing horizontal flipping, adjust -+ * alignment according to R2 "Column Start" description in the datasheet -+ */ -+ if (xskip & 1) { -+ xbin = 1; -+ left = rect->left & (~3); -+ } else if (xskip & 2) { -+ xbin = 2; -+ left = rect->left & (~7); -+ } else { -+ xbin = 4; -+ left = rect->left & (~15); -+ } -+ top = rect->top & (~1); -+ width = rect->width; -+ height = rect->height; -+ -+ ybin = min(yskip, (u16)4); -+ -+ /* Disable register update, reconfigure atomically */ -+ ret = mt9p031_set_output_control(mt9p031, 0, -+ MT9P031_OUTPUT_CONTROL_SYN); -+ if (ret < 0) -+ return ret; -+ -+ dev_dbg(&client->dev, "skip %u:%u, rect %ux%u@%u:%u\n", -+ xskip, yskip, rect->width, rect->height, rect->left, rect->top); -+ -+ /* Blanking and start values - default... */ -+ ret = reg_write_cached(client, MT9P031_H_BLANKING, hblank, -+ &mt9p031->h_blanking); -+ if (ret < 0) -+ return ret; -+ ret = reg_write_cached(client, MT9P031_V_BLANKING, vblank, -+ &mt9p031->v_blanking); -+ if (ret < 0) -+ return ret; -+ -+ ret = reg_write_cached(client, MT9P031_COLUMN_ADDRESS_MODE, -+ ((xbin - 1) << 4) | (xskip - 1), -+ &mt9p031->column_address_mode); -+ if (ret < 0) -+ return ret; -+ ret = reg_write_cached(client, MT9P031_ROW_ADDRESS_MODE, -+ ((ybin - 1) << 4) | (yskip - 1), -+ &mt9p031->row_address_mode); -+ if (ret < 0) -+ return ret; -+ -+ dev_dbg(&client->dev, "new physical left %u, top %u\n", -+ rect->left, rect->top); -+ -+ ret = reg_write_cached(client, MT9P031_COLUMN_START, -+ rect->left + MT9P031_COLUMN_START_DEF, -+ &mt9p031->column_start); -+ if (ret < 0) -+ return ret; -+ ret = reg_write_cached(client, MT9P031_ROW_START, -+ rect->top + MT9P031_ROW_START_DEF, -+ &mt9p031->row_start); -+ if (ret < 0) -+ return ret; -+ ret = reg_write_cached(client, MT9P031_WINDOW_WIDTH, -+ rect->width - 1, -+ &mt9p031->window_width); -+ if (ret < 0) -+ return ret; -+ ret = reg_write_cached(client, MT9P031_WINDOW_HEIGHT, -+ rect->height - 1, -+ &mt9p031->window_height); -+ if (ret < 0) -+ return ret; -+ -+ /* Re-enable register update, commit all changes */ -+ ret = mt9p031_set_output_control(mt9p031, -+ MT9P031_OUTPUT_CONTROL_SYN, 0); -+ if (ret < 0) -+ return ret; -+ -+ mt9p031->xskip = xskip; -+ mt9p031->yskip = yskip; -+ return ret; -+} -+ -+static int mt9p031_set_crop(struct v4l2_subdev *sd, -+ struct v4l2_subdev_fh *fh, -+ struct v4l2_subdev_crop *crop) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ struct v4l2_mbus_framefmt *f; -+ struct v4l2_rect *c; -+ struct v4l2_rect rect; -+ u16 xskip, yskip; -+ s32 width, height; -+ -+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u@%u:%u : %u)\n", -+ __func__, crop->rect.width, crop->rect.height, -+ crop->rect.left, crop->rect.top, crop->which); -+ -+ /* -+ * Clamp the crop rectangle boundaries and align them to a multiple of 2 -+ * pixels. -+ */ -+ rect.width = ALIGN(clamp(crop->rect.width, -+ MT9P031_WINDOW_WIDTH_MIN, MT9P031_WINDOW_WIDTH_MAX), 2); -+ rect.height = ALIGN(clamp(crop->rect.height, -+ MT9P031_WINDOW_HEIGHT_MIN, MT9P031_WINDOW_HEIGHT_MAX), 2); -+ rect.left = ALIGN(clamp(crop->rect.left, -+ 0, MT9P031_WINDOW_WIDTH_MAX - rect.width), 2); -+ rect.top = ALIGN(clamp(crop->rect.top, -+ 0, MT9P031_WINDOW_HEIGHT_MAX - rect.height), 2); -+ -+ c = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, crop->which); -+ -+ if (rect.width != c->width || rect.height != c->height) { -+ /* -+ * Reset the output image size if the crop rectangle size has -+ * been modified. -+ */ -+ f = mt9p031_get_pad_format(mt9p031, fh, crop->pad, -+ crop->which); -+ width = f->width; -+ height = f->height; -+ -+ xskip = mt9p031_skip_for_crop(rect.width, &width, 7); -+ yskip = mt9p031_skip_for_crop(rect.height, &height, 8); -+ } else { -+ xskip = mt9p031->xskip; -+ yskip = mt9p031->yskip; -+ f = NULL; -+ } -+ if (f) { -+ f->width = width; -+ f->height = height; -+ } -+ -+ *c = rect; -+ crop->rect = rect; -+ -+ mt9p031->xskip = xskip; -+ mt9p031->yskip = yskip; -+ mt9p031->rect = *c; -+ return 0; -+} -+ -+static int mt9p031_get_format(struct v4l2_subdev *sd, -+ struct v4l2_subdev_fh *fh, -+ struct v4l2_subdev_format *fmt) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ -+ fmt->format = -+ *mt9p031_get_pad_format(mt9p031, fh, fmt->pad, fmt->which); -+ return 0; -+} -+ -+static u16 mt9p031_skip_for_scale(s32 *source, s32 target, -+ s32 max_skip, s32 max) -+{ -+ unsigned int skip; -+ -+ if (*source - *source / 4 < target) { -+ *source = target; -+ return 1; -+ } -+ -+ skip = min(max, *source + target / 2) / target; -+ if (skip > max_skip) -+ skip = max_skip; -+ *source = target * skip; -+ -+ return skip; -+} -+ -+static int mt9p031_fmt_validate(struct v4l2_subdev *sd, -+ struct v4l2_subdev_format *fmt) -+{ -+ struct v4l2_mbus_framefmt *format = &fmt->format; -+ -+ /* Hardcode code and colorspace as sensor only supports one */ -+ format->code = V4L2_MBUS_FMT_SGRBG12_1X12; -+ format->colorspace = V4L2_COLORSPACE_SRGB; -+ -+ format->width = clamp_t(int, ALIGN(format->width, 2), 2, -+ MT9P031_WINDOW_WIDTH_MAX); -+ format->height = clamp_t(int, ALIGN(format->height, 2), 2, -+ MT9P031_WINDOW_HEIGHT_MAX); -+ format->field = V4L2_FIELD_NONE; -+ -+ return 0; -+} -+ -+static int mt9p031_set_format(struct v4l2_subdev *sd, -+ struct v4l2_subdev_fh *fh, -+ struct v4l2_subdev_format *format) -+{ -+ struct v4l2_subdev_format sdf = *format; -+ struct v4l2_mbus_framefmt *__format, *format_bak = &sdf.format; -+ struct v4l2_rect *__crop, rect; -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ u16 xskip, yskip; -+ int ret; -+ -+ __crop = mt9p031_get_pad_crop(mt9p031, fh, format->pad, format->which); -+ -+ ret = mt9p031_fmt_validate(sd, &sdf); -+ if (ret < 0) -+ return ret; -+ rect.width = __crop->width; -+ rect.height = __crop->height; -+ -+ xskip = mt9p031_skip_for_scale(&rect.width, format_bak->width, 7, -+ MT9P031_WINDOW_WIDTH_MAX); -+ if (rect.width + __crop->left > MT9P031_WINDOW_WIDTH_MAX) -+ rect.left = (MT9P031_WINDOW_WIDTH_MAX - rect.width) / 2; -+ else -+ rect.left = __crop->left; -+ yskip = mt9p031_skip_for_scale(&rect.height, format_bak->height, 8, -+ MT9P031_WINDOW_HEIGHT_MAX); -+ if (rect.height + __crop->top > MT9P031_WINDOW_HEIGHT_MAX) -+ rect.top = (MT9P031_WINDOW_HEIGHT_MAX - rect.height) / 2; -+ else -+ rect.top = __crop->top; -+ -+ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u : %u)\n", __func__, -+ format_bak->width, format_bak->height, format->which); -+ if (__crop) -+ *__crop = rect; -+ -+ __format = mt9p031_get_pad_format(mt9p031, fh, format->pad, format->which); -+ *__format = *format_bak; -+ format->format = *format_bak; -+ -+ mt9p031->xskip = xskip; -+ mt9p031->yskip = yskip; -+ mt9p031->rect = *__crop; -+ return 0; -+} -+ -+static int mt9p031_s_stream(struct v4l2_subdev *sd, int enable) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); -+ struct v4l2_rect rect = mt9p031->rect; -+ u16 xskip = mt9p031->xskip; -+ u16 yskip = mt9p031->yskip; -+ int ret; -+ -+ if (enable) { -+ ret = mt9p031_set_params(client, &rect, xskip, yskip); -+ if (ret < 0) -+ return ret; -+ /* Switch to master "normal" mode */ -+ ret = mt9p031_set_output_control(mt9p031, 0, -+ MT9P031_OUTPUT_CONTROL_CEN); -+ } else { -+ /* Stop sensor readout */ -+ ret = mt9p031_set_output_control(mt9p031, -+ MT9P031_OUTPUT_CONTROL_CEN, 0); -+ } -+ return ret; -+} -+ -+static int mt9p031_video_probe(struct i2c_client *client) -+{ -+ s32 data; -+ -+ /* Read out the chip version register */ -+ data = reg_read(client, MT9P031_CHIP_VERSION); -+ if (data != MT9P031_CHIP_VERSION_VALUE) { -+ dev_err(&client->dev, -+ "No MT9P031 chip detected, register read %x\n", data); -+ return -ENODEV; -+ } -+ -+ dev_info(&client->dev, "Detected a MT9P031 chip ID %x\n", data); -+ -+ return 0; -+} -+ -+static int mt9p031_set_power(struct v4l2_subdev *sd, int on) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ int ret = 0; -+ -+ mutex_lock(&mt9p031->power_lock); -+ -+ /* -+ * If the power count is modified from 0 to != 0 or from != 0 to 0, -+ * update the power state. -+ */ -+ if (mt9p031->power_count == !on) { -+ if (on) { -+ ret = mt9p031_power_on(mt9p031); -+ if (ret) { -+ dev_err(mt9p031->subdev.v4l2_dev->dev, -+ "Failed to enable 2.8v regulator: %d\n", ret); -+ goto out; -+ } -+ } else { -+ mt9p031_power_off(mt9p031); -+ } -+ } -+ -+ /* Update the power count. */ -+ mt9p031->power_count += on ? 1 : -1; -+ WARN_ON(mt9p031->power_count < 0); -+ -+out: -+ mutex_unlock(&mt9p031->power_lock); -+ return ret; -+} -+ -+static int mt9p031_registered(struct v4l2_subdev *sd) -+{ -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev); -+ int ret; -+ -+ ret = mt9p031_set_power(&mt9p031->subdev, 1); -+ if (ret) { -+ dev_err(&client->dev, -+ "Failed to power on device: %d\n", ret); -+ goto err_pwron; -+ } -+ -+ ret = mt9p031_video_probe(client); -+ if (ret) -+ goto err_evprobe; -+ -+ mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE; -+ ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0); -+ if (ret) -+ goto err_evprobe; -+ -+ mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; -+ mt9p031_set_power(&mt9p031->subdev, 0); -+ -+ return 0; -+err_evprobe: -+ mt9p031_set_power(&mt9p031->subdev, 0); -+err_pwron: -+ return ret; -+} -+ -+static int mt9p031_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) -+{ -+ struct mt9p031 *mt9p031; -+ mt9p031 = container_of(sd, struct mt9p031, subdev); -+ -+ mt9p031->rect.width = MT9P031_WINDOW_WIDTH_MAX; -+ mt9p031->rect.height = MT9P031_WINDOW_HEIGHT_MAX; -+ mt9p031->rect.left = MT9P031_COLUMN_START_DEF; -+ mt9p031->rect.top = MT9P031_ROW_START_DEF; -+ -+ mt9p031->format.code = V4L2_MBUS_FMT_SGRBG12_1X12; -+ mt9p031->format.width = MT9P031_WINDOW_WIDTH_MAX; -+ mt9p031->format.height = MT9P031_WINDOW_HEIGHT_MAX; -+ mt9p031->format.field = V4L2_FIELD_NONE; -+ mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB; -+ -+ mt9p031->xskip = 1; -+ mt9p031->yskip = 1; -+ return mt9p031_set_power(sd, 1); -+} -+ -+static int mt9p031_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) -+{ -+ return mt9p031_set_power(sd, 0); -+} -+ -+static struct v4l2_subdev_core_ops mt9p031_subdev_core_ops = { -+ .s_power = mt9p031_set_power, -+}; -+ -+static struct v4l2_subdev_video_ops mt9p031_subdev_video_ops = { -+ .s_stream = mt9p031_s_stream, -+}; -+ -+static struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = { -+ .enum_mbus_code = mt9p031_enum_mbus_code, -+ .get_fmt = mt9p031_get_format, -+ .set_fmt = mt9p031_set_format, -+ .get_crop = mt9p031_get_crop, -+ .set_crop = mt9p031_set_crop, -+}; -+ -+static struct v4l2_subdev_ops mt9p031_subdev_ops = { -+ .core = &mt9p031_subdev_core_ops, -+ .video = &mt9p031_subdev_video_ops, -+ .pad = &mt9p031_subdev_pad_ops, -+}; -+ -+static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = { -+ .registered = mt9p031_registered, -+ .open = mt9p031_open, -+ .close = mt9p031_close, -+}; -+ -+static int mt9p031_probe(struct i2c_client *client, -+ const struct i2c_device_id *did) -+{ -+ struct mt9p031 *mt9p031; -+ struct mt9p031_platform_data *pdata = client->dev.platform_data; -+ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); -+ int ret; -+ -+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { -+ dev_warn(&adapter->dev, -+ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n"); -+ return -EIO; -+ } -+ -+ mt9p031 = kzalloc(sizeof(struct mt9p031), GFP_KERNEL); -+ if (!mt9p031) -+ return -ENOMEM; -+ -+ mutex_init(&mt9p031->power_lock); -+ v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops); -+ mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops; -+ -+ mt9p031->pdata = pdata; -+ -+ mt9p031->reg_1v8 = regulator_get(NULL, "cam_1v8"); -+ if (IS_ERR(mt9p031->reg_1v8)) { -+ ret = PTR_ERR(mt9p031->reg_1v8); -+ dev_err(mt9p031->subdev.v4l2_dev->dev, -+ "Failed 1.8v regulator: %d\n", ret); -+ goto err_e1v8; -+ } -+ -+ mt9p031->reg_2v8 = regulator_get(NULL, "cam_2v8"); -+ if (IS_ERR(mt9p031->reg_2v8)) { -+ ret = PTR_ERR(mt9p031->reg_2v8); -+ dev_err(mt9p031->subdev.v4l2_dev->dev, -+ "Failed 2.8v regulator: %d\n", ret); -+ goto err_e2v8; -+ } -+ return 0; -+err_e2v8: -+ regulator_put(mt9p031->reg_1v8); -+err_e1v8: -+ kfree(mt9p031); -+ return ret; -+} -+ -+static int mt9p031_remove(struct i2c_client *client) -+{ -+ struct v4l2_subdev *sd = i2c_get_clientdata(client); -+ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev); -+ -+ v4l2_device_unregister_subdev(sd); -+ media_entity_cleanup(&sd->entity); -+ regulator_put(mt9p031->reg_2v8); -+ regulator_put(mt9p031->reg_1v8); -+ kfree(mt9p031); -+ -+ return 0; -+} -+ -+static const struct i2c_device_id mt9p031_id[] = { -+ { "mt9p031", 0 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, mt9p031_id); -+ -+static struct i2c_driver mt9p031_i2c_driver = { -+ .driver = { -+ .name = "mt9p031", -+ }, -+ .probe = mt9p031_probe, -+ .remove = mt9p031_remove, -+ .id_table = mt9p031_id, -+}; -+ -+static int __init mt9p031_mod_init(void) -+{ -+ return i2c_add_driver(&mt9p031_i2c_driver); -+} -+ -+static void __exit mt9p031_mod_exit(void) -+{ -+ i2c_del_driver(&mt9p031_i2c_driver); -+} -+ -+module_init(mt9p031_mod_init); -+module_exit(mt9p031_mod_exit); -+ -+MODULE_DESCRIPTION("Aptina MT9P031 Camera driver"); -+MODULE_AUTHOR("Bastian Hecht "); -+MODULE_LICENSE("GPL v2"); -diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h -new file mode 100644 -index 0000000..ad37eb3 ---- /dev/null -+++ b/include/media/mt9p031.h -@@ -0,0 +1,11 @@ -+#ifndef MT9P031_H -+#define MT9P031_H -+ -+struct v4l2_subdev; -+ -+struct mt9p031_platform_data { -+ int (*set_xclk)(struct v4l2_subdev *subdev, int hz); -+ int (*reset)(struct v4l2_subdev *subdev, int active); -+}; -+ -+#endif --- -1.6.6.1 - diff --git a/recipes/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch b/recipes/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch new file mode 100644 index 0000000000..68a762b25b --- /dev/null +++ b/recipes/linux/linux-omap-2.6.39/camera/0002-OMAP3BEAGLE-Add-support-for-mt9p031-sensor-driver.patch @@ -0,0 +1,142 @@ +From 186ab3a6cd3f1751b4e60044d8207eb95c4b224a Mon Sep 17 00:00:00 2001 +From: Javier Martin +Date: Wed, 25 May 2011 10:09:23 +0200 +Subject: [PATCH 2/4] OMAP3BEAGLE: Add support for mt9p031 sensor driver. + +isp.h file has to be included as a temporal measure +since clocks of the isp are not exposed yet. + +Signed-off-by: Javier Martin +--- + arch/arm/mach-omap2/board-omap3beagle.c | 73 ++++++++++++++++++++++++++++++- + 1 files changed, 72 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 221bfda..9af1cf8 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -25,15 +25,21 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include + #include + #include + ++#include + #include + #include + ++#include ++ + #include + #include + #include +@@ -48,11 +54,17 @@ + #include + #include + #include ++#include + + #include "mux.h" + #include "hsmmc.h" + #include "timer-gp.h" + #include "pm.h" ++#include "devices.h" ++#include "../../../drivers/media/video/omap3isp/isp.h" ++ ++#define MT9P031_RESET_GPIO 98 ++#define MT9P031_XCLK ISP_XCLK_A + + #define NAND_BLOCK_SIZE SZ_128K + +@@ -734,7 +746,7 @@ static int __init omap3_beagle_i2c_init(void) + { + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo, + ARRAY_SIZE(beagle_i2c1_boardinfo)); +- omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo, ++ omap_register_i2c_bus(2, 100, beagle_i2c2_boardinfo, + ARRAY_SIZE(beagle_i2c2_boardinfo)); + /* Bus 3 is attached to the DVI port where devices like the pico DLP + * projector don't work reliably with 400kHz */ +@@ -935,6 +947,60 @@ static void __init beagle_opp_init(void) + return; + } + ++static int beagle_cam_set_xclk(struct v4l2_subdev *subdev, int hz) ++{ ++ struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev); ++ int ret; ++ ++ ret = isp->platform_cb.set_xclk(isp, hz, MT9P031_XCLK); ++ return 0; ++} ++ ++static int beagle_cam_reset(struct v4l2_subdev *subdev, int active) ++{ ++ /* Set RESET_BAR to !active */ ++ gpio_set_value(MT9P031_RESET_GPIO, !active); ++ ++ return 0; ++} ++ ++static struct mt9p031_platform_data beagle_mt9p031_platform_data = { ++ .set_xclk = beagle_cam_set_xclk, ++ .reset = beagle_cam_reset, ++}; ++ ++static struct i2c_board_info mt9p031_camera_i2c_device = { ++ I2C_BOARD_INFO("mt9p031", 0x48), ++ .platform_data = &beagle_mt9p031_platform_data, ++}; ++ ++static struct isp_subdev_i2c_board_info mt9p031_camera_subdevs[] = { ++ { ++ .board_info = &mt9p031_camera_i2c_device, ++ .i2c_adapter_id = 2, ++ }, ++ { NULL, 0, }, ++}; ++ ++static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = { ++ { ++ .subdevs = mt9p031_camera_subdevs, ++ .interface = ISP_INTERFACE_PARALLEL, ++ .bus = { ++ .parallel = { ++ .data_lane_shift = 0, ++ .clk_pol = 1, ++ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE, ++ } ++ }, ++ }, ++ { }, ++}; ++ ++static struct isp_platform_data beagle_isp_platform_data = { ++ .subdevs = beagle_camera_subdevs, ++}; ++ + static void __init omap3_beagle_init(void) + { + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +@@ -1024,6 +1090,11 @@ static void __init omap3_beagle_init(void) + + beagle_display_init(); + beagle_opp_init(); ++ ++ /* Enable camera */ ++ gpio_request(MT9P031_RESET_GPIO, "cam_rst"); ++ gpio_direction_output(MT9P031_RESET_GPIO, 0); ++ omap3_init_camera(&beagle_isp_platform_data); + } + + early_param("buddy", expansionboard_setup); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch b/recipes/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch new file mode 100644 index 0000000000..b7efa4e5db --- /dev/null +++ b/recipes/linux/linux-omap-2.6.39/camera/0003-OMAP3-beagle-only-init-camera-on-3630.patch @@ -0,0 +1,34 @@ +From 014b3e447a0a9bbed5e238873fefb1a6c660c6a0 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Wed, 25 May 2011 10:28:29 +0200 +Subject: [PATCH 3/4] OMAP3: beagle: only init camera on 3630 + +Signed-off-by: Koen Kooi +--- + arch/arm/mach-omap2/board-omap3beagle.c | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 9af1cf8..80f8ece 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -1091,10 +1091,12 @@ static void __init omap3_beagle_init(void) + beagle_display_init(); + beagle_opp_init(); + +- /* Enable camera */ +- gpio_request(MT9P031_RESET_GPIO, "cam_rst"); +- gpio_direction_output(MT9P031_RESET_GPIO, 0); +- omap3_init_camera(&beagle_isp_platform_data); ++ if (cpu_is_omap3630()) { ++ /* Enable camera */ ++ gpio_request(MT9P031_RESET_GPIO, "cam_rst"); ++ gpio_direction_output(MT9P031_RESET_GPIO, 0); ++ omap3_init_camera(&beagle_isp_platform_data); ++ } + } + + early_param("buddy", expansionboard_setup); +-- +1.6.6.1 + diff --git a/recipes/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch b/recipes/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch new file mode 100644 index 0000000000..48e41a5490 --- /dev/null +++ b/recipes/linux/linux-omap-2.6.39/camera/0004-v4l-Add-mt9v032-sensor-driver.patch @@ -0,0 +1,853 @@ +From 9b0b5f99896549524c8f88a70f6cf0c0271d730e Mon Sep 17 00:00:00 2001 +From: Detlev Casanova +Date: Sun, 28 Nov 2010 19:07:20 +0100 +Subject: [PATCH 4/4] v4l: Add mt9v032 sensor driver + +The MT9V032 is a parallel wide VGA sensor from Aptina (formerly Micron) +controlled through I2C. + +The driver creates a V4L2 subdevice. It currently supports binning and +cropping, and the gain, auto gain, exposure, auto exposure and test +pattern controls. + +Signed-off-by: Detlev Casanova +Signed-off-by: Laurent Pinchart +--- + drivers/media/video/Kconfig | 7 + + drivers/media/video/Makefile | 1 + + drivers/media/video/mt9v032.c | 773 +++++++++++++++++++++++++++++++++++++++++ + include/media/mt9v032.h | 12 + + 4 files changed, 793 insertions(+), 0 deletions(-) + create mode 100644 drivers/media/video/mt9v032.c + create mode 100644 include/media/mt9v032.h + +diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig +index cb87e35..3a5bc57 100644 +--- a/drivers/media/video/Kconfig ++++ b/drivers/media/video/Kconfig +@@ -344,6 +344,13 @@ config VIDEO_MT9V011 + mt0v011 1.3 Mpixel camera. It currently only works with the + em28xx driver. + ++config VIDEO_MT9V032 ++ tristate "Micron MT9V032 sensor support" ++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API ++ ---help--- ++ This is a Video4Linux2 sensor-level driver for the Micron ++ MT9V032 752x480 CMOS sensor. ++ + config VIDEO_TCM825X + tristate "TCM825x camera sensor support" + depends on I2C && VIDEO_V4L2 +diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile +index 912b29b..6679c6a 100644 +--- a/drivers/media/video/Makefile ++++ b/drivers/media/video/Makefile +@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o + obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o + obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o + obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o ++obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o + obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o + obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o + +diff --git a/drivers/media/video/mt9v032.c b/drivers/media/video/mt9v032.c +new file mode 100644 +index 0000000..c64e1dc +--- /dev/null ++++ b/drivers/media/video/mt9v032.c +@@ -0,0 +1,773 @@ ++/* ++ * Driver for MT9V032 CMOS Image Sensor from Micron ++ * ++ * Copyright (C) 2010, Laurent Pinchart ++ * ++ * Based on the MT9M001 driver, ++ * ++ * Copyright (C) 2008, Guennadi Liakhovetski ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#define MT9V032_PIXEL_ARRAY_HEIGHT 492 ++#define MT9V032_PIXEL_ARRAY_WIDTH 782 ++ ++#define MT9V032_CHIP_VERSION 0x00 ++#define MT9V032_CHIP_ID_REV1 0x1311 ++#define MT9V032_CHIP_ID_REV3 0x1313 ++#define MT9V032_COLUMN_START 0x01 ++#define MT9V032_COLUMN_START_MIN 1 ++#define MT9V032_COLUMN_START_DEF 1 ++#define MT9V032_COLUMN_START_MAX 752 ++#define MT9V032_ROW_START 0x02 ++#define MT9V032_ROW_START_MIN 4 ++#define MT9V032_ROW_START_DEF 5 ++#define MT9V032_ROW_START_MAX 482 ++#define MT9V032_WINDOW_HEIGHT 0x03 ++#define MT9V032_WINDOW_HEIGHT_MIN 1 ++#define MT9V032_WINDOW_HEIGHT_DEF 480 ++#define MT9V032_WINDOW_HEIGHT_MAX 480 ++#define MT9V032_WINDOW_WIDTH 0x04 ++#define MT9V032_WINDOW_WIDTH_MIN 1 ++#define MT9V032_WINDOW_WIDTH_DEF 752 ++#define MT9V032_WINDOW_WIDTH_MAX 752 ++#define MT9V032_HORIZONTAL_BLANKING 0x05 ++#define MT9V032_HORIZONTAL_BLANKING_MIN 43 ++#define MT9V032_HORIZONTAL_BLANKING_MAX 1023 ++#define MT9V032_VERTICAL_BLANKING 0x06 ++#define MT9V032_VERTICAL_BLANKING_MIN 4 ++#define MT9V032_VERTICAL_BLANKING_MAX 3000 ++#define MT9V032_CHIP_CONTROL 0x07 ++#define MT9V032_CHIP_CONTROL_MASTER_MODE (1 << 3) ++#define MT9V032_CHIP_CONTROL_DOUT_ENABLE (1 << 7) ++#define MT9V032_CHIP_CONTROL_SEQUENTIAL (1 << 8) ++#define MT9V032_SHUTTER_WIDTH1 0x08 ++#define MT9V032_SHUTTER_WIDTH2 0x09 ++#define MT9V032_SHUTTER_WIDTH_CONTROL 0x0a ++#define MT9V032_TOTAL_SHUTTER_WIDTH 0x0b ++#define MT9V032_TOTAL_SHUTTER_WIDTH_MIN 1 ++#define MT9V032_TOTAL_SHUTTER_WIDTH_DEF 480 ++#define MT9V032_TOTAL_SHUTTER_WIDTH_MAX 32767 ++#define MT9V032_RESET 0x0c ++#define MT9V032_READ_MODE 0x0d ++#define MT9V032_READ_MODE_ROW_BIN_MASK (3 << 0) ++#define MT9V032_READ_MODE_ROW_BIN_SHIFT 0 ++#define MT9V032_READ_MODE_COLUMN_BIN_MASK (3 << 2) ++#define MT9V032_READ_MODE_COLUMN_BIN_SHIFT 2 ++#define MT9V032_READ_MODE_ROW_FLIP (1 << 4) ++#define MT9V032_READ_MODE_COLUMN_FLIP (1 << 5) ++#define MT9V032_READ_MODE_DARK_COLUMNS (1 << 6) ++#define MT9V032_READ_MODE_DARK_ROWS (1 << 7) ++#define MT9V032_PIXEL_OPERATION_MODE 0x0f ++#define MT9V032_PIXEL_OPERATION_MODE_COLOR (1 << 2) ++#define MT9V032_PIXEL_OPERATION_MODE_HDR (1 << 6) ++#define MT9V032_ANALOG_GAIN 0x35 ++#define MT9V032_ANALOG_GAIN_MIN 16 ++#define MT9V032_ANALOG_GAIN_DEF 16 ++#define MT9V032_ANALOG_GAIN_MAX 64 ++#define MT9V032_MAX_ANALOG_GAIN 0x36 ++#define MT9V032_MAX_ANALOG_GAIN_MAX 127 ++#define MT9V032_FRAME_DARK_AVERAGE 0x42 ++#define MT9V032_DARK_AVG_THRESH 0x46 ++#define MT9V032_DARK_AVG_LOW_THRESH_MASK (255 << 0) ++#define MT9V032_DARK_AVG_LOW_THRESH_SHIFT 0 ++#define MT9V032_DARK_AVG_HIGH_THRESH_MASK (255 << 8) ++#define MT9V032_DARK_AVG_HIGH_THRESH_SHIFT 8 ++#define MT9V032_ROW_NOISE_CORR_CONTROL 0x70 ++#define MT9V032_ROW_NOISE_CORR_ENABLE (1 << 5) ++#define MT9V032_ROW_NOISE_CORR_USE_BLK_AVG (1 << 7) ++#define MT9V032_PIXEL_CLOCK 0x74 ++#define MT9V032_PIXEL_CLOCK_INV_LINE (1 << 0) ++#define MT9V032_PIXEL_CLOCK_INV_FRAME (1 << 1) ++#define MT9V032_PIXEL_CLOCK_XOR_LINE (1 << 2) ++#define MT9V032_PIXEL_CLOCK_CONT_LINE (1 << 3) ++#define MT9V032_PIXEL_CLOCK_INV_PXL_CLK (1 << 4) ++#define MT9V032_TEST_PATTERN 0x7f ++#define MT9V032_TEST_PATTERN_DATA_MASK (1023 << 0) ++#define MT9V032_TEST_PATTERN_DATA_SHIFT 0 ++#define MT9V032_TEST_PATTERN_USE_DATA (1 << 10) ++#define MT9V032_TEST_PATTERN_GRAY_MASK (3 << 11) ++#define MT9V032_TEST_PATTERN_GRAY_NONE (0 << 11) ++#define MT9V032_TEST_PATTERN_GRAY_VERTICAL (1 << 11) ++#define MT9V032_TEST_PATTERN_GRAY_HORIZONTAL (2 << 11) ++#define MT9V032_TEST_PATTERN_GRAY_DIAGONAL (3 << 11) ++#define MT9V032_TEST_PATTERN_ENABLE (1 << 13) ++#define MT9V032_TEST_PATTERN_FLIP (1 << 14) ++#define MT9V032_AEC_AGC_ENABLE 0xaf ++#define MT9V032_AEC_ENABLE (1 << 0) ++#define MT9V032_AGC_ENABLE (1 << 1) ++#define MT9V032_THERMAL_INFO 0xc1 ++ ++struct mt9v032 { ++ struct v4l2_subdev subdev; ++ struct media_pad pad; ++ ++ struct v4l2_mbus_framefmt format; ++ struct v4l2_rect crop; ++ ++ struct v4l2_ctrl_handler ctrls; ++ ++ struct mutex power_lock; ++ int power_count; ++ ++ struct mt9v032_platform_data *pdata; ++ u16 chip_control; ++ u16 aec_agc; ++}; ++ ++static struct mt9v032 *to_mt9v032(struct v4l2_subdev *sd) ++{ ++ return container_of(sd, struct mt9v032, subdev); ++} ++ ++static int mt9v032_read(struct i2c_client *client, const u8 reg) ++{ ++ s32 data = i2c_smbus_read_word_data(client, reg); ++ dev_dbg(&client->dev, "%s: read 0x%04x from 0x%02x\n", __func__, ++ swab16(data), reg); ++ return data < 0 ? data : swab16(data); ++} ++ ++static int mt9v032_write(struct i2c_client *client, const u8 reg, ++ const u16 data) ++{ ++ dev_dbg(&client->dev, "%s: writing 0x%04x to 0x%02x\n", __func__, ++ data, reg); ++ return i2c_smbus_write_word_data(client, reg, swab16(data)); ++} ++ ++static int mt9v032_set_chip_control(struct mt9v032 *mt9v032, u16 clear, u16 set) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev); ++ u16 value = (mt9v032->chip_control & ~clear) | set; ++ int ret; ++ ++ ret = mt9v032_write(client, MT9V032_CHIP_CONTROL, value); ++ if (ret < 0) ++ return ret; ++ ++ mt9v032->chip_control = value; ++ return 0; ++} ++ ++static int ++mt9v032_update_aec_agc(struct mt9v032 *mt9v032, u16 which, int enable) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev); ++ u16 value = mt9v032->aec_agc; ++ int ret; ++ ++ if (enable) ++ value |= which; ++ else ++ value &= ~which; ++ ++ ret = mt9v032_write(client, MT9V032_AEC_AGC_ENABLE, value); ++ if (ret < 0) ++ return ret; ++ ++ mt9v032->aec_agc = value; ++ return 0; ++} ++ ++static int mt9v032_power_on(struct mt9v032 *mt9v032) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev); ++ int ret; ++ ++ if (mt9v032->pdata->set_clock) { ++ mt9v032->pdata->set_clock(&mt9v032->subdev, 25000000); ++ udelay(1); ++ } ++ ++ /* Reset the chip and stop data read out */ ++ ret = mt9v032_write(client, MT9V032_RESET, 1); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_RESET, 0); ++ if (ret < 0) ++ return ret; ++ ++ return mt9v032_write(client, MT9V032_CHIP_CONTROL, 0); ++} ++ ++static void mt9v032_power_off(struct mt9v032 *mt9v032) ++{ ++ if (mt9v032->pdata->set_clock) ++ mt9v032->pdata->set_clock(&mt9v032->subdev, 0); ++} ++ ++static int __mt9v032_set_power(struct mt9v032 *mt9v032, bool on) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev); ++ int ret; ++ ++ if (!on) { ++ mt9v032_power_off(mt9v032); ++ return 0; ++ } ++ ++ ret = mt9v032_power_on(mt9v032); ++ if (ret < 0) ++ return ret; ++ ++ /* Configure the pixel clock polarity */ ++ if (mt9v032->pdata && mt9v032->pdata->clk_pol) { ++ ret = mt9v032_write(client, MT9V032_PIXEL_CLOCK, ++ MT9V032_PIXEL_CLOCK_INV_PXL_CLK); ++ if (ret < 0) ++ return ret; ++ } ++ ++ /* Disable the noise correction algorithm and restore the controls. */ ++ ret = mt9v032_write(client, MT9V032_ROW_NOISE_CORR_CONTROL, 0); ++ if (ret < 0) ++ return ret; ++ ++ return v4l2_ctrl_handler_setup(&mt9v032->ctrls); ++} ++ ++/* ----------------------------------------------------------------------------- ++ * V4L2 subdev video operations ++ */ ++ ++static struct v4l2_mbus_framefmt * ++__mt9v032_get_pad_format(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh, ++ unsigned int pad, enum v4l2_subdev_format_whence which) ++{ ++ switch (which) { ++ case V4L2_SUBDEV_FORMAT_TRY: ++ return v4l2_subdev_get_try_format(fh, pad); ++ case V4L2_SUBDEV_FORMAT_ACTIVE: ++ return &mt9v032->format; ++ default: ++ return NULL; ++ } ++} ++ ++static struct v4l2_rect * ++__mt9v032_get_pad_crop(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh, ++ unsigned int pad, enum v4l2_subdev_format_whence which) ++{ ++ switch (which) { ++ case V4L2_SUBDEV_FORMAT_TRY: ++ return v4l2_subdev_get_try_crop(fh, pad); ++ case V4L2_SUBDEV_FORMAT_ACTIVE: ++ return &mt9v032->crop; ++ default: ++ return NULL; ++ } ++} ++ ++static int mt9v032_s_stream(struct v4l2_subdev *subdev, int enable) ++{ ++ const u16 mode = MT9V032_CHIP_CONTROL_MASTER_MODE ++ | MT9V032_CHIP_CONTROL_DOUT_ENABLE ++ | MT9V032_CHIP_CONTROL_SEQUENTIAL; ++ struct i2c_client *client = v4l2_get_subdevdata(subdev); ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ struct v4l2_mbus_framefmt *format = &mt9v032->format; ++ struct v4l2_rect *crop = &mt9v032->crop; ++ unsigned int hratio; ++ unsigned int vratio; ++ int ret; ++ ++ if (!enable) ++ return mt9v032_set_chip_control(mt9v032, mode, 0); ++ ++ /* Configure the window size and row/column bin */ ++ hratio = DIV_ROUND_CLOSEST(crop->width, format->width); ++ vratio = DIV_ROUND_CLOSEST(crop->height, format->height); ++ ++ ret = mt9v032_write(client, MT9V032_READ_MODE, ++ (hratio - 1) << MT9V032_READ_MODE_ROW_BIN_SHIFT | ++ (vratio - 1) << MT9V032_READ_MODE_COLUMN_BIN_SHIFT); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_COLUMN_START, crop->left); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_ROW_START, crop->top); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_WINDOW_WIDTH, crop->width); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_WINDOW_HEIGHT, crop->height); ++ if (ret < 0) ++ return ret; ++ ++ ret = mt9v032_write(client, MT9V032_HORIZONTAL_BLANKING, ++ max(43, 660 - crop->width)); ++ if (ret < 0) ++ return ret; ++ ++ /* Switch to master "normal" mode */ ++ return mt9v032_set_chip_control(mt9v032, 0, mode); ++} ++ ++static int mt9v032_enum_mbus_code(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_mbus_code_enum *code) ++{ ++ if (code->index > 0) ++ return -EINVAL; ++ ++ code->code = V4L2_MBUS_FMT_SGRBG10_1X10; ++ return 0; ++} ++ ++static int mt9v032_enum_frame_size(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_frame_size_enum *fse) ++{ ++ if (fse->index >= 8 || fse->code != V4L2_MBUS_FMT_SGRBG10_1X10) ++ return -EINVAL; ++ ++ fse->min_width = MT9V032_WINDOW_WIDTH_DEF / fse->index; ++ fse->max_width = fse->min_width; ++ fse->min_height = MT9V032_WINDOW_HEIGHT_DEF / fse->index; ++ fse->max_height = fse->min_height; ++ ++ return 0; ++} ++ ++static int mt9v032_get_format(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_format *format) ++{ ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ ++ format->format = *__mt9v032_get_pad_format(mt9v032, fh, format->pad, ++ format->which); ++ return 0; ++} ++ ++static int mt9v032_set_format(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_format *format) ++{ ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ struct v4l2_mbus_framefmt *__format; ++ struct v4l2_rect *__crop; ++ unsigned int width; ++ unsigned int height; ++ unsigned int hratio; ++ unsigned int vratio; ++ ++ __crop = __mt9v032_get_pad_crop(mt9v032, fh, format->pad, ++ format->which); ++ ++ /* Clamp the width and height to avoid dividing by zero. */ ++ width = clamp_t(unsigned int, ALIGN(format->format.width, 2), ++ max(__crop->width / 8, MT9V032_WINDOW_WIDTH_MIN), ++ __crop->width); ++ height = clamp_t(unsigned int, ALIGN(format->format.height, 2), ++ max(__crop->height / 8, MT9V032_WINDOW_HEIGHT_MIN), ++ __crop->height); ++ ++ hratio = DIV_ROUND_CLOSEST(__crop->width, width); ++ vratio = DIV_ROUND_CLOSEST(__crop->height, height); ++ ++ __format = __mt9v032_get_pad_format(mt9v032, fh, format->pad, ++ format->which); ++ __format->width = __crop->width / hratio; ++ __format->height = __crop->height / vratio; ++ ++ format->format = *__format; ++ ++ return 0; ++} ++ ++static int mt9v032_get_crop(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_crop *crop) ++{ ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ ++ crop->rect = *__mt9v032_get_pad_crop(mt9v032, fh, crop->pad, ++ crop->which); ++ return 0; ++} ++ ++static int mt9v032_set_crop(struct v4l2_subdev *subdev, ++ struct v4l2_subdev_fh *fh, ++ struct v4l2_subdev_crop *crop) ++{ ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ struct v4l2_mbus_framefmt *__format; ++ struct v4l2_rect *__crop; ++ struct v4l2_rect rect; ++ ++ /* Clamp the crop rectangle boundaries and align them to a non multiple ++ * of 2 pixels to ensure a GRBG Bayer pattern. ++ */ ++ rect.left = clamp(ALIGN(crop->rect.left + 1, 2) - 1, ++ MT9V032_COLUMN_START_MIN, ++ MT9V032_COLUMN_START_MAX); ++ rect.top = clamp(ALIGN(crop->rect.top + 1, 2) - 1, ++ MT9V032_ROW_START_MIN, ++ MT9V032_ROW_START_MAX); ++ rect.width = clamp(ALIGN(crop->rect.width, 2), ++ MT9V032_WINDOW_WIDTH_MIN, ++ MT9V032_WINDOW_WIDTH_MAX); ++ rect.height = clamp(ALIGN(crop->rect.height, 2), ++ MT9V032_WINDOW_HEIGHT_MIN, ++ MT9V032_WINDOW_HEIGHT_MAX); ++ ++ rect.width = min(rect.width, MT9V032_PIXEL_ARRAY_WIDTH - rect.left); ++ rect.height = min(rect.height, MT9V032_PIXEL_ARRAY_HEIGHT - rect.top); ++ ++ __crop = __mt9v032_get_pad_crop(mt9v032, fh, crop->pad, crop->which); ++ ++ if (rect.width != __crop->width || rect.height != __crop->height) { ++ /* Reset the output image size if the crop rectangle size has ++ * been modified. ++ */ ++ __format = __mt9v032_get_pad_format(mt9v032, fh, crop->pad, ++ crop->which); ++ __format->width = rect.width; ++ __format->height = rect.height; ++ } ++ ++ *__crop = rect; ++ crop->rect = rect; ++ ++ return 0; ++} ++ ++/* ----------------------------------------------------------------------------- ++ * V4L2 subdev control operations ++ */ ++ ++#define V4L2_CID_TEST_PATTERN (V4L2_CID_USER_BASE | 0x1001) ++ ++static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl) ++{ ++ struct mt9v032 *mt9v032 = ++ container_of(ctrl->handler, struct mt9v032, ctrls); ++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev); ++ u16 data; ++ ++ switch (ctrl->id) { ++ case V4L2_CID_AUTOGAIN: ++ return mt9v032_update_aec_agc(mt9v032, MT9V032_AGC_ENABLE, ++ ctrl->val); ++ ++ case V4L2_CID_GAIN: ++ return mt9v032_write(client, MT9V032_ANALOG_GAIN, ctrl->val); ++ ++ case V4L2_CID_EXPOSURE_AUTO: ++ return mt9v032_update_aec_agc(mt9v032, MT9V032_AEC_ENABLE, ++ ctrl->val); ++ ++ case V4L2_CID_EXPOSURE: ++ return mt9v032_write(client, MT9V032_TOTAL_SHUTTER_WIDTH, ++ ctrl->val); ++ ++ case V4L2_CID_TEST_PATTERN: ++ switch (ctrl->val) { ++ case 0: ++ data = 0; ++ break; ++ case 1: ++ data = MT9V032_TEST_PATTERN_GRAY_VERTICAL ++ | MT9V032_TEST_PATTERN_ENABLE; ++ break; ++ case 2: ++ data = MT9V032_TEST_PATTERN_GRAY_HORIZONTAL ++ | MT9V032_TEST_PATTERN_ENABLE; ++ break; ++ case 3: ++ data = MT9V032_TEST_PATTERN_GRAY_DIAGONAL ++ | MT9V032_TEST_PATTERN_ENABLE; ++ break; ++ default: ++ data = (ctrl->val << MT9V032_TEST_PATTERN_DATA_SHIFT) ++ | MT9V032_TEST_PATTERN_USE_DATA ++ | MT9V032_TEST_PATTERN_ENABLE ++ | MT9V032_TEST_PATTERN_FLIP; ++ break; ++ } ++ ++ return mt9v032_write(client, MT9V032_TEST_PATTERN, data); ++ } ++ ++ return 0; ++} ++ ++static struct v4l2_ctrl_ops mt9v032_ctrl_ops = { ++ .s_ctrl = mt9v032_s_ctrl, ++}; ++ ++static const struct v4l2_ctrl_config mt9v032_ctrls[] = { ++ { ++ .ops = &mt9v032_ctrl_ops, ++ .id = V4L2_CID_TEST_PATTERN, ++ .type = V4L2_CTRL_TYPE_INTEGER, ++ .name = "Test pattern", ++ .min = 0, ++ .max = 1023, ++ .step = 1, ++ .def = 0, ++ .flags = 0, ++ } ++}; ++ ++/* ----------------------------------------------------------------------------- ++ * V4L2 subdev core operations ++ */ ++ ++static int mt9v032_set_power(struct v4l2_subdev *subdev, int on) ++{ ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ int ret = 0; ++ ++ mutex_lock(&mt9v032->power_lock); ++ ++ /* If the power count is modified from 0 to != 0 or from != 0 to 0, ++ * update the power state. ++ */ ++ if (mt9v032->power_count == !on) { ++ ret = __mt9v032_set_power(mt9v032, !!on); ++ if (ret < 0) ++ goto done; ++ } ++ ++ /* Update the power count. */ ++ mt9v032->power_count += on ? 1 : -1; ++ WARN_ON(mt9v032->power_count < 0); ++ ++done: ++ mutex_unlock(&mt9v032->power_lock); ++ return ret; ++} ++ ++/* ----------------------------------------------------------------------------- ++ * V4L2 subdev internal operations ++ */ ++ ++static int mt9v032_registered(struct v4l2_subdev *subdev) ++{ ++ struct i2c_client *client = v4l2_get_subdevdata(subdev); ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ s32 data; ++ int ret; ++ ++ dev_info(&client->dev, "Probing MT9V032 at address 0x%02x\n", ++ client->addr); ++ ++ ret = mt9v032_power_on(mt9v032); ++ if (ret < 0) { ++ dev_err(&client->dev, "MT9V032 power up failed\n"); ++ return ret; ++ } ++ ++ /* Read and check the sensor version */ ++ data = mt9v032_read(client, MT9V032_CHIP_VERSION); ++ if (data != MT9V032_CHIP_ID_REV1 && data != MT9V032_CHIP_ID_REV3) { ++ dev_err(&client->dev, "MT9V032 not detected, wrong version " ++ "0x%04x\n", data); ++ return -ENODEV; ++ } ++ ++ mt9v032_power_off(mt9v032); ++ ++ dev_info(&client->dev, "MT9V032 detected at address 0x%02x\n", ++ client->addr); ++ ++ return ret; ++} ++ ++static int mt9v032_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh) ++{ ++ struct v4l2_mbus_framefmt *format; ++ struct v4l2_rect *crop; ++ ++ crop = v4l2_subdev_get_try_crop(fh, 0); ++ crop->left = MT9V032_COLUMN_START_DEF; ++ crop->top = MT9V032_ROW_START_DEF; ++ crop->width = MT9V032_WINDOW_WIDTH_DEF; ++ crop->height = MT9V032_WINDOW_HEIGHT_DEF; ++ ++ format = v4l2_subdev_get_try_format(fh, 0); ++ format->code = V4L2_MBUS_FMT_SGRBG10_1X10; ++ format->width = MT9V032_WINDOW_WIDTH_DEF; ++ format->height = MT9V032_WINDOW_HEIGHT_DEF; ++ format->field = V4L2_FIELD_NONE; ++ format->colorspace = V4L2_COLORSPACE_SRGB; ++ ++ return mt9v032_set_power(subdev, 1); ++} ++ ++static int mt9v032_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh) ++{ ++ return mt9v032_set_power(subdev, 0); ++} ++ ++static struct v4l2_subdev_core_ops mt9v032_subdev_core_ops = { ++ .s_power = mt9v032_set_power, ++}; ++ ++static struct v4l2_subdev_video_ops mt9v032_subdev_video_ops = { ++ .s_stream = mt9v032_s_stream, ++}; ++ ++static struct v4l2_subdev_pad_ops mt9v032_subdev_pad_ops = { ++ .enum_mbus_code = mt9v032_enum_mbus_code, ++ .enum_frame_size = mt9v032_enum_frame_size, ++ .get_fmt = mt9v032_get_format, ++ .set_fmt = mt9v032_set_format, ++ .get_crop = mt9v032_get_crop, ++ .set_crop = mt9v032_set_crop, ++}; ++ ++static struct v4l2_subdev_ops mt9v032_subdev_ops = { ++ .core = &mt9v032_subdev_core_ops, ++ .video = &mt9v032_subdev_video_ops, ++ .pad = &mt9v032_subdev_pad_ops, ++}; ++ ++static const struct v4l2_subdev_internal_ops mt9v032_subdev_internal_ops = { ++ .registered = mt9v032_registered, ++ .open = mt9v032_open, ++ .close = mt9v032_close, ++}; ++ ++/* ----------------------------------------------------------------------------- ++ * Driver initialization and probing ++ */ ++ ++static int mt9v032_probe(struct i2c_client *client, ++ const struct i2c_device_id *did) ++{ ++ struct mt9v032 *mt9v032; ++ unsigned int i; ++ int ret; ++ ++ if (!i2c_check_functionality(client->adapter, ++ I2C_FUNC_SMBUS_WORD_DATA)) { ++ dev_warn(&client->adapter->dev, ++ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n"); ++ return -EIO; ++ } ++ ++ mt9v032 = kzalloc(sizeof(*mt9v032), GFP_KERNEL); ++ if (!mt9v032) ++ return -ENOMEM; ++ ++ mutex_init(&mt9v032->power_lock); ++ mt9v032->pdata = client->dev.platform_data; ++ ++ v4l2_ctrl_handler_init(&mt9v032->ctrls, ARRAY_SIZE(mt9v032_ctrls) + 4); ++ ++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops, ++ V4L2_CID_AUTOGAIN, 0, 1, 1, 1); ++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops, ++ V4L2_CID_GAIN, MT9V032_ANALOG_GAIN_MIN, ++ MT9V032_ANALOG_GAIN_MAX, 1, MT9V032_ANALOG_GAIN_DEF); ++ v4l2_ctrl_new_std_menu(&mt9v032->ctrls, &mt9v032_ctrl_ops, ++ V4L2_CID_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, 0, ++ V4L2_EXPOSURE_AUTO); ++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops, ++ V4L2_CID_EXPOSURE, MT9V032_TOTAL_SHUTTER_WIDTH_MIN, ++ MT9V032_TOTAL_SHUTTER_WIDTH_MAX, 1, ++ MT9V032_TOTAL_SHUTTER_WIDTH_DEF); ++ ++ for (i = 0; i < ARRAY_SIZE(mt9v032_ctrls); ++i) ++ v4l2_ctrl_new_custom(&mt9v032->ctrls, &mt9v032_ctrls[i], NULL); ++ ++ mt9v032->subdev.ctrl_handler = &mt9v032->ctrls; ++ ++ if (mt9v032->ctrls.error) ++ printk(KERN_INFO "%s: control initialization error %d\n", ++ __func__, mt9v032->ctrls.error); ++ ++ mt9v032->crop.left = MT9V032_COLUMN_START_DEF; ++ mt9v032->crop.top = MT9V032_ROW_START_DEF; ++ mt9v032->crop.width = MT9V032_WINDOW_WIDTH_DEF; ++ mt9v032->crop.height = MT9V032_WINDOW_HEIGHT_DEF; ++ ++ mt9v032->format.code = V4L2_MBUS_FMT_SGRBG10_1X10; ++ mt9v032->format.width = MT9V032_WINDOW_WIDTH_DEF; ++ mt9v032->format.height = MT9V032_WINDOW_HEIGHT_DEF; ++ mt9v032->format.field = V4L2_FIELD_NONE; ++ mt9v032->format.colorspace = V4L2_COLORSPACE_SRGB; ++ ++ mt9v032->aec_agc = MT9V032_AEC_ENABLE | MT9V032_AGC_ENABLE; ++ ++ v4l2_i2c_subdev_init(&mt9v032->subdev, client, &mt9v032_subdev_ops); ++ mt9v032->subdev.internal_ops = &mt9v032_subdev_internal_ops; ++ mt9v032->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; ++ ++ mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE; ++ ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0); ++ if (ret < 0) ++ kfree(mt9v032); ++ ++ return ret; ++} ++ ++static int mt9v032_remove(struct i2c_client *client) ++{ ++ struct v4l2_subdev *subdev = i2c_get_clientdata(client); ++ struct mt9v032 *mt9v032 = to_mt9v032(subdev); ++ ++ v4l2_device_unregister_subdev(subdev); ++ media_entity_cleanup(&subdev->entity); ++ kfree(mt9v032); ++ return 0; ++} ++ ++static const struct i2c_device_id mt9v032_id[] = { ++ { "mt9v032", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, mt9v032_id); ++ ++static struct i2c_driver mt9v032_driver = { ++ .driver = { ++ .name = "mt9v032", ++ }, ++ .probe = mt9v032_probe, ++ .remove = mt9v032_remove, ++ .id_table = mt9v032_id, ++}; ++ ++static int __init mt9v032_init(void) ++{ ++ return i2c_add_driver(&mt9v032_driver); ++} ++ ++static void __exit mt9v032_exit(void) ++{ ++ i2c_del_driver(&mt9v032_driver); ++} ++ ++module_init(mt9v032_init); ++module_exit(mt9v032_exit); ++ ++MODULE_DESCRIPTION("Aptina MT9V032 Camera driver"); ++MODULE_AUTHOR("Laurent Pinchart "); ++MODULE_LICENSE("GPL"); +diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h +new file mode 100644 +index 0000000..5e27f9b +--- /dev/null ++++ b/include/media/mt9v032.h +@@ -0,0 +1,12 @@ ++#ifndef _MEDIA_MT9V032_H ++#define _MEDIA_MT9V032_H ++ ++struct v4l2_subdev; ++ ++struct mt9v032_platform_data { ++ unsigned int clk_pol:1; ++ ++ void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate); ++}; ++ ++#endif +-- +1.6.6.1 + diff --git a/recipes/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/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 2de60ca2a9..86eafe37e8 100644 --- a/recipes/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/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 @@ -From fc4833337f5386c40eaf41d533fb5fcbd38d6a1d Mon Sep 17 00:00:00 2001 +From 8812fba541092702d6a40ea23ff60bcb504365fd Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 12 May 2011 07:59:52 -0500 Subject: [PATCH 1/6] OMAP2+: cpufreq: free up table on exit diff --git a/recipes/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/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 fb7ada2e18..ee27578d04 100644 --- a/recipes/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/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 @@ -From bbd8caaeda861dfa69882c34d8556b541f822ae2 Mon Sep 17 00:00:00 2001 +From 1dce7658788943a8085323ef87111cdcdb335d1d Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 12 May 2011 08:14:41 -0500 Subject: [PATCH 2/6] OMAP2+: cpufreq: handle invalid cpufreq table diff --git a/recipes/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/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 1cf78ebba5..3064d5044d 100644 --- a/recipes/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/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 @@ -From 47eeee58d9321e827e68ea3b914988db6b1635da Mon Sep 17 00:00:00 2001 +From 61c5ce4da03eda42e69cf225fddac9c910506db5 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 12 May 2011 16:27:45 -0700 Subject: [PATCH 3/6] OMAP2+: cpufreq: minor comment cleanup diff --git a/recipes/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/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 a7f84df9e4..24a721a011 100644 --- a/recipes/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/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 @@ -From d972d3f4eb53c261f8496176b429287b97e297d0 Mon Sep 17 00:00:00 2001 +From 4910bff43db304f58fef625d54e573d554066a78 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 13 May 2011 05:34:35 -0700 Subject: [PATCH 4/6] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available diff --git a/recipes/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/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 2bbab2f4f1..f5493b3bf9 100644 --- a/recipes/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/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 @@ -From dec271e2e15103120df35be942884f577d6a768c Mon Sep 17 00:00:00 2001 +From e8d1f8ed3f2ed7c2e9ee51adfd322868d4195ecf Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 13 May 2011 05:43:49 -0700 Subject: [PATCH 5/6] OMAP2+: cpufreq: use cpufreq_frequency_table_target diff --git a/recipes/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/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 2595023c68..0727ebcdee 100644 --- a/recipes/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/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 @@ -From d7559c9bd5225ad2e57e8c798dc1301396e05ce1 Mon Sep 17 00:00:00 2001 +From 9303bae0e4acf8a8b3b0c682d6655a656fc776bf Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Wed, 18 May 2011 01:48:23 -0500 Subject: [PATCH 6/6] OMAP2+: cpufreq: fix freq_table leak diff --git a/recipes/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/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 e8a250b387..03385720a0 100644 --- a/recipes/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/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 @@ -From b581872eacd6342a890b1c6d2596c16fac5875b5 Mon Sep 17 00:00:00 2001 +From 078a7006a32248c98d40ef79bbeb85a0879de734 Mon Sep 17 00:00:00 2001 From: Mike Turquette Date: Tue, 17 May 2011 09:35:54 -0500 Subject: [PATCH 1/2] cpufreq: helpers for walking the frequency table diff --git a/recipes/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/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch index 96154e9beb..70fa625e43 100644 --- a/recipes/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/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 @@ -From 0faab5e374817718add80a132f6fc90943971a61 Mon Sep 17 00:00:00 2001 +From f31dabf5b6158584da56e7186ada6d2a80d5654e Mon Sep 17 00:00:00 2001 From: Mike Turquette Date: Tue, 17 May 2011 09:43:09 -0500 Subject: [PATCH 2/2] cpufreq: introduce hotplug governor diff --git a/recipes/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/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 823eff30b3..5093df3d26 100644 --- a/recipes/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/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 @@ -From a2564b1a8a946ddaf64930b48ec279b87bc758ca Mon Sep 17 00:00:00 2001 +From 2a72620933492b6be114a287e7188c47ee1f6844 Mon Sep 17 00:00:00 2001 From: Peter 'p2' De Schrijver Date: Wed, 11 Aug 2010 17:02:43 -0700 Subject: [PATCH 1/8] OMAP: CPUfreq: ensure driver initializes after cpufreq framework and governors diff --git a/recipes/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/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 d8a0de2e0c..5ef85b55b1 100644 --- a/recipes/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/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 @@ -From cb564063772d73261a8dd24d9285a37e8db49cd4 Mon Sep 17 00:00:00 2001 +From ec7b7d1f27887ec5d76a2d4175e54cedcfa379da Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 11 Aug 2010 17:05:38 -0700 Subject: [PATCH 2/8] OMAP: CPUfreq: ensure policy is fully initialized diff --git a/recipes/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/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 7861cebfff..8593ee4de1 100644 --- a/recipes/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/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 @@ -From 6702f624ad5c5e1eba57f9efe889f64333f9e022 Mon Sep 17 00:00:00 2001 +From 5f6e9a6011a5eedc51fc8157fffcae5b7fdf87e7 Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Mon, 10 Nov 2008 17:00:25 +0530 Subject: [PATCH 3/8] OMAP3 PM: CPUFreq driver for OMAP3 diff --git a/recipes/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/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 062c537adb..aa9cd48515 100644 --- a/recipes/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/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 @@ -From 71849b3531c66af5f925deb1deb60a3722d62463 Mon Sep 17 00:00:00 2001 +From 1f013ab3b839edb583a276b5591a744dc4308bf8 Mon Sep 17 00:00:00 2001 From: Silesh C V Date: Wed, 29 Sep 2010 14:52:54 +0530 Subject: [PATCH 4/8] OMAP: PM: CPUFREQ: Fix conditional compilation diff --git a/recipes/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/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 19432f3a2e..f3432a2c33 100644 --- a/recipes/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/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 @@ -From 6d6506387d617a934bc4f8476e8f06a11e21b043 Mon Sep 17 00:00:00 2001 +From 43e22afa61f3624628c8344bcae9e95f0cc8525a Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 16 Nov 2010 11:48:41 -0800 Subject: [PATCH 5/8] cpufreq: fixup after new OPP layer merged diff --git a/recipes/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/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 22e93c0a9d..cf80cb7928 100644 --- a/recipes/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/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 @@ -From d93e9bf14c8b5194c0db64ae7daae80c228bfc04 Mon Sep 17 00:00:00 2001 +From 2a3ca1bc3f842bab22873e2d9d002e0a736d0f19 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 14 Mar 2011 17:08:48 +0530 Subject: [PATCH 6/8] OMAP: cpufreq: Split OMAP1 and OMAP2PLUS CPUfreq drivers. diff --git a/recipes/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/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 810873a68a..51c1b3ea20 100644 --- a/recipes/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/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 @@ -From 1d829a2213997f903aacfffcf184e3705be38026 Mon Sep 17 00:00:00 2001 +From 7e421930c287f42bed624ad65250c16deaeae50f Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 14 Mar 2011 17:08:49 +0530 Subject: [PATCH 7/8] OMAP2PLUS: cpufreq: Add SMP support to cater OMAP4430 diff --git a/recipes/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/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 fd0c11ce1d..a2480818b3 100644 --- a/recipes/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/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 @@ -From a216121073a645a3b9965f06a0813d77b3f467ca Mon Sep 17 00:00:00 2001 +From 92c6a90a264c5803fc239a7304e073cd1517658b Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Thu, 14 Apr 2011 16:21:58 +0300 Subject: [PATCH 8/8] OMAP2PLUS: cpufreq: Fix typo when attempting to set mpu_clk for OMAP4 diff --git a/recipes/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/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 d030c51968..76ac4aba18 100644 --- a/recipes/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/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 @@ -From d19005cc07645703a61d4645c343ed586919575d Mon Sep 17 00:00:00 2001 +From ec3154869b4d2fb10e3d455ec8af1e248d9c972b Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 5 Apr 2011 15:22:31 +0530 Subject: [PATCH 1/6] OMAP2+: clockdomain: Add an api to read idle mode diff --git a/recipes/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/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 fa79d07418..a0471ef991 100644 --- a/recipes/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/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 @@ -From 2863828e636c1766c6d2de85c900f6656f4b6675 Mon Sep 17 00:00:00 2001 +From 85b9e8fe08a8c85096be91cb8eb60d5450dac71d Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 5 Apr 2011 15:22:36 +0530 Subject: [PATCH 2/6] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle diff --git a/recipes/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/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 65a4fcbf6e..99c0b746f4 100644 --- a/recipes/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/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 @@ -From dc352655af9c356f5c2db95c88718ed3a996569b Mon Sep 17 00:00:00 2001 +From 6dc3e54ade4c042c6e798fb6f17ff65b9357bc89 Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 5 Apr 2011 15:22:41 +0530 Subject: [PATCH 3/6] OMAP2+: PM: Initialise sleep_switch to a non-valid value diff --git a/recipes/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/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 7a94488fde..fe8a4966ee 100644 --- a/recipes/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/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 @@ -From 59bfd35cfef1c0b9c2c078082a47f957c27fa2fd Mon Sep 17 00:00:00 2001 +From 828597d32fc3926e2c9e6c57adcc50c7eac824de Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 5 Apr 2011 15:22:48 +0530 Subject: [PATCH 4/6] OMAP2+: PM: idle clkdms only if already in idle diff --git a/recipes/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/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 0e9a2ee0f0..aeeda5977f 100644 --- a/recipes/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/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 @@ -From 8bde567522cb85c91f49858a9026d3ec24283331 Mon Sep 17 00:00:00 2001 +From 6ecf0ebe9d520748b217a016ef8a0b239805a42c Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 29 Mar 2011 22:37:43 +0530 Subject: [PATCH 5/6] OMAP2+: hwmod: Follow the recomended PRCM sequence diff --git a/recipes/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/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 8c9025752a..e95c9f8308 100644 --- a/recipes/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/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 @@ -From 06ef3c33307622a7c4ab0f7cbfaf0163a1be5a81 Mon Sep 17 00:00:00 2001 +From 0af36cc0dcf5a6654e25eb33509fe0bc44a1dd81 Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Tue, 2 Mar 2010 17:25:30 +0530 Subject: [PATCH 6/6] OMAP: Serial: Check wk_st only if present diff --git a/recipes/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/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 f1a5bbbc90..f80c07ec39 100644 --- a/recipes/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/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 @@ -From 26d1f5966161349845884ae3c8f558d2580f1eb9 Mon Sep 17 00:00:00 2001 +From f505147f6352faaf3d70b00a757279d56e2ef78b Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Sat, 12 Feb 2011 17:27:14 +0530 Subject: [PATCH 01/12] OMAP3+: voltage: remove spurious pr_notice for debugfs diff --git a/recipes/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/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch index 186c6846aa..dc800647e4 100644 --- a/recipes/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/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 @@ -From f9e0aa8fa5538ddd92e12c5a062e78b0ae5e47e9 Mon Sep 17 00:00:00 2001 +From 79f5f1bb1c1a0f004e41660742a0bf736744ad0e Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Sun, 13 Mar 2011 09:07:23 +0530 Subject: [PATCH 02/12] OMAP4: PM: remove redundant #ifdef CONFIG_PM diff --git a/recipes/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/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 8e6a11bb39..a17d2bb5a4 100644 --- a/recipes/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/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 @@ -From c57f8521c772b2a934dc090d68d7ca3b33c99a46 Mon Sep 17 00:00:00 2001 +From b0ed051910c29c99e604ad4eb06d480199fcbd34 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Thu, 24 Mar 2011 18:35:31 +0200 Subject: [PATCH 03/12] OMAP3+: smartreflex: fix sr_late_init() error path in probe diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch index 335f092a62..5ca9678ff0 100644 --- a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch +++ b/recipes/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 @@ -From e09d0dd5be3f582aaf4626b3be0eeba42ca598bd Mon Sep 17 00:00:00 2001 +From d494d209b9b3c1cb13981a9756818f2822379a13 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Thu, 24 Mar 2011 18:35:32 +0200 Subject: [PATCH 04/12] OMAP3+: smartreflex: request the memory region diff --git a/recipes/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/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 7783da7c81..a9da969957 100644 --- a/recipes/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/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 @@ -From ca7c837b7f6c37c86d0646774a60d82848557411 Mon Sep 17 00:00:00 2001 +From 7553d0119d9f62a809d21993deaac2a745251c3b Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Thu, 24 Mar 2011 18:35:33 +0200 Subject: [PATCH 05/12] OMAP3+: smartreflex: fix ioremap leak on probe error diff --git a/recipes/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/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 8c5fe19d79..8f76fc376b 100644 --- a/recipes/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/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 @@ -From 11af4217e7e6c2c21d1fe9e5f317a5baabf9a361 Mon Sep 17 00:00:00 2001 +From cdb1237e4829a7912fe4e78e73f20bda9ea22d6d Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Thu, 24 Mar 2011 18:35:34 +0200 Subject: [PATCH 06/12] OMAP3+: smartreflex: delete instance from sr_list on probe error diff --git a/recipes/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/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 1f4d43c847..897ddb0dac 100644 --- a/recipes/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/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 @@ -From d4ead89805d1146f79a3204467eecb19dcdc442a Mon Sep 17 00:00:00 2001 +From abfa4bd473f227d2d0b42367c5aeaf6e16214a95 Mon Sep 17 00:00:00 2001 From: Aaro Koskinen Date: Thu, 24 Mar 2011 18:35:35 +0200 Subject: [PATCH 07/12] OMAP3+: smartreflex: delete debugfs entries on probe error diff --git a/recipes/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/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch index 185454e336..72183c44f8 100644 --- a/recipes/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/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 @@ -From 9f4d8f56ce3268ee3e2efc9489d50d66d361f32d Mon Sep 17 00:00:00 2001 +From f8a6387ba73da6c8fe4281449b85f1825f2403bb Mon Sep 17 00:00:00 2001 From: Jean Pihet Date: Fri, 29 Apr 2011 11:26:22 +0200 Subject: [PATCH 08/12] OMAP3 cpuidle: remove useless SDP specific timings diff --git a/recipes/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/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch index 88a45ba32b..2e5414c76a 100644 --- a/recipes/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/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 @@ -From 62629e3664ff1e3c9b34b94b81eafa153671e1ed Mon Sep 17 00:00:00 2001 +From d7992ea7da87a0802fa2b65819bf0e3adc5ba502 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 12:16:36 +0530 Subject: [PATCH 09/12] OMAP3+: SR: make notify independent of class diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch index da171b021a..10ada9159a 100644 --- a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch +++ b/recipes/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 @@ -From 4aa0f416a44a7053d223f80a8e4be9d0ebdd31ae Mon Sep 17 00:00:00 2001 +From 1f8185e181d5b9c1f47ce5f858dad3bba2be240d Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 12:41:10 +0530 Subject: [PATCH 10/12] OMAP3+: SR: disable interrupt by default diff --git a/recipes/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/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 925beddcf5..99176652dd 100644 --- a/recipes/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/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 @@ -From aa44b466398b8b104c07ff1b7209509300fc4f47 Mon Sep 17 00:00:00 2001 +From 488e6ec1262fd56c62b09874fcf8557709f30ef2 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 21:14:17 +0530 Subject: [PATCH 11/12] OMAP3+: SR: enable/disable SR only on need diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch index 7241112e13..e8dddc1c60 100644 --- a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch +++ b/recipes/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 @@ -From 0ea922a6c65ea07b685ec05085dd5d3ec4ac87e2 Mon Sep 17 00:00:00 2001 +From 5e50b744aeca31be1c93790e048fc69c2f77c6c9 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 12:33:13 +0530 Subject: [PATCH 12/12] OMAP3+: SR: fix cosmetic indentation diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch index 3d836a0f91..24700eede9 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch @@ -1,7 +1,7 @@ -From 6c106e173b2b0be58ba68e800d0e1bdd731174c4 Mon Sep 17 00:00:00 2001 +From 19d9727973e7b0c5f8983a1a5ae3b0a02e062bab Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 7 Apr 2011 15:28:47 +0300 -Subject: [PATCH 01/30] OMAP: DSS2: DSI: fix use_sys_clk & highfreq +Subject: [PATCH 01/31] OMAP: DSS2: DSI: fix use_sys_clk & highfreq use_sys_clk and highfreq fields in dsi.current_cinfo were never set. Luckily they weren't used anywhere so it didn't cause any problems. diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch index e32b8e9bcd..7ab7f4d778 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch @@ -1,7 +1,7 @@ -From c440fa0e7472cbe20b783de7ed14ffa8a9f3290f Mon Sep 17 00:00:00 2001 +From 2bc828d1b81d857238dc8b1f29e38e466469e352 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 4 Apr 2011 10:02:53 +0300 -Subject: [PATCH 02/30] OMAP: DSS2: DSI: fix dsi_dump_clocks() +Subject: [PATCH 02/31] OMAP: DSS2: DSI: fix dsi_dump_clocks() On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock (CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch index 93beabbd7c..0bef2d2f66 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch @@ -1,7 +1,7 @@ -From d6e2082fe2d1abd4bb8d1492d28f5f76f09e6121 Mon Sep 17 00:00:00 2001 +From 29d6de29d3d0d2ac9fe0572cd4e0485757eca550 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Thu, 31 Mar 2011 13:23:35 +0530 -Subject: [PATCH 03/30] OMAP2PLUS: DSS2: Fix: Return correct lcd clock source for OMAP2/3 +Subject: [PATCH 03/31] OMAP2PLUS: DSS2: Fix: Return correct lcd clock source for OMAP2/3 dss.lcd_clk_source is set to the default value DSS_CLK_SRC_FCK at dss_init. For OMAP2 and OMAP3, the dss.lcd_clk_source should always be the same as diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch index fcf8f8972a..f204b87e42 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch @@ -1,7 +1,7 @@ -From 513d8f83be6a3e9a4b7f1ef23656ac84b109d7a8 Mon Sep 17 00:00:00 2001 +From e7665ffb72cbc890b8494c687b335e3e242231d9 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 15 Apr 2011 10:42:59 +0300 -Subject: [PATCH 04/30] OMAP: DSS: DSI: Fix DSI PLL power bug +Subject: [PATCH 04/31] OMAP: DSS: DSI: Fix DSI PLL power bug OMAP3630 has a HW bug causing DSI PLL power command POWER_ON_DIV (0x3) to not work properly. The bug prevents us from enabling DSI PLL power diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch index be520fd15c..8d4b175bcc 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch @@ -1,7 +1,7 @@ -From e9b70efca1b15f5e743cccacb925156ca99878a7 Mon Sep 17 00:00:00 2001 +From c84fbf480062086f93f99c27817e4d2d91593511 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 8 Apr 2011 09:30:27 +0300 -Subject: [PATCH 05/30] OMAP: DSS2: fix panel Kconfig dependencies +Subject: [PATCH 05/31] OMAP: DSS2: fix panel Kconfig dependencies All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the dependency. diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch index eeb41a2561..e7751c58dc 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch @@ -1,7 +1,7 @@ -From bf7e98aa062cf6a78e7f68089609f5693d5ca72b Mon Sep 17 00:00:00 2001 +From 756700075d8ebd5979f3ea2d20f44356c417dfe4 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Tue, 19 Jan 2010 21:19:15 -0800 -Subject: [PATCH 06/30] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output +Subject: [PATCH 06/31] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch index c9ecaddf40..3cd3ff98fc 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch @@ -1,7 +1,7 @@ -From bb5ff1aa2cf586b544d17b9afa00a347eeeb7012 Mon Sep 17 00:00:00 2001 +From bbfdb465c2970b1cd18fd0ae5adf99e61cfd530e Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Sat, 19 Dec 2009 06:52:43 -0800 -Subject: [PATCH 07/30] video: add timings for hd720 +Subject: [PATCH 07/31] video: add timings for hd720 --- drivers/video/modedb.c | 4 ++++ diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch index 2baf826c74..b798199c7d 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch @@ -1,7 +1,7 @@ -From b01ef0758c3ab86173b13d2da2d6850f520dfe80 Mon Sep 17 00:00:00 2001 +From 45b1b2aefac18adf9246b56f82355597b26e997b Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Tue, 15 Dec 2009 15:17:44 -0800 -Subject: [PATCH 08/30] drivers: net: smsc911x: return ENODEV if device is not found +Subject: [PATCH 08/31] drivers: net: smsc911x: return ENODEV if device is not found Signed-off-by: Steve Sakoman --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch index fab3b1829c..80b09dd535 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch @@ -1,7 +1,7 @@ -From 5a26a8992c0baa8ff0944f0e09b1aee4dd5e3450 Mon Sep 17 00:00:00 2001 +From fda068cf87fc12f12aeaea2e428d78afac43c19b Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Tue, 15 Dec 2009 15:24:10 -0800 -Subject: [PATCH 09/30] drivers: input: touchscreen: ads7846: return ENODEV if device is not found +Subject: [PATCH 09/31] drivers: input: touchscreen: ads7846: return ENODEV if device is not found Signed-off-by: Steve Sakoman --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch index 876b47aa25..ef74568fa4 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch @@ -1,7 +1,7 @@ -From 03ae041e2cee01b98b8c6d46a94a2b9025f74e14 Mon Sep 17 00:00:00 2001 +From 44940d48b3d535072e6a4d225173c3115bacc75b Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 3 Mar 2011 13:29:30 -0800 -Subject: [PATCH 10/30] Revert "omap2_mcspi: Flush posted writes" +Subject: [PATCH 10/31] Revert "omap2_mcspi: Flush posted writes" This reverts commit a330ce2001b290c59fe98c37e981683ef0a75fdf. --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch index 78f6911683..0f39a8a7e0 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch @@ -1,7 +1,7 @@ -From 94b2b9670eb5e0af73bd98a991bee9856fe0e654 Mon Sep 17 00:00:00 2001 +From b4a56c6ec6df1af55b75608ff7c7cbf91660eb91 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Fri, 19 Nov 2010 15:11:19 -0800 -Subject: [PATCH 11/30] Revert "omap_hsmmc: improve interrupt synchronisation" +Subject: [PATCH 11/31] Revert "omap_hsmmc: improve interrupt synchronisation" This reverts commit b417577d3b9bbb06a4ddc9aa955af9bd503f7242. diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch index 3d51fca757..4c06145525 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch +++ b/recipes/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 @@ -From 0efaa4ad5c5040db8cfa729145ed64c5ff878e9e Mon Sep 17 00:00:00 2001 +From 796b0fc090132a5ea3849bd3177cb88c64ad2160 Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Fri, 2 Apr 2010 08:41:47 -0700 -Subject: [PATCH 12/30] Don't turn SDIO cards off to save power. Doing so will lose all internal state in the card. +Subject: [PATCH 12/31] Don't turn SDIO cards off to save power. Doing so will lose all internal state in the card. Signed-off-by: David Vrabel --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch index 6756886e9d..29f5e17227 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch @@ -1,7 +1,7 @@ -From 008e668e53c5d230910d1b97deaff99ec2259e71 Mon Sep 17 00:00:00 2001 +From 9231d1d9fac779c95809dedf95fde64738b4186f Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Fri, 2 Apr 2010 08:42:22 -0700 -Subject: [PATCH 13/30] Enable the use of SDIO card interrupts. +Subject: [PATCH 13/31] Enable the use of SDIO card interrupts. FCLK must be enabled while SDIO interrupts are enabled or the MMC module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch index 8d95f94d67..962e664b80 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch @@ -1,7 +1,7 @@ -From 39a7aa6274c0d63acadc95a242f1a2ad47c1c680 Mon Sep 17 00:00:00 2001 +From e94f62ff96d19547c5a0d9e99691f19fe91c451a Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 17 Dec 2009 12:45:20 -0800 -Subject: [PATCH 14/30] soc: codecs: Enable audio capture by default for twl4030 +Subject: [PATCH 14/31] soc: codecs: Enable audio capture by default for twl4030 --- sound/soc/codecs/twl4030.c | 4 ++-- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch index 5979d07480..60bf6e2efa 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch @@ -1,7 +1,7 @@ -From add8f3f1d3592c2976124062f70b88dd3e3f7673 Mon Sep 17 00:00:00 2001 +From fadce249fe7562795ce9f8fc92f8aa7a586725dc Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 29 Dec 2010 11:39:16 -0800 -Subject: [PATCH 15/30] soc: codecs: twl4030: Turn on mic bias by default +Subject: [PATCH 15/31] soc: codecs: twl4030: Turn on mic bias by default --- sound/soc/codecs/twl4030.c | 2 +- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch index 11f6d4c5ab..23447476d2 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch @@ -1,7 +1,7 @@ -From 859eda7a9b4ff6240006b65679a3e04ecd7c474a Mon Sep 17 00:00:00 2001 +From a49740bb7066dbbf1b7f6bda73cdc45169202ebf Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 4 Feb 2010 12:26:22 -0800 -Subject: [PATCH 16/30] RTC: add support for backup battery recharge +Subject: [PATCH 16/31] RTC: add support for backup battery recharge --- drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++ diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch index ead233db11..a95b313259 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch @@ -1,7 +1,7 @@ -From 31482a8ae0ca57e0e530564e589b16bfb2bbb93c Mon Sep 17 00:00:00 2001 +From e4e17b2fa3aa84e14303d2270a49f1ac9bf25b5c Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Sun, 24 Jan 2010 09:33:56 -0800 -Subject: [PATCH 17/30] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test +Subject: [PATCH 17/31] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test otherwise it is not executed on systems that use non-twl regulators --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch index 77cf64f049..0083bde1f2 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch @@ -1,7 +1,7 @@ -From 41b834aed6b2902683102eacff56428158792187 Mon Sep 17 00:00:00 2001 +From 80c2126f5bf63ea2d033310e030cac5229865a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20W=C3=B6rndl-Aichriedler?= Date: Sat, 15 May 2010 16:34:05 +0200 -Subject: [PATCH 18/30] Add power-off support for the TWL4030 companion +Subject: [PATCH 18/31] Add power-off support for the TWL4030 companion This patch adds support for the power-off on shutdown feature of the TWL4030 --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch index 5c4c6570f8..6643475947 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch @@ -1,7 +1,7 @@ -From 98ee7c7f078aa79db223967040598a49c46931fe Mon Sep 17 00:00:00 2001 +From d4f736154c4a873a12408d0d094e2152a4c4dc96 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Thu, 17 Dec 2009 14:27:15 -0800 -Subject: [PATCH 19/30] ARM: OMAP: Add twl4030 madc support to Overo +Subject: [PATCH 19/31] ARM: OMAP: Add twl4030 madc support to Overo Signed-off-by: Steve Sakoman --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch index afd2a999d4..7532150366 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch @@ -1,7 +1,7 @@ -From 2efc7dd29df90a4e248c080797b1511db0399d67 Mon Sep 17 00:00:00 2001 +From 4f5e04f8fcc6e6835aad7dde949c1cb82b5eaa45 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 4 May 2011 01:14:50 +0530 -Subject: [PATCH 20/30] Enabling Hwmon driver for twl4030-madc +Subject: [PATCH 20/31] Enabling Hwmon driver for twl4030-madc Signed-off-by: Keerthy --- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch index 805a35ef9c..65c2630802 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch @@ -1,7 +1,7 @@ -From 31b6b44adffe954ece851daff092f628a951712e Mon Sep 17 00:00:00 2001 +From faa15ccdcc5690ba83d4d09049222df35f40719d Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Sat, 23 Jan 2010 06:26:54 -0800 -Subject: [PATCH 21/30] mfd: twl-core: enable madc clock +Subject: [PATCH 21/31] mfd: twl-core: enable madc clock Now that the madc driver has been merged it is also necessary to enable the clock to the madc block diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch index 809f3ed1e0..780012a13b 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch @@ -1,7 +1,7 @@ -From e0dc7f9a7d63c8cd5e4183cf5626ec11e272e3e0 Mon Sep 17 00:00:00 2001 +From b94621613e7ece11e6408efe33ceb724892645d1 Mon Sep 17 00:00:00 2001 From: Ilkka Koskinen Date: Wed, 16 Mar 2011 16:07:14 +0000 -Subject: [PATCH 22/30] rtc-twl: Switch to using threaded irq +Subject: [PATCH 22/31] rtc-twl: Switch to using threaded irq --- drivers/rtc/rtc-twl.c | 2 +- diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch index 4afc7e1744..bb9408a842 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch @@ -1,7 +1,7 @@ -From 80ac44d7f93ac3b8db9921feed4080c8dc572c0f Mon Sep 17 00:00:00 2001 +From 9a400cd7d8af58a7ba9dadaf6208c3f6ec9bb8a5 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 24 Feb 2010 10:37:22 -0800 -Subject: [PATCH 23/30] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options +Subject: [PATCH 23/31] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options --- arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++ diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch index 9aac69d070..ce27c93840 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch @@ -1,7 +1,7 @@ -From 3b7393eb41684f3f44e8c15bbba4ab0e830f8810 Mon Sep 17 00:00:00 2001 +From 26a79f408bd41ad7b4a47f2683909d3fc1575eab Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 12 Jan 2011 05:54:55 -0800 -Subject: [PATCH 24/30] omap: mmc: Adjust dto to eliminate timeout errors +Subject: [PATCH 24/31] omap: mmc: Adjust dto to eliminate timeout errors A number of SD card types were experiencing timeout errors. This could also lead to data corruption in some cases. diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch index b0828c2eb3..f16ee2f152 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch @@ -1,7 +1,7 @@ -From 5c688ec6e6f046d2c8b3821964971149b0c30fc7 Mon Sep 17 00:00:00 2001 +From a13b58ba9d6e0aa0fe0d2dc5b51de545cea2ee9e Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Tue, 18 Jan 2011 11:25:25 +1300 -Subject: [PATCH 25/30] omap: Fix mtd subpage read alignment +Subject: [PATCH 25/31] omap: Fix mtd subpage read alignment This allows the omap2 prefetch engine to work properly for subpage reads. Without this ECC errors will stop UBIFS from working. diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch index b9b235a00f..4a424c9b8a 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch @@ -1,7 +1,7 @@ -From 3592c2e24b0af79aa2fb181a9825d5b72e2f68dd Mon Sep 17 00:00:00 2001 +From e0756b50ed72ebe28c768c9e17ee7811cc3cc53c Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Thu, 16 Dec 2010 20:35:56 -0800 -Subject: [PATCH 26/30] mtd: nand: omap2: Force all buffer reads to u32 alignment +Subject: [PATCH 26/31] mtd: nand: omap2: Force all buffer reads to u32 alignment --- drivers/mtd/nand/omap2.c | 12 ++++++++++++ diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch index bd283faf0f..2427df5f72 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch @@ -1,7 +1,7 @@ -From 22a6c2c3d2dafd4084945472fbeed2a94893ddb4 Mon Sep 17 00:00:00 2001 +From 263890438c545107c50be16e628926531949c1fa Mon Sep 17 00:00:00 2001 From: kishore kadiyala Date: Mon, 2 May 2011 11:10:38 +0000 -Subject: [PATCH 27/30] omap : nand : fix subpage ecc issue with prefetch +Subject: [PATCH 27/31] omap : nand : fix subpage ecc issue with prefetch For prefetch engine, read and write got broken in commit '2c01946c'. We never hit a scenario of not getting 'gpmc_prefetch_enable' diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch index 80b44aeb1e..bdbe1feaaa 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch @@ -1,7 +1,7 @@ -From 7c2667ccc5741129830c0188b50c347e3cc4edd5 Mon Sep 17 00:00:00 2001 +From d83a600cbe0cfca8c8fd9f5566dd45166cc9e142 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Sun, 23 Jan 2011 20:39:35 -0800 -Subject: [PATCH 28/30] OMAP: Overo: Add support for spidev +Subject: [PATCH 28/31] OMAP: Overo: Add support for spidev --- arch/arm/mach-omap2/board-overo.c | 16 ++++++++++++++++ diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch index 30fba1bc1d..236865dbec 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch @@ -1,7 +1,7 @@ -From e6b1af4def888530e5dfeaaf4338f248e9d0f677 Mon Sep 17 00:00:00 2001 +From 083250cd6541b75535707c1d416cfa3a45ad19a9 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 2 May 2011 16:14:34 -0700 -Subject: [PATCH 29/30] unionfs: Add support for unionfs 2.5.9 +Subject: [PATCH 29/31] unionfs: Add support for unionfs 2.5.9 --- Documentation/filesystems/00-INDEX | 2 + diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch index 67112a31ab..30010faa0c 100644 --- a/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch @@ -1,7 +1,7 @@ -From 9f9d70c4d1caf249ab36c656c5e89db91d7c981b Mon Sep 17 00:00:00 2001 +From ab3ce8260342b568029c051c5e526526696a27f6 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 23 May 2011 12:16:50 -0700 -Subject: [PATCH 30/30] omap: Change omap_device activate latency messages from pr_warning to pr_debug +Subject: [PATCH 30/31] omap: Change omap_device activate latency messages from pr_warning to pr_debug Messages can be safely ignored, so reduce console noise diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch new file mode 100644 index 0000000000..c50db1b33f --- /dev/null +++ b/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch @@ -0,0 +1,105 @@ +From c79191ab97d2b006c59c7dce4bfcdce48d66ec03 Mon Sep 17 00:00:00 2001 +From: Steve Sakoman +Date: Tue, 24 May 2011 20:36:07 -0700 +Subject: [PATCH 31/31] omap: overo: Add opp init + +omap: overo: Add opp init + +Work in progress + +Signed-off-by: Steve Sakoman +--- + arch/arm/mach-omap2/board-overo.c | 49 +++++++++++++++++++++++++++++++++++++ + 1 files changed, 49 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c +index 05dd3eb..8c2d21f 100644 +--- a/arch/arm/mach-omap2/board-overo.c ++++ b/arch/arm/mach-omap2/board-overo.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -43,6 +44,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -54,6 +56,7 @@ + #include + + #include "mux.h" ++#include "pm.h" + #include "sdram-micron-mt46h32m32lf-6.h" + #include "hsmmc.h" + +@@ -755,6 +758,51 @@ static struct omap_musb_board_data musb_board_data = { + .power = 100, + }; + ++static void __init overo_opp_init(void) ++{ ++ int r = 0; ++ ++ /* Initialize the omap3 opp table */ ++ if (omap3_opp_init()) { ++ pr_err("%s: opp default init failed\n", __func__); ++ return; ++ } ++ ++ /* Custom OPP enabled for 36/3730 */ ++ if (cpu_is_omap3630()) { ++ struct omap_hwmod *mh = omap_hwmod_lookup("mpu"); ++ struct omap_hwmod *dh = omap_hwmod_lookup("iva"); ++ struct device *dev; ++ ++ if (!mh || !dh) { ++ pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", ++ __func__, mh, dh); ++ return; ++ } ++ /* Enable MPU 1GHz and lower opps */ ++ dev = &mh->od->pdev.dev; ++ r = opp_enable(dev, 1000000000); ++ ++ /* Enable IVA 800MHz and lower opps */ ++ dev = &dh->od->pdev.dev; ++ r |= opp_enable(dev, 800000000); ++ ++ if (r) { ++ pr_err("%s: failed to enable higher opp %d\n", ++ __func__, r); ++ /* ++ * Cleanup - disable the higher freqs - we dont care ++ * about the results ++ */ ++ dev = &mh->od->pdev.dev; ++ opp_disable(dev, 1000000000); ++ dev = &dh->od->pdev.dev; ++ opp_disable(dev, 800000000); ++ } ++ } ++ return; ++} ++ + static void __init overo_init(void) + { + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +@@ -770,6 +818,7 @@ static void __init overo_init(void) + overo_display_init(); + overo_init_led(); + overo_init_keys(); ++ overo_opp_init(); + + /* Ensure SDRC pins are mux'd for self-refresh */ + omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); +-- +1.6.6.1 + -- cgit 1.2.3-korg