All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor
@ 2011-09-27 13:40 ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

This patchset
	-adds support for MT9T111 sensor on omap3evm.
	Currently the sensor driver supports only
	VGA resolution.
	-enables MT9T111 sensor in omap2plus_defconfig.

This is dependent on the following patchset
http://www.spinics.net/lists/linux-media/msg37270.html 
which adds YUYV input support for OMAP3ISP. And is 
applied on top of rc1-for-3.2 of gliakhovetski/v4l-dvb.git
---
Changes in v2:
	As per the discussion here,
	https://lkml.org/lkml/2011/9/20/280
	the existing mt9t112 driver is reused for
	adding support for mt9t111 sensor.
Deepthy Ravi (3):
  [media] v4l: Add support for mt9t111 sensor driver
  ispccdc: Configure CCDC_SYN_MODE register
  omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers

Vaibhav Hiremath (2):
  omap3evm: Enable regulators for camera interface
  omap3evm: Add Camera board init/hookup file

 arch/arm/configs/omap2plus_defconfig        |    9 +
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 ++++
 arch/arm/mach-omap2/board-omap3evm.c        |   26 +
 drivers/media/video/Kconfig                 |    7 +
 drivers/media/video/Makefile                |    1 +
 drivers/media/video/mt9t111_reg.h           | 1367 +++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c               |  320 ++++++-
 drivers/media/video/omap3isp/ispccdc.c      |   11 +-
 include/media/mt9t111.h                     |   45 +
 10 files changed, 1937 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor
@ 2011-09-27 13:40 ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: linux-omap, Deepthy Ravi

This patchset
	-adds support for MT9T111 sensor on omap3evm.
	Currently the sensor driver supports only
	VGA resolution.
	-enables MT9T111 sensor in omap2plus_defconfig.

This is dependent on the following patchset
http://www.spinics.net/lists/linux-media/msg37270.html 
which adds YUYV input support for OMAP3ISP. And is 
applied on top of rc1-for-3.2 of gliakhovetski/v4l-dvb.git
---
Changes in v2:
	As per the discussion here,
	https://lkml.org/lkml/2011/9/20/280
	the existing mt9t112 driver is reused for
	adding support for mt9t111 sensor.
Deepthy Ravi (3):
  [media] v4l: Add support for mt9t111 sensor driver
  ispccdc: Configure CCDC_SYN_MODE register
  omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers

Vaibhav Hiremath (2):
  omap3evm: Enable regulators for camera interface
  omap3evm: Add Camera board init/hookup file

 arch/arm/configs/omap2plus_defconfig        |    9 +
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 ++++
 arch/arm/mach-omap2/board-omap3evm.c        |   26 +
 drivers/media/video/Kconfig                 |    7 +
 drivers/media/video/Makefile                |    1 +
 drivers/media/video/mt9t111_reg.h           | 1367 +++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c               |  320 ++++++-
 drivers/media/video/omap3isp/ispccdc.c      |   11 +-
 include/media/mt9t111.h                     |   45 +
 10 files changed, 1937 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor
@ 2011-09-27 13:40 ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

This patchset
	-adds support for MT9T111 sensor on omap3evm.
	Currently the sensor driver supports only
	VGA resolution.
	-enables MT9T111 sensor in omap2plus_defconfig.

This is dependent on the following patchset
http://www.spinics.net/lists/linux-media/msg37270.html 
which adds YUYV input support for OMAP3ISP. And is 
applied on top of rc1-for-3.2 of gliakhovetski/v4l-dvb.git
---
Changes in v2:
	As per the discussion here,
	https://lkml.org/lkml/2011/9/20/280
	the existing mt9t112 driver is reused for
	adding support for mt9t111 sensor.
Deepthy Ravi (3):
  [media] v4l: Add support for mt9t111 sensor driver
  ispccdc: Configure CCDC_SYN_MODE register
  omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers

Vaibhav Hiremath (2):
  omap3evm: Enable regulators for camera interface
  omap3evm: Add Camera board init/hookup file

 arch/arm/configs/omap2plus_defconfig        |    9 +
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 ++++
 arch/arm/mach-omap2/board-omap3evm.c        |   26 +
 drivers/media/video/Kconfig                 |    7 +
 drivers/media/video/Makefile                |    1 +
 drivers/media/video/mt9t111_reg.h           | 1367 +++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c               |  320 ++++++-
 drivers/media/video/omap3isp/ispccdc.c      |   11 +-
 include/media/mt9t111.h                     |   45 +
 10 files changed, 1937 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 1/5] omap3evm: Enable regulators for camera interface
  2011-09-27 13:40 ` Deepthy Ravi
  (?)
@ 2011-09-27 13:40   ` Deepthy Ravi
  -1 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

From: Vaibhav Hiremath <hvaibhav@ti.com>

Enabled 1v8 and 2v8 regulator output, which is being used by
camera module.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index c452b3f..f63a8fa 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -273,6 +273,25 @@ static struct omap_dss_board_info omap3_evm_dss_data = {
 	.default_device	= &omap3_evm_lcd_device,
 };
 
+static struct regulator_consumer_supply omap3evm_vaux3_supply[] = {
+	REGULATOR_SUPPLY("cam_2v8", NULL),
+};
+
+/* VAUX3 for CAM_2V8 */
+static struct regulator_init_data omap3evm_vaux3 = {
+	.constraints = {
+		.min_uV                 = 2800000,
+		.max_uV                 = 2800000,
+		.apply_uV               = true,
+		.valid_modes_mask       = REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask         = REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+		},
+	.num_consumer_supplies  = ARRAY_SIZE(omap3evm_vaux3_supply),
+	.consumer_supplies      = omap3evm_vaux3_supply,
+};
+
 static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = {
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
@@ -433,6 +452,7 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
 /* ads7846 on SPI */
 static struct regulator_consumer_supply omap3evm_vio_supply[] = {
 	REGULATOR_SUPPLY("vcc", "spi1.0"),
+	REGULATOR_SUPPLY("vio_1v8", NULL),
 };
 
 /* VIO for ads7846 */
@@ -499,6 +519,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
 	.vio		= &omap3evm_vio,
 	.vmmc1		= &omap3evm_vmmc1,
 	.vsim		= &omap3evm_vsim,
+	.vaux3          = &omap3evm_vaux3,
 };
 
 static int __init omap3_evm_i2c_init(void)
@@ -512,6 +533,7 @@ static int __init omap3_evm_i2c_init(void)
 	omap3evm_twldata.vpll2->constraints.apply_uV = true;
 
 	omap3_pmic_init("twl4030", &omap3evm_twldata);
+	/* Bus 2 is used for Camera/Sensor interface */
 	omap_register_i2c_bus(2, 400, NULL, 0);
 	omap_register_i2c_bus(3, 400, NULL, 0);
 	return 0;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 1/5] omap3evm: Enable regulators for camera interface
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: Deepthy Ravi, linux-omap

From: Vaibhav Hiremath <hvaibhav@ti.com>

Enabled 1v8 and 2v8 regulator output, which is being used by
camera module.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index c452b3f..f63a8fa 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -273,6 +273,25 @@ static struct omap_dss_board_info omap3_evm_dss_data = {
 	.default_device	= &omap3_evm_lcd_device,
 };
 
+static struct regulator_consumer_supply omap3evm_vaux3_supply[] = {
+	REGULATOR_SUPPLY("cam_2v8", NULL),
+};
+
+/* VAUX3 for CAM_2V8 */
+static struct regulator_init_data omap3evm_vaux3 = {
+	.constraints = {
+		.min_uV                 = 2800000,
+		.max_uV                 = 2800000,
+		.apply_uV               = true,
+		.valid_modes_mask       = REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask         = REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+		},
+	.num_consumer_supplies  = ARRAY_SIZE(omap3evm_vaux3_supply),
+	.consumer_supplies      = omap3evm_vaux3_supply,
+};
+
 static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = {
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
@@ -433,6 +452,7 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
 /* ads7846 on SPI */
 static struct regulator_consumer_supply omap3evm_vio_supply[] = {
 	REGULATOR_SUPPLY("vcc", "spi1.0"),
+	REGULATOR_SUPPLY("vio_1v8", NULL),
 };
 
 /* VIO for ads7846 */
@@ -499,6 +519,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
 	.vio		= &omap3evm_vio,
 	.vmmc1		= &omap3evm_vmmc1,
 	.vsim		= &omap3evm_vsim,
+	.vaux3          = &omap3evm_vaux3,
 };
 
 static int __init omap3_evm_i2c_init(void)
@@ -512,6 +533,7 @@ static int __init omap3_evm_i2c_init(void)
 	omap3evm_twldata.vpll2->constraints.apply_uV = true;
 
 	omap3_pmic_init("twl4030", &omap3evm_twldata);
+	/* Bus 2 is used for Camera/Sensor interface */
 	omap_register_i2c_bus(2, 400, NULL, 0);
 	omap_register_i2c_bus(3, 400, NULL, 0);
 	return 0;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 1/5] omap3evm: Enable regulators for camera interface
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vaibhav Hiremath <hvaibhav@ti.com>

Enabled 1v8 and 2v8 regulator output, which is being used by
camera module.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index c452b3f..f63a8fa 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -273,6 +273,25 @@ static struct omap_dss_board_info omap3_evm_dss_data = {
 	.default_device	= &omap3_evm_lcd_device,
 };
 
+static struct regulator_consumer_supply omap3evm_vaux3_supply[] = {
+	REGULATOR_SUPPLY("cam_2v8", NULL),
+};
+
+/* VAUX3 for CAM_2V8 */
+static struct regulator_init_data omap3evm_vaux3 = {
+	.constraints = {
+		.min_uV                 = 2800000,
+		.max_uV                 = 2800000,
+		.apply_uV               = true,
+		.valid_modes_mask       = REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask         = REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+		},
+	.num_consumer_supplies  = ARRAY_SIZE(omap3evm_vaux3_supply),
+	.consumer_supplies      = omap3evm_vaux3_supply,
+};
+
 static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = {
 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
@@ -433,6 +452,7 @@ static struct twl4030_keypad_data omap3evm_kp_data = {
 /* ads7846 on SPI */
 static struct regulator_consumer_supply omap3evm_vio_supply[] = {
 	REGULATOR_SUPPLY("vcc", "spi1.0"),
+	REGULATOR_SUPPLY("vio_1v8", NULL),
 };
 
 /* VIO for ads7846 */
@@ -499,6 +519,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
 	.vio		= &omap3evm_vio,
 	.vmmc1		= &omap3evm_vmmc1,
 	.vsim		= &omap3evm_vsim,
+	.vaux3          = &omap3evm_vaux3,
 };
 
 static int __init omap3_evm_i2c_init(void)
@@ -512,6 +533,7 @@ static int __init omap3_evm_i2c_init(void)
 	omap3evm_twldata.vpll2->constraints.apply_uV = true;
 
 	omap3_pmic_init("twl4030", &omap3evm_twldata);
+	/* Bus 2 is used for Camera/Sensor interface */
 	omap_register_i2c_bus(2, 400, NULL, 0);
 	omap_register_i2c_bus(3, 400, NULL, 0);
 	return 0;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
  2011-09-27 13:40 ` Deepthy Ravi
  (?)
@ 2011-09-27 13:40   ` Deepthy Ravi
  -1 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

Added support for mt9t111 sensor in the existing
mt9t112 driver. Also added support for media controller
framework. The sensor driver currently supports only
VGA resolution.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/Kconfig       |    7 +
 drivers/media/video/Makefile      |    1 +
 drivers/media/video/mt9t111_reg.h | 1367 +++++++++++++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c     |  320 ++++++++-
 include/media/mt9t111.h           |   45 ++
 5 files changed, 1704 insertions(+), 36 deletions(-)
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 14326d7..b5806e8 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -482,6 +482,13 @@ config VIDEO_MT9V032
 	  This is a Video4Linux2 sensor-level driver for the Micron
 	  MT9V032 752x480 CMOS sensor.
 
+config VIDEO_MT9T111
+	tristate "Aptina MT9T111 VGA CMOS IMAGE SENSOR"
+	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	---help---
+	 This is a Video4Linux2 sensor-level driver for the Aptina MT9T111
+	 image 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 c06f515..02a8b70 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
 obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
 obj-$(CONFIG_VIDEO_SR030PC30)	+= sr030pc30.o
+obj-$(CONFIG_VIDEO_MT9T111) += mt9t112.o
 obj-$(CONFIG_VIDEO_NOON010PC30)	+= noon010pc30.o
 obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
 obj-$(CONFIG_VIDEO_ADP1653)	+= adp1653.o
diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
new file mode 100644
index 0000000..2f610d4
--- /dev/null
+++ b/drivers/media/video/mt9t111_reg.h
@@ -0,0 +1,1367 @@
+/*
+ * drivers/media/video/mt9t111_reg.h
+ *
+ * mt9t111 sensor driver header file
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef MT9T111_REG_H
+#define MT9T111_REG_H
+
+/* register addr */
+#define MT9T111_CHIP_ID		(0x0000)
+
+/* register value */
+#define MT9T111_CHIP_ID_VALUE	(0x2680)
+
+#define MT9T111_IMAGE_WIDTH		(640)
+#define MT9T111_IMAGE_HEIGHT		(480)
+
+typedef struct {
+	u16 delay_time;
+	u16 addr;
+	u16 data;
+} mt9t111_regs;
+
+mt9t111_regs patch_rev6[] = {
+	{0, 0x0982, 0x0},
+	{0, 0x098A, 0xCE7},
+	{0, 0x0990, 0x3C3C},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C5F},
+	{0, 0x0996, 0x4F30},
+	{0, 0x0998, 0xED08},
+	{0, 0x099a, 0xBD61},
+	{0, 0x099c, 0xD5CE},
+	{0, 0x099e, 0x4CD},
+	{0, 0x098A, 0xCF7},
+	{0, 0x0990, 0x1F17},
+	{0, 0x0992, 0x211},
+	{0, 0x0994, 0xCC33},
+	{0, 0x0996, 0x2E30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCFF},
+	{0, 0x099c, 0xFDED},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0xD07},
+	{0, 0x0990, 0x2},
+	{0, 0x0992, 0xBD70},
+	{0, 0x0994, 0x6D18},
+	{0, 0x0996, 0xDE1F},
+	{0, 0x0998, 0x181F},
+	{0, 0x099a, 0x8E01},
+	{0, 0x099c, 0x10CC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD17},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x18},
+	{0, 0x0994, 0xECA0},
+	{0, 0x0996, 0xC4FD},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2120},
+	{0, 0x099c, 0x1ECC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD27},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0xDE},
+	{0, 0x0994, 0x1FEC},
+	{0, 0x0996, 0xA0BD},
+	{0, 0x0998, 0x7021},
+	{0, 0x099a, 0xCC3C},
+	{0, 0x099c, 0x5230},
+	{0, 0x099e, 0xED02},
+	{0, 0x098A, 0xD37},
+	{0, 0x0990, 0xCCFF},
+	{0, 0x0992, 0xFCED},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0x2},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x6DFC},
+	{0, 0x099c, 0x4E1},
+	{0, 0x099e, 0x1A83},
+	{0, 0x098A, 0xD47},
+	{0, 0x0990, 0x1},
+	{0, 0x0992, 0x2720},
+	{0, 0x0994, 0x1A83},
+	{0, 0x0996, 0x4},
+	{0, 0x0998, 0x271E},
+	{0, 0x099a, 0x1A83},
+	{0, 0x099c, 0x8},
+	{0, 0x099e, 0x271C},
+	{0, 0x098A, 0xD57},
+	{0, 0x0990, 0x1A83},
+	{0, 0x0992, 0x10},
+	{0, 0x0994, 0x271A},
+	{0, 0x0996, 0x1A83},
+	{0, 0x0998, 0x20},
+	{0, 0x099a, 0x2718},
+	{0, 0x099c, 0x1A83},
+	{0, 0x099e, 0x40},
+	{0, 0x098A, 0xD67},
+	{0, 0x0990, 0x2716},
+	{0, 0x0992, 0x2019},
+	{0, 0x0994, 0xC61E},
+	{0, 0x0996, 0x2012},
+	{0, 0x0998, 0xC622},
+	{0, 0x099a, 0x200E},
+	{0, 0x099c, 0xC621},
+	{0, 0x099e, 0x200A},
+	{0, 0x098A, 0xD77},
+	{0, 0x0990, 0xC620},
+	{0, 0x0992, 0x2006},
+	{0, 0x0994, 0xC62A},
+	{0, 0x0996, 0x2002},
+	{0, 0x0998, 0xC62B},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x8CC},
+	{0, 0x099e, 0x3400},
+	{0, 0x098A, 0xD87},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x34},
+	{0, 0x0994, 0xBD6F},
+	{0, 0x0996, 0xD184},
+	{0, 0x0998, 0x330},
+	{0, 0x099a, 0xED07},
+	{0, 0x099c, 0xA60A},
+	{0, 0x099e, 0x4848},
+	{0, 0x098A, 0xD97},
+	{0, 0x0990, 0x5FED},
+	{0, 0x0992, 0x5EA},
+	{0, 0x0994, 0x8AA},
+	{0, 0x0996, 0x731},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2130},
+	{0, 0x099c, 0xC60A},
+	{0, 0x099e, 0x3A35},
+	{0, 0x098A, 0xDA7},
+	{0, 0x0990, 0x3937},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C34},
+	{0, 0x0996, 0xDE2F},
+	{0, 0x0998, 0xEE0E},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x7D13},
+	{0, 0x099e, 0xEF27},
+	{0, 0x098A, 0xDB7},
+	{0, 0x0990, 0x7CCE},
+	{0, 0x0992, 0x13E0},
+	{0, 0x0994, 0x1E05},
+	{0, 0x0996, 0x1060},
+	{0, 0x0998, 0xE60E},
+	{0, 0x099a, 0x4FC3},
+	{0, 0x099c, 0x13F0},
+	{0, 0x099e, 0x8FE6},
+	{0, 0x098A, 0xDC7},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0xE107},
+	{0, 0x0994, 0x2216},
+	{0, 0x0996, 0xF613},
+	{0, 0x0998, 0xEE4F},
+	{0, 0x099a, 0xC313},
+	{0, 0x099c, 0xF38F},
+	{0, 0x099e, 0xE600},
+	{0, 0x098A, 0xDD7},
+	{0, 0x0990, 0x30E1},
+	{0, 0x0992, 0x725},
+	{0, 0x0994, 0x7F6},
+	{0, 0x0996, 0x13EE},
+	{0, 0x0998, 0xC103},
+	{0, 0x099a, 0x253C},
+	{0, 0x099c, 0x7F13},
+	{0, 0x099e, 0xEEF6},
+	{0, 0x098A, 0xDE7},
+	{0, 0x0990, 0x13EF},
+	{0, 0x0992, 0xE706},
+	{0, 0x0994, 0xCC13},
+	{0, 0x0996, 0xF0ED},
+	{0, 0x0998, 0x4CC},
+	{0, 0x099a, 0x13F3},
+	{0, 0x099c, 0x200F},
+	{0, 0x099e, 0x7C13},
+	{0, 0x098A, 0xDF7},
+	{0, 0x0990, 0xEEEC},
+	{0, 0x0992, 0x4C3},
+	{0, 0x0994, 0x1},
+	{0, 0x0996, 0xED04},
+	{0, 0x0998, 0xEC02},
+	{0, 0x099a, 0xC300},
+	{0, 0x099c, 0x1ED},
+	{0, 0x099e, 0x2F6},
+	{0, 0x098A, 0xE07},
+	{0, 0x0990, 0x13EE},
+	{0, 0x0992, 0xE106},
+	{0, 0x0994, 0x2412},
+	{0, 0x0996, 0xEE04},
+	{0, 0x0998, 0xE600},
+	{0, 0x099a, 0x30E1},
+	{0, 0x099c, 0x722},
+	{0, 0x099e, 0xDFEE},
+	{0, 0x098A, 0xE17},
+	{0, 0x0990, 0x2E6},
+	{0, 0x0992, 0x30},
+	{0, 0x0994, 0xE107},
+	{0, 0x0996, 0x25D6},
+	{0, 0x0998, 0xDE49},
+	{0, 0x099a, 0xEE08},
+	{0, 0x099c, 0xAD00},
+	{0, 0x099e, 0xCC13},
+	{0, 0x098A, 0xE27},
+	{0, 0x0990, 0xF630},
+	{0, 0x0992, 0xED00},
+	{0, 0x0994, 0xDE2F},
+	{0, 0x0996, 0xEE10},
+	{0, 0x0998, 0xCC13},
+	{0, 0x099a, 0xFAAD},
+	{0, 0x099c, 0x38},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0xE37},
+	{0, 0x0990, 0x3839},
+	{0, 0x098A, 0x1000},
+	{0, 0x0990, 0xCC10},
+	{0, 0x0992, 0x9BD},
+	{0, 0x0994, 0x4224},
+	{0, 0x0996, 0x7E10},
+	{0, 0x0998, 0x9C6},
+	{0, 0x099a, 0x1F7},
+	{0, 0x099c, 0x18A},
+	{0, 0x099e, 0xC606},
+	{0, 0x098A, 0x1010},
+	{0, 0x0990, 0xF701},
+	{0, 0x0992, 0x8BDE},
+	{0, 0x0994, 0x3F18},
+	{0, 0x0996, 0xCE0B},
+	{0, 0x0998, 0xF1CC},
+	{0, 0x099a, 0x11},
+	{0, 0x099c, 0xBDD7},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0x1020},
+	{0, 0x0990, 0xBF1},
+	{0, 0x0992, 0xDD3F},
+	{0, 0x0994, 0xDE35},
+	{0, 0x0996, 0x18CE},
+	{0, 0x0998, 0xC03},
+	{0, 0x099a, 0xCC00},
+	{0, 0x099c, 0x3FBD},
+	{0, 0x099e, 0xD700},
+	{0, 0x098A, 0x1030},
+	{0, 0x0990, 0xCC0C},
+	{0, 0x0992, 0x3DD},
+	{0, 0x0994, 0x35DE},
+	{0, 0x0996, 0x4718},
+	{0, 0x0998, 0xCE0C},
+	{0, 0x099a, 0x43CC},
+	{0, 0x099c, 0x15},
+	{0, 0x099e, 0xBDD7},
+	{0, 0x098A, 0x1040},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0xC43},
+	{0, 0x0994, 0xDD47},
+	{0, 0x0996, 0xFE00},
+	{0, 0x0998, 0x3318},
+	{0, 0x099a, 0xCE0C},
+	{0, 0x099c, 0x59CC},
+	{0, 0x099e, 0x9},
+	{0, 0x098A, 0x1050},
+	{0, 0x0990, 0xBDD7},
+	{0, 0x0992, 0xCC},
+	{0, 0x0994, 0xC59},
+	{0, 0x0996, 0xFD00},
+	{0, 0x0998, 0x33DE},
+	{0, 0x099a, 0x4118},
+	{0, 0x099c, 0xCE0C},
+	{0, 0x099e, 0x63CC},
+	{0, 0x098A, 0x1060},
+	{0, 0x0990, 0xD},
+	{0, 0x0992, 0xBDD7},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0xC63},
+	{0, 0x0998, 0xDD41},
+	{0, 0x099a, 0xFE00},
+	{0, 0x099c, 0x3118},
+	{0, 0x099e, 0xCE0C},
+	{0, 0x098A, 0x1070},
+	{0, 0x0990, 0x71CC},
+	{0, 0x0992, 0x29},
+	{0, 0x0994, 0xBDD7},
+	{0, 0x0996, 0xCC},
+	{0, 0x0998, 0xC71},
+	{0, 0x099a, 0xFD00},
+	{0, 0x099c, 0x31DE},
+	{0, 0x099e, 0x3918},
+	{0, 0x098A, 0x1080},
+	{0, 0x0990, 0xCE0C},
+	{0, 0x0992, 0x9BCC},
+	{0, 0x0994, 0x23},
+	{0, 0x0996, 0xBDD7},
+	{0, 0x0998, 0xCC},
+	{0, 0x099a, 0xC9B},
+	{0, 0x099c, 0xDD39},
+	{0, 0x099e, 0xDE49},
+	{0, 0x098A, 0x1090},
+	{0, 0x0990, 0x18CE},
+	{0, 0x0992, 0xCBF},
+	{0, 0x0994, 0xCC00},
+	{0, 0x0996, 0xDBD},
+	{0, 0x0998, 0xD700},
+	{0, 0x099a, 0xCC0C},
+	{0, 0x099c, 0xBFDD},
+	{0, 0x099e, 0x49CC},
+	{0, 0x098A, 0x10A0},
+	{0, 0x0990, 0x1162},
+	{0, 0x0992, 0xFD0B},
+	{0, 0x0994, 0xFDCC},
+	{0, 0x0996, 0xCE7},
+	{0, 0x0998, 0xFD0C},
+	{0, 0x099a, 0x1FCC},
+	{0, 0x099c, 0x1245},
+	{0, 0x099e, 0xFD0C},
+	{0, 0x098A, 0x10B0},
+	{0, 0x0990, 0x51CC},
+	{0, 0x0992, 0x110B},
+	{0, 0x0994, 0xFD0C},
+	{0, 0x0996, 0x5BCC},
+	{0, 0x0998, 0x1108},
+	{0, 0x099a, 0xFD0C},
+	{0, 0x099c, 0x65CC},
+	{0, 0x099e, 0x10D0},
+	{0, 0x098A, 0x10C0},
+	{0, 0x0990, 0xFD0C},
+	{0, 0x0992, 0x7BCC},
+	{0, 0x0994, 0x12DE},
+	{0, 0x0996, 0xFD0C},
+	{0, 0x0998, 0xA7CC},
+	{0, 0x099a, 0xDA8},
+	{0, 0x099c, 0xFD0C},
+	{0, 0x099e, 0xCB39},
+	{0, 0x098A, 0x10D0},
+	{0, 0x0990, 0x37DE},
+	{0, 0x0992, 0x1DEC},
+	{0, 0x0994, 0xC5F},
+	{0, 0x0996, 0x8402},
+	{0, 0x0998, 0x4416},
+	{0, 0x099a, 0x4FF7},
+	{0, 0x099c, 0xCCD},
+	{0, 0x099e, 0xE60B},
+	{0, 0x098A, 0x10E0},
+	{0, 0x0990, 0xC407},
+	{0, 0x0992, 0xF70C},
+	{0, 0x0994, 0xCE7F},
+	{0, 0x0996, 0x30C4},
+	{0, 0x0998, 0xEC25},
+	{0, 0x099a, 0xFD30},
+	{0, 0x099c, 0xC5FC},
+	{0, 0x099e, 0x6D6},
+	{0, 0x098A, 0x10F0},
+	{0, 0x0990, 0xFD30},
+	{0, 0x0992, 0xC701},
+	{0, 0x0994, 0xFC30},
+	{0, 0x0996, 0xC0FD},
+	{0, 0x0998, 0xBED},
+	{0, 0x099a, 0xFC30},
+	{0, 0x099c, 0xC2FD},
+	{0, 0x099e, 0xBEF},
+	{0, 0x098A, 0x1100},
+	{0, 0x0990, 0x30E6},
+	{0, 0x0992, 0xBD},
+	{0, 0x0994, 0x5203},
+	{0, 0x0996, 0x3139},
+	{0, 0x0998, 0x7E9E},
+	{0, 0x099a, 0x143C},
+	{0, 0x099c, 0x3C3C},
+	{0, 0x099e, 0x2101},
+	{0, 0x098A, 0x1110},
+	{0, 0x0990, 0xCC00},
+	{0, 0x0992, 0x18BD},
+	{0, 0x0994, 0x6FD1},
+	{0, 0x0996, 0xC504},
+	{0, 0x0998, 0x26F5},
+	{0, 0x099a, 0xDC25},
+	{0, 0x099c, 0x30ED},
+	{0, 0x099e, 0x420},
+	{0, 0x098A, 0x1120},
+	{0, 0x0990, 0x12EE},
+	{0, 0x0992, 0x43C},
+	{0, 0x0994, 0x1838},
+	{0, 0x0996, 0xE621},
+	{0, 0x0998, 0x18E7},
+	{0, 0x099a, 0xBE30},
+	{0, 0x099c, 0xEE04},
+	{0, 0x099e, 0xEC1D},
+	{0, 0x098A, 0x1130},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x4EC},
+	{0, 0x0994, 0x426},
+	{0, 0x0996, 0xEACC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0xED02},
+	{0, 0x099c, 0xCCFB},
+	{0, 0x099e, 0xFFED},
+	{0, 0x098A, 0x1140},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0x400},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6DCC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x2CC},
+	{0, 0x099e, 0xFBFF},
+	{0, 0x098A, 0x1150},
+	{0, 0x0990, 0xED00},
+	{0, 0x0992, 0x5F4F},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6D5F},
+	{0, 0x0998, 0xBD5B},
+	{0, 0x099a, 0x17BD},
+	{0, 0x099c, 0x558B},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0x1160},
+	{0, 0x0990, 0x3839},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0xC640},
+	{0, 0x0996, 0xF730},
+	{0, 0x0998, 0xC4FC},
+	{0, 0x099a, 0xBED},
+	{0, 0x099c, 0xFD30},
+	{0, 0x099e, 0xC0FC},
+	{0, 0x098A, 0x1170},
+	{0, 0x0990, 0xBEF},
+	{0, 0x0992, 0xFD30},
+	{0, 0x0994, 0xC2DE},
+	{0, 0x0996, 0x1DEC},
+	{0, 0x0998, 0x25FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1180},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xD6EC},
+	{0, 0x0996, 0xC5F},
+	{0, 0x0998, 0x8402},
+	{0, 0x099a, 0x4416},
+	{0, 0x099c, 0x4F30},
+	{0, 0x099e, 0xE703},
+	{0, 0x098A, 0x1190},
+	{0, 0x0990, 0xF10C},
+	{0, 0x0992, 0xCD27},
+	{0, 0x0994, 0x15F1},
+	{0, 0x0996, 0xCCD},
+	{0, 0x0998, 0x2309},
+	{0, 0x099a, 0xFC06},
+	{0, 0x099c, 0xD604},
+	{0, 0x099e, 0xFD06},
+	{0, 0x098A, 0x11A0},
+	{0, 0x0990, 0xD620},
+	{0, 0x0992, 0x7FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0x5FD},
+	{0, 0x0998, 0x6D6},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xE60B},
+	{0, 0x099e, 0xC407},
+	{0, 0x098A, 0x11B0},
+	{0, 0x0990, 0x30E7},
+	{0, 0x0992, 0x2F1},
+	{0, 0x0994, 0xCCE},
+	{0, 0x0996, 0x272C},
+	{0, 0x0998, 0x7D0C},
+	{0, 0x099a, 0xCE27},
+	{0, 0x099c, 0x275D},
+	{0, 0x099e, 0x2724},
+	{0, 0x098A, 0x11C0},
+	{0, 0x0990, 0x7F30},
+	{0, 0x0992, 0xC4FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0xFD30},
+	{0, 0x0998, 0xC5F6},
+	{0, 0x099a, 0xCCE},
+	{0, 0x099c, 0x4FFD},
+	{0, 0x099e, 0x30C7},
+	{0, 0x098A, 0x11D0},
+	{0, 0x0990, 0xC640},
+	{0, 0x0992, 0xF730},
+	{0, 0x0994, 0xC4E6},
+	{0, 0x0996, 0x24F},
+	{0, 0x0998, 0xFD30},
+	{0, 0x099a, 0xC501},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x11E0},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0x7D06},
+	{0, 0x0996, 0xCB27},
+	{0, 0x0998, 0x2EC6},
+	{0, 0x099a, 0x40F7},
+	{0, 0x099c, 0x30C4},
+	{0, 0x099e, 0xFC06},
+	{0, 0x098A, 0x11F0},
+	{0, 0x0990, 0xC104},
+	{0, 0x0992, 0xF306},
+	{0, 0x0994, 0xD6ED},
+	{0, 0x0996, 0x5F},
+	{0, 0x0998, 0x6D00},
+	{0, 0x099a, 0x2A01},
+	{0, 0x099c, 0x5317},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1200},
+	{0, 0x0990, 0xC0EC},
+	{0, 0x0992, 0xFD},
+	{0, 0x0994, 0x30C2},
+	{0, 0x0996, 0xFC06},
+	{0, 0x0998, 0xC1FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1210},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xC720},
+	{0, 0x0996, 0x227F},
+	{0, 0x0998, 0x30C4},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xEC25},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1220},
+	{0, 0x0990, 0xC5FC},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0xFD30},
+	{0, 0x0996, 0xC701},
+	{0, 0x0998, 0xFC30},
+	{0, 0x099a, 0xC0FD},
+	{0, 0x099c, 0x6D0},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x1230},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D2},
+	{0, 0x0994, 0xEC25},
+	{0, 0x0996, 0xFD06},
+	{0, 0x0998, 0xC3BD},
+	{0, 0x099a, 0x953C},
+	{0, 0x099c, 0xDE3F},
+	{0, 0x099e, 0xEE10},
+	{0, 0x098A, 0x1240},
+	{0, 0x0990, 0xAD00},
+	{0, 0x0992, 0x3838},
+	{0, 0x0994, 0x3930},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0xFFE9},
+	{0, 0x099a, 0x8F35},
+	{0, 0x099c, 0xBDAD},
+	{0, 0x099e, 0x1530},
+	{0, 0x098A, 0x1250},
+	{0, 0x0990, 0x6F16},
+	{0, 0x0992, 0x18DE},
+	{0, 0x0994, 0x1918},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0x14B},
+	{0, 0x099a, 0x188F},
+	{0, 0x099c, 0x18EC},
+	{0, 0x099e, 0xFD},
+	{0, 0x098A, 0x1260},
+	{0, 0x0990, 0x50E},
+	{0, 0x0992, 0x18EC},
+	{0, 0x0994, 0x2FD},
+	{0, 0x0996, 0x510},
+	{0, 0x0998, 0xE616},
+	{0, 0x099a, 0x4FED},
+	{0, 0x099c, 0x418},
+	{0, 0x099e, 0x8FC3},
+	{0, 0x098A, 0x1270},
+	{0, 0x0990, 0xFFCB},
+	{0, 0x0992, 0xE304},
+	{0, 0x0994, 0x8FE6},
+	{0, 0x0996, 0xF7},
+	{0, 0x0998, 0x514},
+	{0, 0x099a, 0x18DE},
+	{0, 0x099c, 0x1930},
+	{0, 0x099e, 0xE616},
+	{0, 0x098A, 0x1280},
+	{0, 0x0990, 0x4FED},
+	{0, 0x0992, 0x418},
+	{0, 0x0994, 0x8FC3},
+	{0, 0x0996, 0x119},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FE6},
+	{0, 0x099c, 0xF7},
+	{0, 0x099e, 0x515},
+	{0, 0x098A, 0x1290},
+	{0, 0x0990, 0xFC05},
+	{0, 0x0992, 0x5BFD},
+	{0, 0x0994, 0x512},
+	{0, 0x0996, 0xDE37},
+	{0, 0x0998, 0xEE08},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x30E6},
+	{0, 0x099e, 0x164F},
+	{0, 0x098A, 0x12A0},
+	{0, 0x0990, 0x5ED},
+	{0, 0x0992, 0x48F},
+	{0, 0x0994, 0xC300},
+	{0, 0x0996, 0x630},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FF6},
+	{0, 0x099c, 0x516},
+	{0, 0x099e, 0x4FED},
+	{0, 0x098A, 0x12B0},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0x6C16},
+	{0, 0x0994, 0xE616},
+	{0, 0x0996, 0xC103},
+	{0, 0x0998, 0x2598},
+	{0, 0x099a, 0xCC32},
+	{0, 0x099c, 0x8EED},
+	{0, 0x099e, 0xEC},
+	{0, 0x098A, 0x12C0},
+	{0, 0x0990, 0x6BD},
+	{0, 0x0992, 0x7021},
+	{0, 0x0994, 0xCC32},
+	{0, 0x0996, 0x6C30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCF8},
+	{0, 0x099c, 0xED},
+	{0, 0x099e, 0xA6},
+	{0, 0x098A, 0x12D0},
+	{0, 0x0990, 0x9E3},
+	{0, 0x0992, 0xA84},
+	{0, 0x0994, 0x7BD},
+	{0, 0x0996, 0x706D},
+	{0, 0x0998, 0x30C6},
+	{0, 0x099a, 0x173A},
+	{0, 0x099c, 0x3539},
+	{0, 0x099e, 0x3CBD},
+	{0, 0x098A, 0x12E0},
+	{0, 0x0990, 0x776D},
+	{0, 0x0992, 0xCC32},
+	{0, 0x0994, 0x5C30},
+	{0, 0x0996, 0xED00},
+	{0, 0x0998, 0xFC13},
+	{0, 0x099a, 0x8683},
+	{0, 0x099c, 0x1},
+	{0, 0x099e, 0xBD70},
+	{0, 0x098A, 0x12F0},
+	{0, 0x0990, 0x21CC},
+	{0, 0x0992, 0x325E},
+	{0, 0x0994, 0x30ED},
+	{0, 0x0996, 0xFC},
+	{0, 0x0998, 0x1388},
+	{0, 0x099a, 0x8300},
+	{0, 0x099c, 0x1BD},
+	{0, 0x099e, 0x7021},
+	{0, 0x098A, 0x1300},
+	{0, 0x0990, 0x3839},
+	{0, 0x098E, 0x0010},
+	{0, 0x0990, 0x1000},
+	{0, 0x098E, 0x0003},
+	{100, 0x0990, 0x0004}
+};
+
+mt9t111_regs def_regs1[] = {
+	{0, 0x001A, 0x0218},
+	{0, 0x001E, 0x0777},
+	{0, 0x3084, 0x2409},
+	{0, 0x3092, 0x0A49},
+	{0, 0x3094, 0x4949},
+	{0, 0x3096, 0x4950},
+	{0, 0x0018, 0x402D},
+	{100, 0x0018, 0x402C},
+	{0, 0x098E, 0x6800},
+	{0, 0x0990, 0x0280},
+	{0, 0x098E, 0x6802},
+	{0, 0x0990, 0x01E0},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x4802},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4804},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4806},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4808},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x480A},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x480C},
+	{0, 0x0990, 0x046C},
+	{0, 0x098E, 0x480F},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4811},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x4813},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x481D},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x481F},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x4825},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0x6C00},
+	{0, 0x0990, 0x0800},
+	{0, 0x098E, 0x6C02},
+	{0, 0x0990, 0x0600},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x484A},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484C},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484E},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4850},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x4852},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x4854},
+	{0, 0x0990, 0x146C},
+	{0, 0x098E, 0x4857},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4859},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x485B},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x4865},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x4867},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x486D},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0xC8A5},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC8A6},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC8A7},
+	{0, 0x0990, 0x0023},
+	{0, 0x098E, 0xC8A8},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC844},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC92F},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC845},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92D},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88C},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC930},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88D},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xA002},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xA009},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0xA00A},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xA00C},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x4846},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x68AA},
+	{0, 0x0990, 0x0278},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x6CAA},
+	{0, 0x0990, 0x0218},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0005},
+	{0, 0x3C20, 0x0001},
+	{0, 0x364A, 0x7D2F},
+	{0, 0x364C, 0x79EB},
+	{0, 0x364E, 0x18D2},
+	{0, 0x3650, 0x9F8F},
+	{0, 0x3652, 0xA7D2},
+	{0, 0x368A, 0x460C},
+	{0, 0x368C, 0x14F0},
+	{0, 0x368E, 0x946F},
+	{0, 0x3690, 0xC471},
+	{0, 0x3692, 0x04B1},
+	{0, 0x36CA, 0x0433},
+	{0, 0x36CC, 0x680D},
+	{0, 0x36CE, 0xEEF3},
+	{0, 0x36D0, 0x4850},
+	{0, 0x36D2, 0xF233},
+	{0, 0x370A, 0xB2AF},
+	{0, 0x370C, 0x2CF0},
+	{0, 0x370E, 0x3F10},
+	{0, 0x3710, 0xC673},
+	{0, 0x3712, 0xA972},
+	{0, 0x374A, 0x0590},
+	{0, 0x374C, 0xAFB3},
+	{0, 0x374E, 0x93D7},
+	{0, 0x3750, 0x8D12},
+	{0, 0x3752, 0x2539},
+	{0, 0x3640, 0x0350},
+	{0, 0x3642, 0x322C},
+	{0, 0x3644, 0x77D1},
+	{0, 0x3646, 0xA26F},
+	{0, 0x3648, 0xC872},
+	{0, 0x3680, 0x0C4C},
+	{0, 0x3682, 0x9510},
+	{0, 0x3684, 0x110E},
+	{0, 0x3686, 0x4331},
+	{0, 0x3688, 0xC1CF},
+	{0, 0x36C0, 0x6152},
+	{0, 0x36C2, 0x038E},
+	{0, 0x36C4, 0x9AF4},
+	{0, 0x36C6, 0xE12F},
+	{0, 0x36C8, 0x09F3},
+	{0, 0x3700, 0xC5AF},
+	{0, 0x3702, 0xCA90},
+	{0, 0x3704, 0x5D0F},
+	{0, 0x3706, 0x3293},
+	{0, 0x3708, 0x2B92},
+	{0, 0x3740, 0xC590},
+	{0, 0x3742, 0x8133},
+	{0, 0x3744, 0xE0F6},
+	{0, 0x3746, 0x0254},
+	{0, 0x3748, 0x10B9},
+	{0, 0x3654, 0x7F8F},
+	{0, 0x3656, 0x6F6C},
+	{0, 0x3658, 0x5971},
+	{0, 0x365A, 0x9A0F},
+	{0, 0x365C, 0xA1B2},
+	{0, 0x3694, 0xB00C},
+	{0, 0x3696, 0xEBCF},
+	{0, 0x3698, 0x06AD},
+	{0, 0x369A, 0x4D31},
+	{0, 0x369C, 0x2A4E},
+	{0, 0x36D4, 0x4752},
+	{0, 0x36D6, 0x724D},
+	{0, 0x36D8, 0xAD34},
+	{0, 0x36DA, 0x1350},
+	{0, 0x36DC, 0x4E94},
+	{0, 0x3714, 0xA06E},
+	{0, 0x3716, 0x9152},
+	{0, 0x3718, 0x1F53},
+	{0, 0x371A, 0x3933},
+	{0, 0x371C, 0xBA94},
+	{0, 0x3754, 0x1233},
+	{0, 0x3756, 0xA032},
+	{0, 0x3758, 0xE936},
+	{0, 0x375A, 0xBE34},
+	{0, 0x375C, 0x02D9},
+	{0, 0x365E, 0x7DEF},
+	{0, 0x3660, 0x434B},
+	{0, 0x3662, 0x69F1},
+	{0, 0x3664, 0x8A0F},
+	{0, 0x3666, 0xBDB2},
+	{0, 0x369E, 0x290D},
+	{0, 0x36A0, 0x42CF},
+	{0, 0x36A2, 0xDC6D},
+	{0, 0x36A4, 0x91B1},
+	{0, 0x36A6, 0x9DE9},
+	{0, 0x36DE, 0x70B2},
+	{0, 0x36E0, 0x02AC},
+	{0, 0x36E2, 0x9714},
+	{0, 0x36E4, 0xF3CF},
+	{0, 0x36E6, 0x6BD1},
+	{0, 0x371E, 0xE42E},
+	{0, 0x3720, 0x1D32},
+	{0, 0x3722, 0xCC31},
+	{0, 0x3724, 0xAE94},
+	{0, 0x3726, 0x6413},
+	{0, 0x375E, 0xE290},
+	{0, 0x3760, 0x8F53},
+	{0, 0x3762, 0xF936},
+	{0, 0x3764, 0x4614},
+	{0, 0x3766, 0x1B59},
+	{0, 0x3784, 0x0404},
+	{0, 0x3782, 0x0304},
+	{0, 0x3210, 0x01B8},
+	{0, 0x098E, 0xC913},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x686B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x686D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x6C6B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x6C6D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x3439},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x343B},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x4926},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4928},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x492A},
+	{0, 0x0990, 0x0656},
+	{0, 0x098E, 0x4D26},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4D28},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x4D2A},
+	{0, 0x0990, 0x0656},
+	{0, 0x33F4, 0x040B},
+	{0, 0x098E, 0xC916},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC919},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xC917},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC918},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC91A},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0xC91B},
+	{0, 0x0990, 0x0009},
+	{0, 0x326C, 0x0C00},
+	{0, 0x098E, 0x494B},
+	{0, 0x0990, 0x0042},
+	{0, 0x098E, 0x494D},
+	{0, 0x0990, 0x012C},
+	{0, 0x098E, 0xC91E},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC91F},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC920},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC921},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC922},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC923},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xC924},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC925},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xBC02},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xBC05},
+	{0, 0x0990, 0x000E},
+	{0, 0x098E, 0xC950},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC94F},
+	{0, 0x0990, 0x0038},
+	{0, 0x098E, 0xC952},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC951},
+	{0, 0x0990, 0x0051},
+	{0, 0x098E, 0xC954},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC953},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC956},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC955},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC958},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC957},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC95A},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC959},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC95C},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95B},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95E},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95D},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95F},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0x48DC},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48DE},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E0},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E2},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48E4},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E6},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E8},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48EA},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48EC},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xDC2A},
+	{0, 0x0990, 0x000B},
+	{0, 0x098E, 0xDC2B},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0xBC0B},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC0C},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC0D},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC0E},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC0F},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC10},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC11},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC12},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC13},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC14},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC15},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC16},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC17},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC18},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC19},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC1A},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC1B},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC1C},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC1D},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC1E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC1F},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC20},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC21},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC22},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC23},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC24},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC25},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC26},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC27},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC28},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC29},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC2A},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC2B},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC2C},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC2D},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC2E},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC2F},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC30},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC31},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC32},
+	{0, 0x0990, 0x000D},
+	{0, 0x098E, 0xBC33},
+	{0, 0x0990, 0x0019},
+	{0, 0x098E, 0xBC34},
+	{0, 0x0990, 0x0030},
+	{0, 0x098E, 0xBC35},
+	{0, 0x0990, 0x0056},
+	{0, 0x098E, 0xBC36},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC37},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC38},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC39},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC3A},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC3B},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC3C},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC3D},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC3E},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC3F},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC40},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC41},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC42},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC43},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0x6865},
+	{0, 0x0990, 0x00E0},
+	{0, 0x098E, 0x6867},
+	{0, 0x0990, 0x00F4},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xBC4A},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4B},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4C},
+	{0, 0x0990, 0x007F},
+	{0, 0x3542, 0x0010},
+	{0, 0x3544, 0x0030},
+	{0, 0x3546, 0x0040},
+	{0, 0x3548, 0x0080},
+	{0, 0x354A, 0x0100},
+	{0, 0x354C, 0x0200},
+	{0, 0x354E, 0x0300},
+	{0, 0x3550, 0x0010},
+	{0, 0x3552, 0x0030},
+	{0, 0x3554, 0x0040},
+	{0, 0x3556, 0x0080},
+	{0, 0x3558, 0x012C},
+	{0, 0x355A, 0x0320},
+	{0, 0x355C, 0x03E8},
+	{0, 0x3560, 0x0040},
+	{0, 0x3562, 0x0020},
+	{0, 0x3564, 0x0040},
+	{0, 0x3566, 0x0010},
+	{0, 0x3568, 0x0008},
+	{0, 0x356A, 0x0004},
+	{0, 0x356C, 0x0004},
+	{0, 0x356E, 0x0004},
+	{0, 0x098E, 0x3C4D},
+	{0, 0x0990, 0x0DAC},
+	{0, 0x098E, 0x3C4F},
+	{0, 0x0990, 0x148A},
+	{0, 0x098E, 0xC911},
+	{0, 0x0990, 0x00C8},
+	{0, 0x098E, 0xC8F4},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC8F5},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x48F6},
+	{0, 0x0990, 0x3B4D},
+	{0, 0x098E, 0x48F8},
+	{0, 0x0990, 0x6380},
+	{0, 0x098E, 0x48FA},
+	{0, 0x0990, 0x9B18},
+	{0, 0x098E, 0x48FC},
+	{0, 0x0990, 0x5D51},
+	{0, 0x098E, 0x48FE},
+	{0, 0x0990, 0xEDE8},
+	{0, 0x098E, 0x4900},
+	{0, 0x0990, 0xE515},
+	{0, 0x098E, 0x4902},
+	{0, 0x0990, 0xBFF4},
+	{0, 0x098E, 0x4904},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0x4906},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0x4908},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0xE84A},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84D},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84C},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0xE84F},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x48B0},
+	{0, 0x0990, 0x0180},
+	{0, 0x098E, 0x48B2},
+	{0, 0x0990, 0xFF7A},
+	{0, 0x098E, 0x48B4},
+	{0, 0x0990, 0x0018},
+	{0, 0x098E, 0x48B6},
+	{0, 0x0990, 0xFFCA},
+	{0, 0x098E, 0x48B8},
+	{0, 0x0990, 0x017C},
+	{0, 0x098E, 0x48BA},
+	{0, 0x0990, 0xFFCC},
+	{0, 0x098E, 0x48BC},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0x48BE},
+	{0, 0x0990, 0xFF1F},
+	{0, 0x098E, 0x48C0},
+	{0, 0x0990, 0x01E8},
+	{0, 0x098E, 0x48C2},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x48C4},
+	{0, 0x0990, 0x0044},
+	{0, 0x098E, 0x48C6},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0x48C8},
+	{0, 0x0990, 0xFFAD},
+	{0, 0x098E, 0x48CA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x098E, 0x48CC},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0x48CE},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0x48D0},
+	{0, 0x0990, 0xFFAA},
+	{0, 0x098E, 0x48D2},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0x48D4},
+	{0, 0x0990, 0x004B},
+	{0, 0x098E, 0x48D6},
+	{0, 0x0990, 0xFFA5},
+	{0, 0x098E, 0x48D8},
+	{0, 0x0990, 0x0015},
+	{0, 0x098E, 0x48DA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x35A2, 0x0014},
+	{0, 0x098E, 0xC949},
+	{0, 0x0990, 0x0024},
+	{0, 0x35A4, 0x0596},
+	{0, 0x098E, 0xC94A},
+	{0, 0x0990, 0x0062},
+	{0, 0x098E, 0xC948},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xC914},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC915},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xE86F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xE870},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xEC6F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xEC70},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xE883},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC83},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE885},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xE886},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xEC85},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xEC86},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xE884},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0xEC84},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0x490A},
+	{0, 0x0990, 0x0666},
+	{0, 0x098E, 0x490C},
+	{0, 0x0990, 0x0140},
+	{0, 0x098E, 0x6857},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x685C},
+	{0, 0x0990, 0x0005},
+	{0, 0x098E, 0x490E},
+	{0, 0x0990, 0x00A4},
+	{0, 0x098E, 0xB43D},
+	{0, 0x0990, 0x0031},
+	{0, 0x098E, 0xB43E},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xB43F},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xB440},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xB441},
+	{0, 0x0990, 0x00CD},
+	{0, 0x098E, 0xB442},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xB443},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0xB444},
+	{0, 0x0990, 0x0007},
+	{0, 0x098E, 0x300D},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0x3017},
+	{0, 0x0990, 0x0F0F},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE81F},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x70A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x74A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x3C52, 0x082E},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xECAC},
+	{0, 0x0990, 0x0000}
+};
+
+mt9t111_regs def_regs2[] = {
+	{100, 0x0018, 0x0028},
+	{0, 0x316C, 0x350F},
+	{0, 0x098E, 0x6817},
+	{0, 0x0990, 0x000C},
+	{0, 0x0034, 0x0000}
+};
+
+mt9t111_regs pll_regs1[] = {
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2145},
+	{0, 0x0010, 0x0219},
+	{0, 0x0012, 0x0090},
+	{0, 0x002A, 0x79DD},
+	{0, 0x0014, 0x2545},
+	{0, 0x0014, 0x2547},
+	{0, 0x0014, 0x3447},
+	{0, 0x0014, 0x3047}
+};
+
+mt9t111_regs pll_regs2[] = {
+	{0, 0x0014, 0x3046},
+	{0, 0x0022, 0x01E0},
+	{0, 0x001E, 0x0707},
+	{0, 0x3B84, 0x011D}
+};
+
+mt9t111_regs bayer_pattern_regs[] = {
+	{0, 0x098E, 0x6807},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6809},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6C07},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6C09},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000}
+};
+
+#endif
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
index 32114a3..aba49e2 100644
--- a/drivers/media/video/mt9t112.c
+++ b/drivers/media/video/mt9t112.c
@@ -24,12 +24,16 @@
 #include <linux/slab.h>
 #include <linux/v4l2-mediabus.h>
 #include <linux/videodev2.h>
+#include <linux/regulator/consumer.h>
 
 #include <media/mt9t112.h>
+#include <media/mt9t111.h>
 #include <media/soc_camera.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-common.h>
 
+#include "mt9t111_reg.h"
+
 /* you can check PLL/clock info */
 /* #define EXT_CLOCK 24000000 */
 
@@ -88,11 +92,15 @@ struct mt9t112_format {
 struct mt9t112_priv {
 	struct v4l2_subdev		 subdev;
 	struct mt9t112_camera_info	*info;
+	struct media_pad		pad;
 	struct i2c_client		*client;
 	struct v4l2_rect		 frame;
 	const struct mt9t112_format	*format;
+	struct v4l2_mbus_framefmt	fmt;
 	int				 model;
 	u32				 flags;
+	struct regulator		*omap3evm_1v8;
+	struct regulator		*omap3evm_2v8;
 /* for flags */
 #define INIT_DONE	(1 << 0)
 #define PCLK_RISING	(1 << 1)
@@ -206,6 +214,33 @@ static int __mt9t112_reg_write(const struct i2c_client *client,
 	return ret;
 }
 
+static int mt9t111_write_regs(struct i2c_client *client,
+				mt9t111_regs *reg_in, int cnt)
+{
+	int err = 0, i;
+	mt9t111_regs *reg = reg_in;
+
+	for (i = 0; i < cnt; i++) {
+		if (reg->delay_time == 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+		} else if (reg->addr != 0 || reg->data != 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+			mdelay(reg->delay_time);
+		} else {
+			mdelay(reg->delay_time);
+		}
+		if (err < 0) {
+			dev_warn(&client->dev, "write reg error, addr = 0x%x,"
+					"data = 0x%x\n",
+					reg->addr, reg->data);
+			return err;
+		}
+		reg++;
+	}
+
+	return err;
+}
+
 static int __mt9t112_reg_mask_set(const struct i2c_client *client,
 				  u16  command,
 				  u16  mask,
@@ -733,6 +768,82 @@ static int mt9t112_init_camera(const struct i2c_client *client)
 	return ret;
 }
 
+static int mt9t111_configure(struct v4l2_subdev *subdev)
+{
+	int i, ret = 0;
+	unsigned short value;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x001D);
+	if (ret)
+		goto out;
+
+	msleep(1);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x0018);
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, pll_regs1,
+			sizeof(pll_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_read(value, client, 0x0014);
+		if ((value & 0x8000) != 0)
+			break;
+		mdelay(2);
+	}
+
+	ret = mt9t111_write_regs(client, pll_regs2,
+			sizeof(pll_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs1,
+			sizeof(def_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, patch_rev6,
+			sizeof(patch_rev6) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs2,
+			sizeof(def_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	/* MCU_ADDRESS [SEQ_CMD] -- refresh mode */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0006);
+	if (ret)
+		goto out;
+
+	/* refresh command */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0005);
+	if (ret)
+		goto out;
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+		if (ret)
+			break;
+		mt9t112_reg_read(value , client, 0x0990);
+		if (value == 0)
+			break;
+		mdelay(5);
+	}
+out:
+	return ret;
+}
+
 /************************************************************************
 			v4l2_subdev_core_ops
 ************************************************************************/
@@ -775,15 +886,72 @@ static int mt9t112_s_register(struct v4l2_subdev *sd,
 }
 #endif
 
+static int omap3evm_regulator_ctrl(struct mt9t112_priv *priv, u32 on)
+{
+	if (!(priv->omap3evm_1v8) || !(priv->omap3evm_2v8)) {
+		printk(KERN_ERR "No regulator available\n");
+		return -ENODEV;
+	}
+	if (on) {
+		regulator_enable(priv->omap3evm_1v8);
+		mdelay(1);
+		regulator_enable(priv->omap3evm_2v8);
+		mdelay(50);
+	} else {
+		if (regulator_is_enabled(priv->omap3evm_1v8))
+			regulator_disable(priv->omap3evm_1v8);
+		if (regulator_is_enabled(priv->omap3evm_2v8))
+			regulator_disable(priv->omap3evm_2v8);
+	}
+	return 0;
+}
+
+static int mt9t111_s_power(struct v4l2_subdev *subdev, int on)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+	struct mt9t111_platform_data  *pdata;
+	int rval;
+
+	pdata = (struct mt9t111_platform_data *) icl;
+	if (on) {
+		rval = omap3evm_regulator_ctrl(priv, on);
+		if (rval)
+			goto out;
+
+		rval = pdata->s_power(subdev, 1);
+		if (rval)
+			goto out;
+
+		rval = mt9t111_configure(subdev);
+		if (rval) {
+			pdata->s_power(subdev, 0);
+			goto out;
+	}
+
+	} else {
+		rval = pdata->s_power(subdev, 0);
+		if (rval)
+			goto out;
+	}
+
+out:
+	if (rval)
+		v4l_err(client, "Unable to set target power state\n");
+
+	return rval;
+}
+
 static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
 	.g_chip_ident	= mt9t112_g_chip_ident,
+	.s_power	= mt9t111_s_power,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-	.g_register	= mt9t112_g_register,
-	.s_register	= mt9t112_s_register,
+	.g_register     = mt9t112_g_register,
+	.s_register     = mt9t112_s_register,
 #endif
 };
 
-
 /************************************************************************
 			v4l2_subdev_video_ops
 ************************************************************************/
@@ -793,51 +961,56 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable)
 	struct mt9t112_priv *priv = to_mt9t112(client);
 	int ret = 0;
 
-	if (!enable) {
-		/* FIXME
-		 *
-		 * If user selected large output size,
-		 * and used it long time,
-		 * mt9t112 camera will be very warm.
-		 *
-		 * But current driver can not stop mt9t112 camera.
-		 * So, set small size here to solve this problem.
-		 */
-		mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+	if (priv->model == V4L2_IDENT_MT9T111) {
 		return ret;
-	}
 
-	if (!(priv->flags & INIT_DONE)) {
-		u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
+	} else {
+		if (!enable) {
+			/* FIXME
+			 *
+			 * If user selected large output size,
+			 * and used it long time,
+			 * mt9t112 camera will be very warm.
+			 *
+			 * But current driver can not stop mt9t112 camera.
+			 * So, set small size here to solve this problem.
+			 */
+			mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+			return ret;
+		}
 
-		ECHECKER(ret, mt9t112_init_camera(client));
+		if (!(priv->flags & INIT_DONE)) {
+			u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
 
-		/* Invert PCLK (Data sampled on falling edge of pixclk) */
-		mt9t112_reg_write(ret, client, 0x3C20, param);
+			ECHECKER(ret, mt9t112_init_camera(client));
 
-		mdelay(5);
+			/* Invert PCLK (Data sampled on falling edge of pixclk) */
+			mt9t112_reg_write(ret, client, 0x3C20, param);
 
-		priv->flags |= INIT_DONE;
-	}
+			mdelay(5);
 
-	mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
-	mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
-	mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
+			priv->flags |= INIT_DONE;
+		}
 
-	mt9t112_set_a_frame_size(client,
-				 priv->frame.width,
-				 priv->frame.height);
+		mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
+		mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
+		mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
 
-	ECHECKER(ret, mt9t112_auto_focus_trigger(client));
+		mt9t112_set_a_frame_size(client,
+					priv->frame.width,
+					priv->frame.height);
 
-	dev_dbg(&client->dev, "format : %d\n", priv->format->code);
-	dev_dbg(&client->dev, "size   : %d x %d\n",
-		priv->frame.width,
-		priv->frame.height);
+		ECHECKER(ret, mt9t112_auto_focus_trigger(client));
 
-	CLOCK_INFO(client, EXT_CLOCK);
+		dev_dbg(&client->dev, "format : %d\n", priv->format->code);
+		dev_dbg(&client->dev, "size   : %d x %d\n",
+			priv->frame.width,
+			priv->frame.height);
 
-	return ret;
+		CLOCK_INFO(client, EXT_CLOCK);
+
+		return ret;
+	}
 }
 
 static int mt9t112_set_params(struct mt9t112_priv *priv,
@@ -1019,11 +1192,60 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = {
 };
 
 /************************************************************************
+		v4l2_subdev_pad_ops
+************************************************************************/
+static int mt9t111_get_pad_format(struct v4l2_subdev *subdev,
+		struct v4l2_subdev_fh *fh,
+		struct v4l2_subdev_format *fmt)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	fmt->format = priv->fmt;
+	return 0;
+}
+
+static int mt9t111_set_pad_format(struct v4l2_subdev *subdev,
+				struct v4l2_subdev_fh *fh,
+				struct v4l2_subdev_format *fmt)
+{
+	int i;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) {
+		if (fmt->format.code == mt9t112_cfmts[i].code)
+			goto fmt_found;
+	}
+	if (i >= ARRAY_SIZE(mt9t112_cfmts))
+		return -EINVAL;
+
+fmt_found:
+	/*
+	 * Only VGA resolution supported
+	 */
+	fmt->format.width = VGA_WIDTH;
+	fmt->format.height = VGA_HEIGHT;
+	fmt->format.field = V4L2_FIELD_NONE;
+	fmt->format.colorspace = V4L2_COLORSPACE_JPEG;
+
+	priv->fmt = fmt->format;
+
+	return 0;
+}
+
+static const struct v4l2_subdev_pad_ops mt9t111_pad_ops = {
+	.get_fmt        = mt9t111_get_pad_format,
+	.set_fmt        = mt9t111_set_pad_format,
+};
+
+/************************************************************************
 			i2c driver
 ************************************************************************/
 static struct v4l2_subdev_ops mt9t112_subdev_ops = {
 	.core	= &mt9t112_subdev_core_ops,
 	.video	= &mt9t112_subdev_video_ops,
+	.pad    = &mt9t111_pad_ops,
 };
 
 static int mt9t112_camera_probe(struct i2c_client *client)
@@ -1089,6 +1311,32 @@ static int mt9t112_probe(struct i2c_client *client,
 	/* Cannot fail: using the default supported pixel code */
 	mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
 
+	if (priv->model == V4L2_IDENT_MT9T111) {
+		priv->omap3evm_1v8 = regulator_get(NULL, "vio_1v8");
+		if (IS_ERR(priv->omap3evm_1v8)) {
+			printk(KERN_ERR "vio_1v8 regulator missing\n");
+			ret =  PTR_ERR(priv->omap3evm_1v8);
+			goto err_1;
+		}
+		priv->omap3evm_2v8 = regulator_get(NULL, "cam_2v8");
+		if (IS_ERR(priv->omap3evm_2v8)) {
+			printk(KERN_ERR "cam_2v8 regulator missing\n");
+			ret = PTR_ERR(priv->omap3evm_2v8);
+			goto err_2;
+		}
+
+		priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
+		ret = media_entity_init(&priv->subdev.entity, 1, &priv->pad, 0);
+		if (!ret)
+			return 0;
+		kfree(priv);
+err_2:
+		regulator_put(priv->omap3evm_2v8);
+err_1:
+		regulator_put(priv->omap3evm_1v8);
+	}
+
 	return ret;
 }
 
diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
new file mode 100644
index 0000000..372dc0d
--- /dev/null
+++ b/include/media/mt9t111.h
@@ -0,0 +1,45 @@
+/*
+ * include/media/mt9t111.h
+ *
+ * mt9t111 sensor driver
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef	MT9T111_H
+#define	MT9T111_H
+
+struct v4l2_subdev;
+
+/*
+ * Defines and Macros and globals
+ */
+#define MT9T111_MODULE_NAME		"mt9t112"
+
+/*i2c adress for MT9T111*/
+#define MT9T111_I2C_ADDR		(0x78 >> 1)
+
+#define MT9T111_CLK_MAX			(96000000) /* 96MHz */
+#define MT9T111_CLK_MIN			(6000000)  /* 6Mhz */
+
+#define MT9T111_I2C_CONFIG		(1)
+#define I2C_ONE_BYTE_TRANSFER		(1)
+#define I2C_TWO_BYTE_TRANSFER		(2)
+#define I2C_THREE_BYTE_TRANSFER		(3)
+#define I2C_FOUR_BYTE_TRANSFER		(4)
+#define I2C_TXRX_DATA_MASK		(0x00FF)
+#define I2C_TXRX_DATA_MASK_UPPER	(0xFF00)
+#define I2C_TXRX_DATA_SHIFT		(8)
+
+struct mt9t111_platform_data {
+	int (*s_power) (struct v4l2_subdev *subdev, u32 on);
+	int (*set_xclk) (struct v4l2_subdev *subdev, u32 hz);
+	int (*configure_interface) (struct v4l2_subdev *subdev, u32 pixclk);
+};
+
+#endif	/* ifndef MT9T111 */
+
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: linux-omap, Deepthy Ravi

Added support for mt9t111 sensor in the existing
mt9t112 driver. Also added support for media controller
framework. The sensor driver currently supports only
VGA resolution.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/Kconfig       |    7 +
 drivers/media/video/Makefile      |    1 +
 drivers/media/video/mt9t111_reg.h | 1367 +++++++++++++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c     |  320 ++++++++-
 include/media/mt9t111.h           |   45 ++
 5 files changed, 1704 insertions(+), 36 deletions(-)
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 14326d7..b5806e8 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -482,6 +482,13 @@ config VIDEO_MT9V032
 	  This is a Video4Linux2 sensor-level driver for the Micron
 	  MT9V032 752x480 CMOS sensor.
 
+config VIDEO_MT9T111
+	tristate "Aptina MT9T111 VGA CMOS IMAGE SENSOR"
+	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	---help---
+	 This is a Video4Linux2 sensor-level driver for the Aptina MT9T111
+	 image 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 c06f515..02a8b70 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
 obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
 obj-$(CONFIG_VIDEO_SR030PC30)	+= sr030pc30.o
+obj-$(CONFIG_VIDEO_MT9T111) += mt9t112.o
 obj-$(CONFIG_VIDEO_NOON010PC30)	+= noon010pc30.o
 obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
 obj-$(CONFIG_VIDEO_ADP1653)	+= adp1653.o
diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
new file mode 100644
index 0000000..2f610d4
--- /dev/null
+++ b/drivers/media/video/mt9t111_reg.h
@@ -0,0 +1,1367 @@
+/*
+ * drivers/media/video/mt9t111_reg.h
+ *
+ * mt9t111 sensor driver header file
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef MT9T111_REG_H
+#define MT9T111_REG_H
+
+/* register addr */
+#define MT9T111_CHIP_ID		(0x0000)
+
+/* register value */
+#define MT9T111_CHIP_ID_VALUE	(0x2680)
+
+#define MT9T111_IMAGE_WIDTH		(640)
+#define MT9T111_IMAGE_HEIGHT		(480)
+
+typedef struct {
+	u16 delay_time;
+	u16 addr;
+	u16 data;
+} mt9t111_regs;
+
+mt9t111_regs patch_rev6[] = {
+	{0, 0x0982, 0x0},
+	{0, 0x098A, 0xCE7},
+	{0, 0x0990, 0x3C3C},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C5F},
+	{0, 0x0996, 0x4F30},
+	{0, 0x0998, 0xED08},
+	{0, 0x099a, 0xBD61},
+	{0, 0x099c, 0xD5CE},
+	{0, 0x099e, 0x4CD},
+	{0, 0x098A, 0xCF7},
+	{0, 0x0990, 0x1F17},
+	{0, 0x0992, 0x211},
+	{0, 0x0994, 0xCC33},
+	{0, 0x0996, 0x2E30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCFF},
+	{0, 0x099c, 0xFDED},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0xD07},
+	{0, 0x0990, 0x2},
+	{0, 0x0992, 0xBD70},
+	{0, 0x0994, 0x6D18},
+	{0, 0x0996, 0xDE1F},
+	{0, 0x0998, 0x181F},
+	{0, 0x099a, 0x8E01},
+	{0, 0x099c, 0x10CC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD17},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x18},
+	{0, 0x0994, 0xECA0},
+	{0, 0x0996, 0xC4FD},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2120},
+	{0, 0x099c, 0x1ECC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD27},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0xDE},
+	{0, 0x0994, 0x1FEC},
+	{0, 0x0996, 0xA0BD},
+	{0, 0x0998, 0x7021},
+	{0, 0x099a, 0xCC3C},
+	{0, 0x099c, 0x5230},
+	{0, 0x099e, 0xED02},
+	{0, 0x098A, 0xD37},
+	{0, 0x0990, 0xCCFF},
+	{0, 0x0992, 0xFCED},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0x2},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x6DFC},
+	{0, 0x099c, 0x4E1},
+	{0, 0x099e, 0x1A83},
+	{0, 0x098A, 0xD47},
+	{0, 0x0990, 0x1},
+	{0, 0x0992, 0x2720},
+	{0, 0x0994, 0x1A83},
+	{0, 0x0996, 0x4},
+	{0, 0x0998, 0x271E},
+	{0, 0x099a, 0x1A83},
+	{0, 0x099c, 0x8},
+	{0, 0x099e, 0x271C},
+	{0, 0x098A, 0xD57},
+	{0, 0x0990, 0x1A83},
+	{0, 0x0992, 0x10},
+	{0, 0x0994, 0x271A},
+	{0, 0x0996, 0x1A83},
+	{0, 0x0998, 0x20},
+	{0, 0x099a, 0x2718},
+	{0, 0x099c, 0x1A83},
+	{0, 0x099e, 0x40},
+	{0, 0x098A, 0xD67},
+	{0, 0x0990, 0x2716},
+	{0, 0x0992, 0x2019},
+	{0, 0x0994, 0xC61E},
+	{0, 0x0996, 0x2012},
+	{0, 0x0998, 0xC622},
+	{0, 0x099a, 0x200E},
+	{0, 0x099c, 0xC621},
+	{0, 0x099e, 0x200A},
+	{0, 0x098A, 0xD77},
+	{0, 0x0990, 0xC620},
+	{0, 0x0992, 0x2006},
+	{0, 0x0994, 0xC62A},
+	{0, 0x0996, 0x2002},
+	{0, 0x0998, 0xC62B},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x8CC},
+	{0, 0x099e, 0x3400},
+	{0, 0x098A, 0xD87},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x34},
+	{0, 0x0994, 0xBD6F},
+	{0, 0x0996, 0xD184},
+	{0, 0x0998, 0x330},
+	{0, 0x099a, 0xED07},
+	{0, 0x099c, 0xA60A},
+	{0, 0x099e, 0x4848},
+	{0, 0x098A, 0xD97},
+	{0, 0x0990, 0x5FED},
+	{0, 0x0992, 0x5EA},
+	{0, 0x0994, 0x8AA},
+	{0, 0x0996, 0x731},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2130},
+	{0, 0x099c, 0xC60A},
+	{0, 0x099e, 0x3A35},
+	{0, 0x098A, 0xDA7},
+	{0, 0x0990, 0x3937},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C34},
+	{0, 0x0996, 0xDE2F},
+	{0, 0x0998, 0xEE0E},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x7D13},
+	{0, 0x099e, 0xEF27},
+	{0, 0x098A, 0xDB7},
+	{0, 0x0990, 0x7CCE},
+	{0, 0x0992, 0x13E0},
+	{0, 0x0994, 0x1E05},
+	{0, 0x0996, 0x1060},
+	{0, 0x0998, 0xE60E},
+	{0, 0x099a, 0x4FC3},
+	{0, 0x099c, 0x13F0},
+	{0, 0x099e, 0x8FE6},
+	{0, 0x098A, 0xDC7},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0xE107},
+	{0, 0x0994, 0x2216},
+	{0, 0x0996, 0xF613},
+	{0, 0x0998, 0xEE4F},
+	{0, 0x099a, 0xC313},
+	{0, 0x099c, 0xF38F},
+	{0, 0x099e, 0xE600},
+	{0, 0x098A, 0xDD7},
+	{0, 0x0990, 0x30E1},
+	{0, 0x0992, 0x725},
+	{0, 0x0994, 0x7F6},
+	{0, 0x0996, 0x13EE},
+	{0, 0x0998, 0xC103},
+	{0, 0x099a, 0x253C},
+	{0, 0x099c, 0x7F13},
+	{0, 0x099e, 0xEEF6},
+	{0, 0x098A, 0xDE7},
+	{0, 0x0990, 0x13EF},
+	{0, 0x0992, 0xE706},
+	{0, 0x0994, 0xCC13},
+	{0, 0x0996, 0xF0ED},
+	{0, 0x0998, 0x4CC},
+	{0, 0x099a, 0x13F3},
+	{0, 0x099c, 0x200F},
+	{0, 0x099e, 0x7C13},
+	{0, 0x098A, 0xDF7},
+	{0, 0x0990, 0xEEEC},
+	{0, 0x0992, 0x4C3},
+	{0, 0x0994, 0x1},
+	{0, 0x0996, 0xED04},
+	{0, 0x0998, 0xEC02},
+	{0, 0x099a, 0xC300},
+	{0, 0x099c, 0x1ED},
+	{0, 0x099e, 0x2F6},
+	{0, 0x098A, 0xE07},
+	{0, 0x0990, 0x13EE},
+	{0, 0x0992, 0xE106},
+	{0, 0x0994, 0x2412},
+	{0, 0x0996, 0xEE04},
+	{0, 0x0998, 0xE600},
+	{0, 0x099a, 0x30E1},
+	{0, 0x099c, 0x722},
+	{0, 0x099e, 0xDFEE},
+	{0, 0x098A, 0xE17},
+	{0, 0x0990, 0x2E6},
+	{0, 0x0992, 0x30},
+	{0, 0x0994, 0xE107},
+	{0, 0x0996, 0x25D6},
+	{0, 0x0998, 0xDE49},
+	{0, 0x099a, 0xEE08},
+	{0, 0x099c, 0xAD00},
+	{0, 0x099e, 0xCC13},
+	{0, 0x098A, 0xE27},
+	{0, 0x0990, 0xF630},
+	{0, 0x0992, 0xED00},
+	{0, 0x0994, 0xDE2F},
+	{0, 0x0996, 0xEE10},
+	{0, 0x0998, 0xCC13},
+	{0, 0x099a, 0xFAAD},
+	{0, 0x099c, 0x38},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0xE37},
+	{0, 0x0990, 0x3839},
+	{0, 0x098A, 0x1000},
+	{0, 0x0990, 0xCC10},
+	{0, 0x0992, 0x9BD},
+	{0, 0x0994, 0x4224},
+	{0, 0x0996, 0x7E10},
+	{0, 0x0998, 0x9C6},
+	{0, 0x099a, 0x1F7},
+	{0, 0x099c, 0x18A},
+	{0, 0x099e, 0xC606},
+	{0, 0x098A, 0x1010},
+	{0, 0x0990, 0xF701},
+	{0, 0x0992, 0x8BDE},
+	{0, 0x0994, 0x3F18},
+	{0, 0x0996, 0xCE0B},
+	{0, 0x0998, 0xF1CC},
+	{0, 0x099a, 0x11},
+	{0, 0x099c, 0xBDD7},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0x1020},
+	{0, 0x0990, 0xBF1},
+	{0, 0x0992, 0xDD3F},
+	{0, 0x0994, 0xDE35},
+	{0, 0x0996, 0x18CE},
+	{0, 0x0998, 0xC03},
+	{0, 0x099a, 0xCC00},
+	{0, 0x099c, 0x3FBD},
+	{0, 0x099e, 0xD700},
+	{0, 0x098A, 0x1030},
+	{0, 0x0990, 0xCC0C},
+	{0, 0x0992, 0x3DD},
+	{0, 0x0994, 0x35DE},
+	{0, 0x0996, 0x4718},
+	{0, 0x0998, 0xCE0C},
+	{0, 0x099a, 0x43CC},
+	{0, 0x099c, 0x15},
+	{0, 0x099e, 0xBDD7},
+	{0, 0x098A, 0x1040},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0xC43},
+	{0, 0x0994, 0xDD47},
+	{0, 0x0996, 0xFE00},
+	{0, 0x0998, 0x3318},
+	{0, 0x099a, 0xCE0C},
+	{0, 0x099c, 0x59CC},
+	{0, 0x099e, 0x9},
+	{0, 0x098A, 0x1050},
+	{0, 0x0990, 0xBDD7},
+	{0, 0x0992, 0xCC},
+	{0, 0x0994, 0xC59},
+	{0, 0x0996, 0xFD00},
+	{0, 0x0998, 0x33DE},
+	{0, 0x099a, 0x4118},
+	{0, 0x099c, 0xCE0C},
+	{0, 0x099e, 0x63CC},
+	{0, 0x098A, 0x1060},
+	{0, 0x0990, 0xD},
+	{0, 0x0992, 0xBDD7},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0xC63},
+	{0, 0x0998, 0xDD41},
+	{0, 0x099a, 0xFE00},
+	{0, 0x099c, 0x3118},
+	{0, 0x099e, 0xCE0C},
+	{0, 0x098A, 0x1070},
+	{0, 0x0990, 0x71CC},
+	{0, 0x0992, 0x29},
+	{0, 0x0994, 0xBDD7},
+	{0, 0x0996, 0xCC},
+	{0, 0x0998, 0xC71},
+	{0, 0x099a, 0xFD00},
+	{0, 0x099c, 0x31DE},
+	{0, 0x099e, 0x3918},
+	{0, 0x098A, 0x1080},
+	{0, 0x0990, 0xCE0C},
+	{0, 0x0992, 0x9BCC},
+	{0, 0x0994, 0x23},
+	{0, 0x0996, 0xBDD7},
+	{0, 0x0998, 0xCC},
+	{0, 0x099a, 0xC9B},
+	{0, 0x099c, 0xDD39},
+	{0, 0x099e, 0xDE49},
+	{0, 0x098A, 0x1090},
+	{0, 0x0990, 0x18CE},
+	{0, 0x0992, 0xCBF},
+	{0, 0x0994, 0xCC00},
+	{0, 0x0996, 0xDBD},
+	{0, 0x0998, 0xD700},
+	{0, 0x099a, 0xCC0C},
+	{0, 0x099c, 0xBFDD},
+	{0, 0x099e, 0x49CC},
+	{0, 0x098A, 0x10A0},
+	{0, 0x0990, 0x1162},
+	{0, 0x0992, 0xFD0B},
+	{0, 0x0994, 0xFDCC},
+	{0, 0x0996, 0xCE7},
+	{0, 0x0998, 0xFD0C},
+	{0, 0x099a, 0x1FCC},
+	{0, 0x099c, 0x1245},
+	{0, 0x099e, 0xFD0C},
+	{0, 0x098A, 0x10B0},
+	{0, 0x0990, 0x51CC},
+	{0, 0x0992, 0x110B},
+	{0, 0x0994, 0xFD0C},
+	{0, 0x0996, 0x5BCC},
+	{0, 0x0998, 0x1108},
+	{0, 0x099a, 0xFD0C},
+	{0, 0x099c, 0x65CC},
+	{0, 0x099e, 0x10D0},
+	{0, 0x098A, 0x10C0},
+	{0, 0x0990, 0xFD0C},
+	{0, 0x0992, 0x7BCC},
+	{0, 0x0994, 0x12DE},
+	{0, 0x0996, 0xFD0C},
+	{0, 0x0998, 0xA7CC},
+	{0, 0x099a, 0xDA8},
+	{0, 0x099c, 0xFD0C},
+	{0, 0x099e, 0xCB39},
+	{0, 0x098A, 0x10D0},
+	{0, 0x0990, 0x37DE},
+	{0, 0x0992, 0x1DEC},
+	{0, 0x0994, 0xC5F},
+	{0, 0x0996, 0x8402},
+	{0, 0x0998, 0x4416},
+	{0, 0x099a, 0x4FF7},
+	{0, 0x099c, 0xCCD},
+	{0, 0x099e, 0xE60B},
+	{0, 0x098A, 0x10E0},
+	{0, 0x0990, 0xC407},
+	{0, 0x0992, 0xF70C},
+	{0, 0x0994, 0xCE7F},
+	{0, 0x0996, 0x30C4},
+	{0, 0x0998, 0xEC25},
+	{0, 0x099a, 0xFD30},
+	{0, 0x099c, 0xC5FC},
+	{0, 0x099e, 0x6D6},
+	{0, 0x098A, 0x10F0},
+	{0, 0x0990, 0xFD30},
+	{0, 0x0992, 0xC701},
+	{0, 0x0994, 0xFC30},
+	{0, 0x0996, 0xC0FD},
+	{0, 0x0998, 0xBED},
+	{0, 0x099a, 0xFC30},
+	{0, 0x099c, 0xC2FD},
+	{0, 0x099e, 0xBEF},
+	{0, 0x098A, 0x1100},
+	{0, 0x0990, 0x30E6},
+	{0, 0x0992, 0xBD},
+	{0, 0x0994, 0x5203},
+	{0, 0x0996, 0x3139},
+	{0, 0x0998, 0x7E9E},
+	{0, 0x099a, 0x143C},
+	{0, 0x099c, 0x3C3C},
+	{0, 0x099e, 0x2101},
+	{0, 0x098A, 0x1110},
+	{0, 0x0990, 0xCC00},
+	{0, 0x0992, 0x18BD},
+	{0, 0x0994, 0x6FD1},
+	{0, 0x0996, 0xC504},
+	{0, 0x0998, 0x26F5},
+	{0, 0x099a, 0xDC25},
+	{0, 0x099c, 0x30ED},
+	{0, 0x099e, 0x420},
+	{0, 0x098A, 0x1120},
+	{0, 0x0990, 0x12EE},
+	{0, 0x0992, 0x43C},
+	{0, 0x0994, 0x1838},
+	{0, 0x0996, 0xE621},
+	{0, 0x0998, 0x18E7},
+	{0, 0x099a, 0xBE30},
+	{0, 0x099c, 0xEE04},
+	{0, 0x099e, 0xEC1D},
+	{0, 0x098A, 0x1130},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x4EC},
+	{0, 0x0994, 0x426},
+	{0, 0x0996, 0xEACC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0xED02},
+	{0, 0x099c, 0xCCFB},
+	{0, 0x099e, 0xFFED},
+	{0, 0x098A, 0x1140},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0x400},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6DCC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x2CC},
+	{0, 0x099e, 0xFBFF},
+	{0, 0x098A, 0x1150},
+	{0, 0x0990, 0xED00},
+	{0, 0x0992, 0x5F4F},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6D5F},
+	{0, 0x0998, 0xBD5B},
+	{0, 0x099a, 0x17BD},
+	{0, 0x099c, 0x558B},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0x1160},
+	{0, 0x0990, 0x3839},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0xC640},
+	{0, 0x0996, 0xF730},
+	{0, 0x0998, 0xC4FC},
+	{0, 0x099a, 0xBED},
+	{0, 0x099c, 0xFD30},
+	{0, 0x099e, 0xC0FC},
+	{0, 0x098A, 0x1170},
+	{0, 0x0990, 0xBEF},
+	{0, 0x0992, 0xFD30},
+	{0, 0x0994, 0xC2DE},
+	{0, 0x0996, 0x1DEC},
+	{0, 0x0998, 0x25FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1180},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xD6EC},
+	{0, 0x0996, 0xC5F},
+	{0, 0x0998, 0x8402},
+	{0, 0x099a, 0x4416},
+	{0, 0x099c, 0x4F30},
+	{0, 0x099e, 0xE703},
+	{0, 0x098A, 0x1190},
+	{0, 0x0990, 0xF10C},
+	{0, 0x0992, 0xCD27},
+	{0, 0x0994, 0x15F1},
+	{0, 0x0996, 0xCCD},
+	{0, 0x0998, 0x2309},
+	{0, 0x099a, 0xFC06},
+	{0, 0x099c, 0xD604},
+	{0, 0x099e, 0xFD06},
+	{0, 0x098A, 0x11A0},
+	{0, 0x0990, 0xD620},
+	{0, 0x0992, 0x7FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0x5FD},
+	{0, 0x0998, 0x6D6},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xE60B},
+	{0, 0x099e, 0xC407},
+	{0, 0x098A, 0x11B0},
+	{0, 0x0990, 0x30E7},
+	{0, 0x0992, 0x2F1},
+	{0, 0x0994, 0xCCE},
+	{0, 0x0996, 0x272C},
+	{0, 0x0998, 0x7D0C},
+	{0, 0x099a, 0xCE27},
+	{0, 0x099c, 0x275D},
+	{0, 0x099e, 0x2724},
+	{0, 0x098A, 0x11C0},
+	{0, 0x0990, 0x7F30},
+	{0, 0x0992, 0xC4FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0xFD30},
+	{0, 0x0998, 0xC5F6},
+	{0, 0x099a, 0xCCE},
+	{0, 0x099c, 0x4FFD},
+	{0, 0x099e, 0x30C7},
+	{0, 0x098A, 0x11D0},
+	{0, 0x0990, 0xC640},
+	{0, 0x0992, 0xF730},
+	{0, 0x0994, 0xC4E6},
+	{0, 0x0996, 0x24F},
+	{0, 0x0998, 0xFD30},
+	{0, 0x099a, 0xC501},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x11E0},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0x7D06},
+	{0, 0x0996, 0xCB27},
+	{0, 0x0998, 0x2EC6},
+	{0, 0x099a, 0x40F7},
+	{0, 0x099c, 0x30C4},
+	{0, 0x099e, 0xFC06},
+	{0, 0x098A, 0x11F0},
+	{0, 0x0990, 0xC104},
+	{0, 0x0992, 0xF306},
+	{0, 0x0994, 0xD6ED},
+	{0, 0x0996, 0x5F},
+	{0, 0x0998, 0x6D00},
+	{0, 0x099a, 0x2A01},
+	{0, 0x099c, 0x5317},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1200},
+	{0, 0x0990, 0xC0EC},
+	{0, 0x0992, 0xFD},
+	{0, 0x0994, 0x30C2},
+	{0, 0x0996, 0xFC06},
+	{0, 0x0998, 0xC1FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1210},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xC720},
+	{0, 0x0996, 0x227F},
+	{0, 0x0998, 0x30C4},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xEC25},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1220},
+	{0, 0x0990, 0xC5FC},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0xFD30},
+	{0, 0x0996, 0xC701},
+	{0, 0x0998, 0xFC30},
+	{0, 0x099a, 0xC0FD},
+	{0, 0x099c, 0x6D0},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x1230},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D2},
+	{0, 0x0994, 0xEC25},
+	{0, 0x0996, 0xFD06},
+	{0, 0x0998, 0xC3BD},
+	{0, 0x099a, 0x953C},
+	{0, 0x099c, 0xDE3F},
+	{0, 0x099e, 0xEE10},
+	{0, 0x098A, 0x1240},
+	{0, 0x0990, 0xAD00},
+	{0, 0x0992, 0x3838},
+	{0, 0x0994, 0x3930},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0xFFE9},
+	{0, 0x099a, 0x8F35},
+	{0, 0x099c, 0xBDAD},
+	{0, 0x099e, 0x1530},
+	{0, 0x098A, 0x1250},
+	{0, 0x0990, 0x6F16},
+	{0, 0x0992, 0x18DE},
+	{0, 0x0994, 0x1918},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0x14B},
+	{0, 0x099a, 0x188F},
+	{0, 0x099c, 0x18EC},
+	{0, 0x099e, 0xFD},
+	{0, 0x098A, 0x1260},
+	{0, 0x0990, 0x50E},
+	{0, 0x0992, 0x18EC},
+	{0, 0x0994, 0x2FD},
+	{0, 0x0996, 0x510},
+	{0, 0x0998, 0xE616},
+	{0, 0x099a, 0x4FED},
+	{0, 0x099c, 0x418},
+	{0, 0x099e, 0x8FC3},
+	{0, 0x098A, 0x1270},
+	{0, 0x0990, 0xFFCB},
+	{0, 0x0992, 0xE304},
+	{0, 0x0994, 0x8FE6},
+	{0, 0x0996, 0xF7},
+	{0, 0x0998, 0x514},
+	{0, 0x099a, 0x18DE},
+	{0, 0x099c, 0x1930},
+	{0, 0x099e, 0xE616},
+	{0, 0x098A, 0x1280},
+	{0, 0x0990, 0x4FED},
+	{0, 0x0992, 0x418},
+	{0, 0x0994, 0x8FC3},
+	{0, 0x0996, 0x119},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FE6},
+	{0, 0x099c, 0xF7},
+	{0, 0x099e, 0x515},
+	{0, 0x098A, 0x1290},
+	{0, 0x0990, 0xFC05},
+	{0, 0x0992, 0x5BFD},
+	{0, 0x0994, 0x512},
+	{0, 0x0996, 0xDE37},
+	{0, 0x0998, 0xEE08},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x30E6},
+	{0, 0x099e, 0x164F},
+	{0, 0x098A, 0x12A0},
+	{0, 0x0990, 0x5ED},
+	{0, 0x0992, 0x48F},
+	{0, 0x0994, 0xC300},
+	{0, 0x0996, 0x630},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FF6},
+	{0, 0x099c, 0x516},
+	{0, 0x099e, 0x4FED},
+	{0, 0x098A, 0x12B0},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0x6C16},
+	{0, 0x0994, 0xE616},
+	{0, 0x0996, 0xC103},
+	{0, 0x0998, 0x2598},
+	{0, 0x099a, 0xCC32},
+	{0, 0x099c, 0x8EED},
+	{0, 0x099e, 0xEC},
+	{0, 0x098A, 0x12C0},
+	{0, 0x0990, 0x6BD},
+	{0, 0x0992, 0x7021},
+	{0, 0x0994, 0xCC32},
+	{0, 0x0996, 0x6C30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCF8},
+	{0, 0x099c, 0xED},
+	{0, 0x099e, 0xA6},
+	{0, 0x098A, 0x12D0},
+	{0, 0x0990, 0x9E3},
+	{0, 0x0992, 0xA84},
+	{0, 0x0994, 0x7BD},
+	{0, 0x0996, 0x706D},
+	{0, 0x0998, 0x30C6},
+	{0, 0x099a, 0x173A},
+	{0, 0x099c, 0x3539},
+	{0, 0x099e, 0x3CBD},
+	{0, 0x098A, 0x12E0},
+	{0, 0x0990, 0x776D},
+	{0, 0x0992, 0xCC32},
+	{0, 0x0994, 0x5C30},
+	{0, 0x0996, 0xED00},
+	{0, 0x0998, 0xFC13},
+	{0, 0x099a, 0x8683},
+	{0, 0x099c, 0x1},
+	{0, 0x099e, 0xBD70},
+	{0, 0x098A, 0x12F0},
+	{0, 0x0990, 0x21CC},
+	{0, 0x0992, 0x325E},
+	{0, 0x0994, 0x30ED},
+	{0, 0x0996, 0xFC},
+	{0, 0x0998, 0x1388},
+	{0, 0x099a, 0x8300},
+	{0, 0x099c, 0x1BD},
+	{0, 0x099e, 0x7021},
+	{0, 0x098A, 0x1300},
+	{0, 0x0990, 0x3839},
+	{0, 0x098E, 0x0010},
+	{0, 0x0990, 0x1000},
+	{0, 0x098E, 0x0003},
+	{100, 0x0990, 0x0004}
+};
+
+mt9t111_regs def_regs1[] = {
+	{0, 0x001A, 0x0218},
+	{0, 0x001E, 0x0777},
+	{0, 0x3084, 0x2409},
+	{0, 0x3092, 0x0A49},
+	{0, 0x3094, 0x4949},
+	{0, 0x3096, 0x4950},
+	{0, 0x0018, 0x402D},
+	{100, 0x0018, 0x402C},
+	{0, 0x098E, 0x6800},
+	{0, 0x0990, 0x0280},
+	{0, 0x098E, 0x6802},
+	{0, 0x0990, 0x01E0},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x4802},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4804},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4806},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4808},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x480A},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x480C},
+	{0, 0x0990, 0x046C},
+	{0, 0x098E, 0x480F},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4811},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x4813},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x481D},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x481F},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x4825},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0x6C00},
+	{0, 0x0990, 0x0800},
+	{0, 0x098E, 0x6C02},
+	{0, 0x0990, 0x0600},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x484A},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484C},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484E},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4850},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x4852},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x4854},
+	{0, 0x0990, 0x146C},
+	{0, 0x098E, 0x4857},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4859},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x485B},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x4865},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x4867},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x486D},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0xC8A5},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC8A6},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC8A7},
+	{0, 0x0990, 0x0023},
+	{0, 0x098E, 0xC8A8},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC844},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC92F},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC845},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92D},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88C},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC930},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88D},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xA002},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xA009},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0xA00A},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xA00C},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x4846},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x68AA},
+	{0, 0x0990, 0x0278},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x6CAA},
+	{0, 0x0990, 0x0218},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0005},
+	{0, 0x3C20, 0x0001},
+	{0, 0x364A, 0x7D2F},
+	{0, 0x364C, 0x79EB},
+	{0, 0x364E, 0x18D2},
+	{0, 0x3650, 0x9F8F},
+	{0, 0x3652, 0xA7D2},
+	{0, 0x368A, 0x460C},
+	{0, 0x368C, 0x14F0},
+	{0, 0x368E, 0x946F},
+	{0, 0x3690, 0xC471},
+	{0, 0x3692, 0x04B1},
+	{0, 0x36CA, 0x0433},
+	{0, 0x36CC, 0x680D},
+	{0, 0x36CE, 0xEEF3},
+	{0, 0x36D0, 0x4850},
+	{0, 0x36D2, 0xF233},
+	{0, 0x370A, 0xB2AF},
+	{0, 0x370C, 0x2CF0},
+	{0, 0x370E, 0x3F10},
+	{0, 0x3710, 0xC673},
+	{0, 0x3712, 0xA972},
+	{0, 0x374A, 0x0590},
+	{0, 0x374C, 0xAFB3},
+	{0, 0x374E, 0x93D7},
+	{0, 0x3750, 0x8D12},
+	{0, 0x3752, 0x2539},
+	{0, 0x3640, 0x0350},
+	{0, 0x3642, 0x322C},
+	{0, 0x3644, 0x77D1},
+	{0, 0x3646, 0xA26F},
+	{0, 0x3648, 0xC872},
+	{0, 0x3680, 0x0C4C},
+	{0, 0x3682, 0x9510},
+	{0, 0x3684, 0x110E},
+	{0, 0x3686, 0x4331},
+	{0, 0x3688, 0xC1CF},
+	{0, 0x36C0, 0x6152},
+	{0, 0x36C2, 0x038E},
+	{0, 0x36C4, 0x9AF4},
+	{0, 0x36C6, 0xE12F},
+	{0, 0x36C8, 0x09F3},
+	{0, 0x3700, 0xC5AF},
+	{0, 0x3702, 0xCA90},
+	{0, 0x3704, 0x5D0F},
+	{0, 0x3706, 0x3293},
+	{0, 0x3708, 0x2B92},
+	{0, 0x3740, 0xC590},
+	{0, 0x3742, 0x8133},
+	{0, 0x3744, 0xE0F6},
+	{0, 0x3746, 0x0254},
+	{0, 0x3748, 0x10B9},
+	{0, 0x3654, 0x7F8F},
+	{0, 0x3656, 0x6F6C},
+	{0, 0x3658, 0x5971},
+	{0, 0x365A, 0x9A0F},
+	{0, 0x365C, 0xA1B2},
+	{0, 0x3694, 0xB00C},
+	{0, 0x3696, 0xEBCF},
+	{0, 0x3698, 0x06AD},
+	{0, 0x369A, 0x4D31},
+	{0, 0x369C, 0x2A4E},
+	{0, 0x36D4, 0x4752},
+	{0, 0x36D6, 0x724D},
+	{0, 0x36D8, 0xAD34},
+	{0, 0x36DA, 0x1350},
+	{0, 0x36DC, 0x4E94},
+	{0, 0x3714, 0xA06E},
+	{0, 0x3716, 0x9152},
+	{0, 0x3718, 0x1F53},
+	{0, 0x371A, 0x3933},
+	{0, 0x371C, 0xBA94},
+	{0, 0x3754, 0x1233},
+	{0, 0x3756, 0xA032},
+	{0, 0x3758, 0xE936},
+	{0, 0x375A, 0xBE34},
+	{0, 0x375C, 0x02D9},
+	{0, 0x365E, 0x7DEF},
+	{0, 0x3660, 0x434B},
+	{0, 0x3662, 0x69F1},
+	{0, 0x3664, 0x8A0F},
+	{0, 0x3666, 0xBDB2},
+	{0, 0x369E, 0x290D},
+	{0, 0x36A0, 0x42CF},
+	{0, 0x36A2, 0xDC6D},
+	{0, 0x36A4, 0x91B1},
+	{0, 0x36A6, 0x9DE9},
+	{0, 0x36DE, 0x70B2},
+	{0, 0x36E0, 0x02AC},
+	{0, 0x36E2, 0x9714},
+	{0, 0x36E4, 0xF3CF},
+	{0, 0x36E6, 0x6BD1},
+	{0, 0x371E, 0xE42E},
+	{0, 0x3720, 0x1D32},
+	{0, 0x3722, 0xCC31},
+	{0, 0x3724, 0xAE94},
+	{0, 0x3726, 0x6413},
+	{0, 0x375E, 0xE290},
+	{0, 0x3760, 0x8F53},
+	{0, 0x3762, 0xF936},
+	{0, 0x3764, 0x4614},
+	{0, 0x3766, 0x1B59},
+	{0, 0x3784, 0x0404},
+	{0, 0x3782, 0x0304},
+	{0, 0x3210, 0x01B8},
+	{0, 0x098E, 0xC913},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x686B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x686D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x6C6B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x6C6D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x3439},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x343B},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x4926},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4928},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x492A},
+	{0, 0x0990, 0x0656},
+	{0, 0x098E, 0x4D26},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4D28},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x4D2A},
+	{0, 0x0990, 0x0656},
+	{0, 0x33F4, 0x040B},
+	{0, 0x098E, 0xC916},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC919},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xC917},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC918},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC91A},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0xC91B},
+	{0, 0x0990, 0x0009},
+	{0, 0x326C, 0x0C00},
+	{0, 0x098E, 0x494B},
+	{0, 0x0990, 0x0042},
+	{0, 0x098E, 0x494D},
+	{0, 0x0990, 0x012C},
+	{0, 0x098E, 0xC91E},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC91F},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC920},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC921},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC922},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC923},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xC924},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC925},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xBC02},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xBC05},
+	{0, 0x0990, 0x000E},
+	{0, 0x098E, 0xC950},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC94F},
+	{0, 0x0990, 0x0038},
+	{0, 0x098E, 0xC952},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC951},
+	{0, 0x0990, 0x0051},
+	{0, 0x098E, 0xC954},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC953},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC956},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC955},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC958},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC957},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC95A},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC959},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC95C},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95B},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95E},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95D},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95F},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0x48DC},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48DE},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E0},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E2},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48E4},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E6},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E8},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48EA},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48EC},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xDC2A},
+	{0, 0x0990, 0x000B},
+	{0, 0x098E, 0xDC2B},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0xBC0B},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC0C},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC0D},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC0E},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC0F},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC10},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC11},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC12},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC13},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC14},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC15},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC16},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC17},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC18},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC19},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC1A},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC1B},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC1C},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC1D},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC1E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC1F},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC20},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC21},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC22},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC23},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC24},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC25},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC26},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC27},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC28},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC29},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC2A},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC2B},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC2C},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC2D},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC2E},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC2F},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC30},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC31},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC32},
+	{0, 0x0990, 0x000D},
+	{0, 0x098E, 0xBC33},
+	{0, 0x0990, 0x0019},
+	{0, 0x098E, 0xBC34},
+	{0, 0x0990, 0x0030},
+	{0, 0x098E, 0xBC35},
+	{0, 0x0990, 0x0056},
+	{0, 0x098E, 0xBC36},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC37},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC38},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC39},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC3A},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC3B},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC3C},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC3D},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC3E},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC3F},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC40},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC41},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC42},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC43},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0x6865},
+	{0, 0x0990, 0x00E0},
+	{0, 0x098E, 0x6867},
+	{0, 0x0990, 0x00F4},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xBC4A},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4B},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4C},
+	{0, 0x0990, 0x007F},
+	{0, 0x3542, 0x0010},
+	{0, 0x3544, 0x0030},
+	{0, 0x3546, 0x0040},
+	{0, 0x3548, 0x0080},
+	{0, 0x354A, 0x0100},
+	{0, 0x354C, 0x0200},
+	{0, 0x354E, 0x0300},
+	{0, 0x3550, 0x0010},
+	{0, 0x3552, 0x0030},
+	{0, 0x3554, 0x0040},
+	{0, 0x3556, 0x0080},
+	{0, 0x3558, 0x012C},
+	{0, 0x355A, 0x0320},
+	{0, 0x355C, 0x03E8},
+	{0, 0x3560, 0x0040},
+	{0, 0x3562, 0x0020},
+	{0, 0x3564, 0x0040},
+	{0, 0x3566, 0x0010},
+	{0, 0x3568, 0x0008},
+	{0, 0x356A, 0x0004},
+	{0, 0x356C, 0x0004},
+	{0, 0x356E, 0x0004},
+	{0, 0x098E, 0x3C4D},
+	{0, 0x0990, 0x0DAC},
+	{0, 0x098E, 0x3C4F},
+	{0, 0x0990, 0x148A},
+	{0, 0x098E, 0xC911},
+	{0, 0x0990, 0x00C8},
+	{0, 0x098E, 0xC8F4},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC8F5},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x48F6},
+	{0, 0x0990, 0x3B4D},
+	{0, 0x098E, 0x48F8},
+	{0, 0x0990, 0x6380},
+	{0, 0x098E, 0x48FA},
+	{0, 0x0990, 0x9B18},
+	{0, 0x098E, 0x48FC},
+	{0, 0x0990, 0x5D51},
+	{0, 0x098E, 0x48FE},
+	{0, 0x0990, 0xEDE8},
+	{0, 0x098E, 0x4900},
+	{0, 0x0990, 0xE515},
+	{0, 0x098E, 0x4902},
+	{0, 0x0990, 0xBFF4},
+	{0, 0x098E, 0x4904},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0x4906},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0x4908},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0xE84A},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84D},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84C},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0xE84F},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x48B0},
+	{0, 0x0990, 0x0180},
+	{0, 0x098E, 0x48B2},
+	{0, 0x0990, 0xFF7A},
+	{0, 0x098E, 0x48B4},
+	{0, 0x0990, 0x0018},
+	{0, 0x098E, 0x48B6},
+	{0, 0x0990, 0xFFCA},
+	{0, 0x098E, 0x48B8},
+	{0, 0x0990, 0x017C},
+	{0, 0x098E, 0x48BA},
+	{0, 0x0990, 0xFFCC},
+	{0, 0x098E, 0x48BC},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0x48BE},
+	{0, 0x0990, 0xFF1F},
+	{0, 0x098E, 0x48C0},
+	{0, 0x0990, 0x01E8},
+	{0, 0x098E, 0x48C2},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x48C4},
+	{0, 0x0990, 0x0044},
+	{0, 0x098E, 0x48C6},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0x48C8},
+	{0, 0x0990, 0xFFAD},
+	{0, 0x098E, 0x48CA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x098E, 0x48CC},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0x48CE},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0x48D0},
+	{0, 0x0990, 0xFFAA},
+	{0, 0x098E, 0x48D2},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0x48D4},
+	{0, 0x0990, 0x004B},
+	{0, 0x098E, 0x48D6},
+	{0, 0x0990, 0xFFA5},
+	{0, 0x098E, 0x48D8},
+	{0, 0x0990, 0x0015},
+	{0, 0x098E, 0x48DA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x35A2, 0x0014},
+	{0, 0x098E, 0xC949},
+	{0, 0x0990, 0x0024},
+	{0, 0x35A4, 0x0596},
+	{0, 0x098E, 0xC94A},
+	{0, 0x0990, 0x0062},
+	{0, 0x098E, 0xC948},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xC914},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC915},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xE86F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xE870},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xEC6F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xEC70},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xE883},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC83},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE885},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xE886},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xEC85},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xEC86},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xE884},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0xEC84},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0x490A},
+	{0, 0x0990, 0x0666},
+	{0, 0x098E, 0x490C},
+	{0, 0x0990, 0x0140},
+	{0, 0x098E, 0x6857},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x685C},
+	{0, 0x0990, 0x0005},
+	{0, 0x098E, 0x490E},
+	{0, 0x0990, 0x00A4},
+	{0, 0x098E, 0xB43D},
+	{0, 0x0990, 0x0031},
+	{0, 0x098E, 0xB43E},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xB43F},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xB440},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xB441},
+	{0, 0x0990, 0x00CD},
+	{0, 0x098E, 0xB442},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xB443},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0xB444},
+	{0, 0x0990, 0x0007},
+	{0, 0x098E, 0x300D},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0x3017},
+	{0, 0x0990, 0x0F0F},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE81F},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x70A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x74A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x3C52, 0x082E},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xECAC},
+	{0, 0x0990, 0x0000}
+};
+
+mt9t111_regs def_regs2[] = {
+	{100, 0x0018, 0x0028},
+	{0, 0x316C, 0x350F},
+	{0, 0x098E, 0x6817},
+	{0, 0x0990, 0x000C},
+	{0, 0x0034, 0x0000}
+};
+
+mt9t111_regs pll_regs1[] = {
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2145},
+	{0, 0x0010, 0x0219},
+	{0, 0x0012, 0x0090},
+	{0, 0x002A, 0x79DD},
+	{0, 0x0014, 0x2545},
+	{0, 0x0014, 0x2547},
+	{0, 0x0014, 0x3447},
+	{0, 0x0014, 0x3047}
+};
+
+mt9t111_regs pll_regs2[] = {
+	{0, 0x0014, 0x3046},
+	{0, 0x0022, 0x01E0},
+	{0, 0x001E, 0x0707},
+	{0, 0x3B84, 0x011D}
+};
+
+mt9t111_regs bayer_pattern_regs[] = {
+	{0, 0x098E, 0x6807},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6809},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6C07},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6C09},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000}
+};
+
+#endif
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
index 32114a3..aba49e2 100644
--- a/drivers/media/video/mt9t112.c
+++ b/drivers/media/video/mt9t112.c
@@ -24,12 +24,16 @@
 #include <linux/slab.h>
 #include <linux/v4l2-mediabus.h>
 #include <linux/videodev2.h>
+#include <linux/regulator/consumer.h>
 
 #include <media/mt9t112.h>
+#include <media/mt9t111.h>
 #include <media/soc_camera.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-common.h>
 
+#include "mt9t111_reg.h"
+
 /* you can check PLL/clock info */
 /* #define EXT_CLOCK 24000000 */
 
@@ -88,11 +92,15 @@ struct mt9t112_format {
 struct mt9t112_priv {
 	struct v4l2_subdev		 subdev;
 	struct mt9t112_camera_info	*info;
+	struct media_pad		pad;
 	struct i2c_client		*client;
 	struct v4l2_rect		 frame;
 	const struct mt9t112_format	*format;
+	struct v4l2_mbus_framefmt	fmt;
 	int				 model;
 	u32				 flags;
+	struct regulator		*omap3evm_1v8;
+	struct regulator		*omap3evm_2v8;
 /* for flags */
 #define INIT_DONE	(1 << 0)
 #define PCLK_RISING	(1 << 1)
@@ -206,6 +214,33 @@ static int __mt9t112_reg_write(const struct i2c_client *client,
 	return ret;
 }
 
+static int mt9t111_write_regs(struct i2c_client *client,
+				mt9t111_regs *reg_in, int cnt)
+{
+	int err = 0, i;
+	mt9t111_regs *reg = reg_in;
+
+	for (i = 0; i < cnt; i++) {
+		if (reg->delay_time == 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+		} else if (reg->addr != 0 || reg->data != 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+			mdelay(reg->delay_time);
+		} else {
+			mdelay(reg->delay_time);
+		}
+		if (err < 0) {
+			dev_warn(&client->dev, "write reg error, addr = 0x%x,"
+					"data = 0x%x\n",
+					reg->addr, reg->data);
+			return err;
+		}
+		reg++;
+	}
+
+	return err;
+}
+
 static int __mt9t112_reg_mask_set(const struct i2c_client *client,
 				  u16  command,
 				  u16  mask,
@@ -733,6 +768,82 @@ static int mt9t112_init_camera(const struct i2c_client *client)
 	return ret;
 }
 
+static int mt9t111_configure(struct v4l2_subdev *subdev)
+{
+	int i, ret = 0;
+	unsigned short value;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x001D);
+	if (ret)
+		goto out;
+
+	msleep(1);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x0018);
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, pll_regs1,
+			sizeof(pll_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_read(value, client, 0x0014);
+		if ((value & 0x8000) != 0)
+			break;
+		mdelay(2);
+	}
+
+	ret = mt9t111_write_regs(client, pll_regs2,
+			sizeof(pll_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs1,
+			sizeof(def_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, patch_rev6,
+			sizeof(patch_rev6) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs2,
+			sizeof(def_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	/* MCU_ADDRESS [SEQ_CMD] -- refresh mode */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0006);
+	if (ret)
+		goto out;
+
+	/* refresh command */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0005);
+	if (ret)
+		goto out;
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+		if (ret)
+			break;
+		mt9t112_reg_read(value , client, 0x0990);
+		if (value == 0)
+			break;
+		mdelay(5);
+	}
+out:
+	return ret;
+}
+
 /************************************************************************
 			v4l2_subdev_core_ops
 ************************************************************************/
@@ -775,15 +886,72 @@ static int mt9t112_s_register(struct v4l2_subdev *sd,
 }
 #endif
 
+static int omap3evm_regulator_ctrl(struct mt9t112_priv *priv, u32 on)
+{
+	if (!(priv->omap3evm_1v8) || !(priv->omap3evm_2v8)) {
+		printk(KERN_ERR "No regulator available\n");
+		return -ENODEV;
+	}
+	if (on) {
+		regulator_enable(priv->omap3evm_1v8);
+		mdelay(1);
+		regulator_enable(priv->omap3evm_2v8);
+		mdelay(50);
+	} else {
+		if (regulator_is_enabled(priv->omap3evm_1v8))
+			regulator_disable(priv->omap3evm_1v8);
+		if (regulator_is_enabled(priv->omap3evm_2v8))
+			regulator_disable(priv->omap3evm_2v8);
+	}
+	return 0;
+}
+
+static int mt9t111_s_power(struct v4l2_subdev *subdev, int on)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+	struct mt9t111_platform_data  *pdata;
+	int rval;
+
+	pdata = (struct mt9t111_platform_data *) icl;
+	if (on) {
+		rval = omap3evm_regulator_ctrl(priv, on);
+		if (rval)
+			goto out;
+
+		rval = pdata->s_power(subdev, 1);
+		if (rval)
+			goto out;
+
+		rval = mt9t111_configure(subdev);
+		if (rval) {
+			pdata->s_power(subdev, 0);
+			goto out;
+	}
+
+	} else {
+		rval = pdata->s_power(subdev, 0);
+		if (rval)
+			goto out;
+	}
+
+out:
+	if (rval)
+		v4l_err(client, "Unable to set target power state\n");
+
+	return rval;
+}
+
 static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
 	.g_chip_ident	= mt9t112_g_chip_ident,
+	.s_power	= mt9t111_s_power,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-	.g_register	= mt9t112_g_register,
-	.s_register	= mt9t112_s_register,
+	.g_register     = mt9t112_g_register,
+	.s_register     = mt9t112_s_register,
 #endif
 };
 
-
 /************************************************************************
 			v4l2_subdev_video_ops
 ************************************************************************/
@@ -793,51 +961,56 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable)
 	struct mt9t112_priv *priv = to_mt9t112(client);
 	int ret = 0;
 
-	if (!enable) {
-		/* FIXME
-		 *
-		 * If user selected large output size,
-		 * and used it long time,
-		 * mt9t112 camera will be very warm.
-		 *
-		 * But current driver can not stop mt9t112 camera.
-		 * So, set small size here to solve this problem.
-		 */
-		mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+	if (priv->model == V4L2_IDENT_MT9T111) {
 		return ret;
-	}
 
-	if (!(priv->flags & INIT_DONE)) {
-		u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
+	} else {
+		if (!enable) {
+			/* FIXME
+			 *
+			 * If user selected large output size,
+			 * and used it long time,
+			 * mt9t112 camera will be very warm.
+			 *
+			 * But current driver can not stop mt9t112 camera.
+			 * So, set small size here to solve this problem.
+			 */
+			mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+			return ret;
+		}
 
-		ECHECKER(ret, mt9t112_init_camera(client));
+		if (!(priv->flags & INIT_DONE)) {
+			u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
 
-		/* Invert PCLK (Data sampled on falling edge of pixclk) */
-		mt9t112_reg_write(ret, client, 0x3C20, param);
+			ECHECKER(ret, mt9t112_init_camera(client));
 
-		mdelay(5);
+			/* Invert PCLK (Data sampled on falling edge of pixclk) */
+			mt9t112_reg_write(ret, client, 0x3C20, param);
 
-		priv->flags |= INIT_DONE;
-	}
+			mdelay(5);
 
-	mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
-	mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
-	mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
+			priv->flags |= INIT_DONE;
+		}
 
-	mt9t112_set_a_frame_size(client,
-				 priv->frame.width,
-				 priv->frame.height);
+		mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
+		mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
+		mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
 
-	ECHECKER(ret, mt9t112_auto_focus_trigger(client));
+		mt9t112_set_a_frame_size(client,
+					priv->frame.width,
+					priv->frame.height);
 
-	dev_dbg(&client->dev, "format : %d\n", priv->format->code);
-	dev_dbg(&client->dev, "size   : %d x %d\n",
-		priv->frame.width,
-		priv->frame.height);
+		ECHECKER(ret, mt9t112_auto_focus_trigger(client));
 
-	CLOCK_INFO(client, EXT_CLOCK);
+		dev_dbg(&client->dev, "format : %d\n", priv->format->code);
+		dev_dbg(&client->dev, "size   : %d x %d\n",
+			priv->frame.width,
+			priv->frame.height);
 
-	return ret;
+		CLOCK_INFO(client, EXT_CLOCK);
+
+		return ret;
+	}
 }
 
 static int mt9t112_set_params(struct mt9t112_priv *priv,
@@ -1019,11 +1192,60 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = {
 };
 
 /************************************************************************
+		v4l2_subdev_pad_ops
+************************************************************************/
+static int mt9t111_get_pad_format(struct v4l2_subdev *subdev,
+		struct v4l2_subdev_fh *fh,
+		struct v4l2_subdev_format *fmt)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	fmt->format = priv->fmt;
+	return 0;
+}
+
+static int mt9t111_set_pad_format(struct v4l2_subdev *subdev,
+				struct v4l2_subdev_fh *fh,
+				struct v4l2_subdev_format *fmt)
+{
+	int i;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) {
+		if (fmt->format.code == mt9t112_cfmts[i].code)
+			goto fmt_found;
+	}
+	if (i >= ARRAY_SIZE(mt9t112_cfmts))
+		return -EINVAL;
+
+fmt_found:
+	/*
+	 * Only VGA resolution supported
+	 */
+	fmt->format.width = VGA_WIDTH;
+	fmt->format.height = VGA_HEIGHT;
+	fmt->format.field = V4L2_FIELD_NONE;
+	fmt->format.colorspace = V4L2_COLORSPACE_JPEG;
+
+	priv->fmt = fmt->format;
+
+	return 0;
+}
+
+static const struct v4l2_subdev_pad_ops mt9t111_pad_ops = {
+	.get_fmt        = mt9t111_get_pad_format,
+	.set_fmt        = mt9t111_set_pad_format,
+};
+
+/************************************************************************
 			i2c driver
 ************************************************************************/
 static struct v4l2_subdev_ops mt9t112_subdev_ops = {
 	.core	= &mt9t112_subdev_core_ops,
 	.video	= &mt9t112_subdev_video_ops,
+	.pad    = &mt9t111_pad_ops,
 };
 
 static int mt9t112_camera_probe(struct i2c_client *client)
@@ -1089,6 +1311,32 @@ static int mt9t112_probe(struct i2c_client *client,
 	/* Cannot fail: using the default supported pixel code */
 	mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
 
+	if (priv->model == V4L2_IDENT_MT9T111) {
+		priv->omap3evm_1v8 = regulator_get(NULL, "vio_1v8");
+		if (IS_ERR(priv->omap3evm_1v8)) {
+			printk(KERN_ERR "vio_1v8 regulator missing\n");
+			ret =  PTR_ERR(priv->omap3evm_1v8);
+			goto err_1;
+		}
+		priv->omap3evm_2v8 = regulator_get(NULL, "cam_2v8");
+		if (IS_ERR(priv->omap3evm_2v8)) {
+			printk(KERN_ERR "cam_2v8 regulator missing\n");
+			ret = PTR_ERR(priv->omap3evm_2v8);
+			goto err_2;
+		}
+
+		priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
+		ret = media_entity_init(&priv->subdev.entity, 1, &priv->pad, 0);
+		if (!ret)
+			return 0;
+		kfree(priv);
+err_2:
+		regulator_put(priv->omap3evm_2v8);
+err_1:
+		regulator_put(priv->omap3evm_1v8);
+	}
+
 	return ret;
 }
 
diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
new file mode 100644
index 0000000..372dc0d
--- /dev/null
+++ b/include/media/mt9t111.h
@@ -0,0 +1,45 @@
+/*
+ * include/media/mt9t111.h
+ *
+ * mt9t111 sensor driver
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef	MT9T111_H
+#define	MT9T111_H
+
+struct v4l2_subdev;
+
+/*
+ * Defines and Macros and globals
+ */
+#define MT9T111_MODULE_NAME		"mt9t112"
+
+/*i2c adress for MT9T111*/
+#define MT9T111_I2C_ADDR		(0x78 >> 1)
+
+#define MT9T111_CLK_MAX			(96000000) /* 96MHz */
+#define MT9T111_CLK_MIN			(6000000)  /* 6Mhz */
+
+#define MT9T111_I2C_CONFIG		(1)
+#define I2C_ONE_BYTE_TRANSFER		(1)
+#define I2C_TWO_BYTE_TRANSFER		(2)
+#define I2C_THREE_BYTE_TRANSFER		(3)
+#define I2C_FOUR_BYTE_TRANSFER		(4)
+#define I2C_TXRX_DATA_MASK		(0x00FF)
+#define I2C_TXRX_DATA_MASK_UPPER	(0xFF00)
+#define I2C_TXRX_DATA_SHIFT		(8)
+
+struct mt9t111_platform_data {
+	int (*s_power) (struct v4l2_subdev *subdev, u32 on);
+	int (*set_xclk) (struct v4l2_subdev *subdev, u32 hz);
+	int (*configure_interface) (struct v4l2_subdev *subdev, u32 pixclk);
+};
+
+#endif	/* ifndef MT9T111 */
+
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

Added support for mt9t111 sensor in the existing
mt9t112 driver. Also added support for media controller
framework. The sensor driver currently supports only
VGA resolution.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/Kconfig       |    7 +
 drivers/media/video/Makefile      |    1 +
 drivers/media/video/mt9t111_reg.h | 1367 +++++++++++++++++++++++++++++++++++++
 drivers/media/video/mt9t112.c     |  320 ++++++++-
 include/media/mt9t111.h           |   45 ++
 5 files changed, 1704 insertions(+), 36 deletions(-)
 create mode 100644 drivers/media/video/mt9t111_reg.h
 create mode 100644 include/media/mt9t111.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 14326d7..b5806e8 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -482,6 +482,13 @@ config VIDEO_MT9V032
 	  This is a Video4Linux2 sensor-level driver for the Micron
 	  MT9V032 752x480 CMOS sensor.
 
+config VIDEO_MT9T111
+	tristate "Aptina MT9T111 VGA CMOS IMAGE SENSOR"
+	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
+	---help---
+	 This is a Video4Linux2 sensor-level driver for the Aptina MT9T111
+	 image 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 c06f515..02a8b70 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
 obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
 obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
 obj-$(CONFIG_VIDEO_SR030PC30)	+= sr030pc30.o
+obj-$(CONFIG_VIDEO_MT9T111) += mt9t112.o
 obj-$(CONFIG_VIDEO_NOON010PC30)	+= noon010pc30.o
 obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
 obj-$(CONFIG_VIDEO_ADP1653)	+= adp1653.o
diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
new file mode 100644
index 0000000..2f610d4
--- /dev/null
+++ b/drivers/media/video/mt9t111_reg.h
@@ -0,0 +1,1367 @@
+/*
+ * drivers/media/video/mt9t111_reg.h
+ *
+ * mt9t111 sensor driver header file
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef MT9T111_REG_H
+#define MT9T111_REG_H
+
+/* register addr */
+#define MT9T111_CHIP_ID		(0x0000)
+
+/* register value */
+#define MT9T111_CHIP_ID_VALUE	(0x2680)
+
+#define MT9T111_IMAGE_WIDTH		(640)
+#define MT9T111_IMAGE_HEIGHT		(480)
+
+typedef struct {
+	u16 delay_time;
+	u16 addr;
+	u16 data;
+} mt9t111_regs;
+
+mt9t111_regs patch_rev6[] = {
+	{0, 0x0982, 0x0},
+	{0, 0x098A, 0xCE7},
+	{0, 0x0990, 0x3C3C},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C5F},
+	{0, 0x0996, 0x4F30},
+	{0, 0x0998, 0xED08},
+	{0, 0x099a, 0xBD61},
+	{0, 0x099c, 0xD5CE},
+	{0, 0x099e, 0x4CD},
+	{0, 0x098A, 0xCF7},
+	{0, 0x0990, 0x1F17},
+	{0, 0x0992, 0x211},
+	{0, 0x0994, 0xCC33},
+	{0, 0x0996, 0x2E30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCFF},
+	{0, 0x099c, 0xFDED},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0xD07},
+	{0, 0x0990, 0x2},
+	{0, 0x0992, 0xBD70},
+	{0, 0x0994, 0x6D18},
+	{0, 0x0996, 0xDE1F},
+	{0, 0x0998, 0x181F},
+	{0, 0x099a, 0x8E01},
+	{0, 0x099c, 0x10CC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD17},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x18},
+	{0, 0x0994, 0xECA0},
+	{0, 0x0996, 0xC4FD},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2120},
+	{0, 0x099c, 0x1ECC},
+	{0, 0x099e, 0x3C52},
+	{0, 0x098A, 0xD27},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0xDE},
+	{0, 0x0994, 0x1FEC},
+	{0, 0x0996, 0xA0BD},
+	{0, 0x0998, 0x7021},
+	{0, 0x099a, 0xCC3C},
+	{0, 0x099c, 0x5230},
+	{0, 0x099e, 0xED02},
+	{0, 0x098A, 0xD37},
+	{0, 0x0990, 0xCCFF},
+	{0, 0x0992, 0xFCED},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0x2},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x6DFC},
+	{0, 0x099c, 0x4E1},
+	{0, 0x099e, 0x1A83},
+	{0, 0x098A, 0xD47},
+	{0, 0x0990, 0x1},
+	{0, 0x0992, 0x2720},
+	{0, 0x0994, 0x1A83},
+	{0, 0x0996, 0x4},
+	{0, 0x0998, 0x271E},
+	{0, 0x099a, 0x1A83},
+	{0, 0x099c, 0x8},
+	{0, 0x099e, 0x271C},
+	{0, 0x098A, 0xD57},
+	{0, 0x0990, 0x1A83},
+	{0, 0x0992, 0x10},
+	{0, 0x0994, 0x271A},
+	{0, 0x0996, 0x1A83},
+	{0, 0x0998, 0x20},
+	{0, 0x099a, 0x2718},
+	{0, 0x099c, 0x1A83},
+	{0, 0x099e, 0x40},
+	{0, 0x098A, 0xD67},
+	{0, 0x0990, 0x2716},
+	{0, 0x0992, 0x2019},
+	{0, 0x0994, 0xC61E},
+	{0, 0x0996, 0x2012},
+	{0, 0x0998, 0xC622},
+	{0, 0x099a, 0x200E},
+	{0, 0x099c, 0xC621},
+	{0, 0x099e, 0x200A},
+	{0, 0x098A, 0xD77},
+	{0, 0x0990, 0xC620},
+	{0, 0x0992, 0x2006},
+	{0, 0x0994, 0xC62A},
+	{0, 0x0996, 0x2002},
+	{0, 0x0998, 0xC62B},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x8CC},
+	{0, 0x099e, 0x3400},
+	{0, 0x098A, 0xD87},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x34},
+	{0, 0x0994, 0xBD6F},
+	{0, 0x0996, 0xD184},
+	{0, 0x0998, 0x330},
+	{0, 0x099a, 0xED07},
+	{0, 0x099c, 0xA60A},
+	{0, 0x099e, 0x4848},
+	{0, 0x098A, 0xD97},
+	{0, 0x0990, 0x5FED},
+	{0, 0x0992, 0x5EA},
+	{0, 0x0994, 0x8AA},
+	{0, 0x0996, 0x731},
+	{0, 0x0998, 0xBD70},
+	{0, 0x099a, 0x2130},
+	{0, 0x099c, 0xC60A},
+	{0, 0x099e, 0x3A35},
+	{0, 0x098A, 0xDA7},
+	{0, 0x0990, 0x3937},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0x3C34},
+	{0, 0x0996, 0xDE2F},
+	{0, 0x0998, 0xEE0E},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x7D13},
+	{0, 0x099e, 0xEF27},
+	{0, 0x098A, 0xDB7},
+	{0, 0x0990, 0x7CCE},
+	{0, 0x0992, 0x13E0},
+	{0, 0x0994, 0x1E05},
+	{0, 0x0996, 0x1060},
+	{0, 0x0998, 0xE60E},
+	{0, 0x099a, 0x4FC3},
+	{0, 0x099c, 0x13F0},
+	{0, 0x099e, 0x8FE6},
+	{0, 0x098A, 0xDC7},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0xE107},
+	{0, 0x0994, 0x2216},
+	{0, 0x0996, 0xF613},
+	{0, 0x0998, 0xEE4F},
+	{0, 0x099a, 0xC313},
+	{0, 0x099c, 0xF38F},
+	{0, 0x099e, 0xE600},
+	{0, 0x098A, 0xDD7},
+	{0, 0x0990, 0x30E1},
+	{0, 0x0992, 0x725},
+	{0, 0x0994, 0x7F6},
+	{0, 0x0996, 0x13EE},
+	{0, 0x0998, 0xC103},
+	{0, 0x099a, 0x253C},
+	{0, 0x099c, 0x7F13},
+	{0, 0x099e, 0xEEF6},
+	{0, 0x098A, 0xDE7},
+	{0, 0x0990, 0x13EF},
+	{0, 0x0992, 0xE706},
+	{0, 0x0994, 0xCC13},
+	{0, 0x0996, 0xF0ED},
+	{0, 0x0998, 0x4CC},
+	{0, 0x099a, 0x13F3},
+	{0, 0x099c, 0x200F},
+	{0, 0x099e, 0x7C13},
+	{0, 0x098A, 0xDF7},
+	{0, 0x0990, 0xEEEC},
+	{0, 0x0992, 0x4C3},
+	{0, 0x0994, 0x1},
+	{0, 0x0996, 0xED04},
+	{0, 0x0998, 0xEC02},
+	{0, 0x099a, 0xC300},
+	{0, 0x099c, 0x1ED},
+	{0, 0x099e, 0x2F6},
+	{0, 0x098A, 0xE07},
+	{0, 0x0990, 0x13EE},
+	{0, 0x0992, 0xE106},
+	{0, 0x0994, 0x2412},
+	{0, 0x0996, 0xEE04},
+	{0, 0x0998, 0xE600},
+	{0, 0x099a, 0x30E1},
+	{0, 0x099c, 0x722},
+	{0, 0x099e, 0xDFEE},
+	{0, 0x098A, 0xE17},
+	{0, 0x0990, 0x2E6},
+	{0, 0x0992, 0x30},
+	{0, 0x0994, 0xE107},
+	{0, 0x0996, 0x25D6},
+	{0, 0x0998, 0xDE49},
+	{0, 0x099a, 0xEE08},
+	{0, 0x099c, 0xAD00},
+	{0, 0x099e, 0xCC13},
+	{0, 0x098A, 0xE27},
+	{0, 0x0990, 0xF630},
+	{0, 0x0992, 0xED00},
+	{0, 0x0994, 0xDE2F},
+	{0, 0x0996, 0xEE10},
+	{0, 0x0998, 0xCC13},
+	{0, 0x099a, 0xFAAD},
+	{0, 0x099c, 0x38},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0xE37},
+	{0, 0x0990, 0x3839},
+	{0, 0x098A, 0x1000},
+	{0, 0x0990, 0xCC10},
+	{0, 0x0992, 0x9BD},
+	{0, 0x0994, 0x4224},
+	{0, 0x0996, 0x7E10},
+	{0, 0x0998, 0x9C6},
+	{0, 0x099a, 0x1F7},
+	{0, 0x099c, 0x18A},
+	{0, 0x099e, 0xC606},
+	{0, 0x098A, 0x1010},
+	{0, 0x0990, 0xF701},
+	{0, 0x0992, 0x8BDE},
+	{0, 0x0994, 0x3F18},
+	{0, 0x0996, 0xCE0B},
+	{0, 0x0998, 0xF1CC},
+	{0, 0x099a, 0x11},
+	{0, 0x099c, 0xBDD7},
+	{0, 0x099e, 0xCC},
+	{0, 0x098A, 0x1020},
+	{0, 0x0990, 0xBF1},
+	{0, 0x0992, 0xDD3F},
+	{0, 0x0994, 0xDE35},
+	{0, 0x0996, 0x18CE},
+	{0, 0x0998, 0xC03},
+	{0, 0x099a, 0xCC00},
+	{0, 0x099c, 0x3FBD},
+	{0, 0x099e, 0xD700},
+	{0, 0x098A, 0x1030},
+	{0, 0x0990, 0xCC0C},
+	{0, 0x0992, 0x3DD},
+	{0, 0x0994, 0x35DE},
+	{0, 0x0996, 0x4718},
+	{0, 0x0998, 0xCE0C},
+	{0, 0x099a, 0x43CC},
+	{0, 0x099c, 0x15},
+	{0, 0x099e, 0xBDD7},
+	{0, 0x098A, 0x1040},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0xC43},
+	{0, 0x0994, 0xDD47},
+	{0, 0x0996, 0xFE00},
+	{0, 0x0998, 0x3318},
+	{0, 0x099a, 0xCE0C},
+	{0, 0x099c, 0x59CC},
+	{0, 0x099e, 0x9},
+	{0, 0x098A, 0x1050},
+	{0, 0x0990, 0xBDD7},
+	{0, 0x0992, 0xCC},
+	{0, 0x0994, 0xC59},
+	{0, 0x0996, 0xFD00},
+	{0, 0x0998, 0x33DE},
+	{0, 0x099a, 0x4118},
+	{0, 0x099c, 0xCE0C},
+	{0, 0x099e, 0x63CC},
+	{0, 0x098A, 0x1060},
+	{0, 0x0990, 0xD},
+	{0, 0x0992, 0xBDD7},
+	{0, 0x0994, 0xCC},
+	{0, 0x0996, 0xC63},
+	{0, 0x0998, 0xDD41},
+	{0, 0x099a, 0xFE00},
+	{0, 0x099c, 0x3118},
+	{0, 0x099e, 0xCE0C},
+	{0, 0x098A, 0x1070},
+	{0, 0x0990, 0x71CC},
+	{0, 0x0992, 0x29},
+	{0, 0x0994, 0xBDD7},
+	{0, 0x0996, 0xCC},
+	{0, 0x0998, 0xC71},
+	{0, 0x099a, 0xFD00},
+	{0, 0x099c, 0x31DE},
+	{0, 0x099e, 0x3918},
+	{0, 0x098A, 0x1080},
+	{0, 0x0990, 0xCE0C},
+	{0, 0x0992, 0x9BCC},
+	{0, 0x0994, 0x23},
+	{0, 0x0996, 0xBDD7},
+	{0, 0x0998, 0xCC},
+	{0, 0x099a, 0xC9B},
+	{0, 0x099c, 0xDD39},
+	{0, 0x099e, 0xDE49},
+	{0, 0x098A, 0x1090},
+	{0, 0x0990, 0x18CE},
+	{0, 0x0992, 0xCBF},
+	{0, 0x0994, 0xCC00},
+	{0, 0x0996, 0xDBD},
+	{0, 0x0998, 0xD700},
+	{0, 0x099a, 0xCC0C},
+	{0, 0x099c, 0xBFDD},
+	{0, 0x099e, 0x49CC},
+	{0, 0x098A, 0x10A0},
+	{0, 0x0990, 0x1162},
+	{0, 0x0992, 0xFD0B},
+	{0, 0x0994, 0xFDCC},
+	{0, 0x0996, 0xCE7},
+	{0, 0x0998, 0xFD0C},
+	{0, 0x099a, 0x1FCC},
+	{0, 0x099c, 0x1245},
+	{0, 0x099e, 0xFD0C},
+	{0, 0x098A, 0x10B0},
+	{0, 0x0990, 0x51CC},
+	{0, 0x0992, 0x110B},
+	{0, 0x0994, 0xFD0C},
+	{0, 0x0996, 0x5BCC},
+	{0, 0x0998, 0x1108},
+	{0, 0x099a, 0xFD0C},
+	{0, 0x099c, 0x65CC},
+	{0, 0x099e, 0x10D0},
+	{0, 0x098A, 0x10C0},
+	{0, 0x0990, 0xFD0C},
+	{0, 0x0992, 0x7BCC},
+	{0, 0x0994, 0x12DE},
+	{0, 0x0996, 0xFD0C},
+	{0, 0x0998, 0xA7CC},
+	{0, 0x099a, 0xDA8},
+	{0, 0x099c, 0xFD0C},
+	{0, 0x099e, 0xCB39},
+	{0, 0x098A, 0x10D0},
+	{0, 0x0990, 0x37DE},
+	{0, 0x0992, 0x1DEC},
+	{0, 0x0994, 0xC5F},
+	{0, 0x0996, 0x8402},
+	{0, 0x0998, 0x4416},
+	{0, 0x099a, 0x4FF7},
+	{0, 0x099c, 0xCCD},
+	{0, 0x099e, 0xE60B},
+	{0, 0x098A, 0x10E0},
+	{0, 0x0990, 0xC407},
+	{0, 0x0992, 0xF70C},
+	{0, 0x0994, 0xCE7F},
+	{0, 0x0996, 0x30C4},
+	{0, 0x0998, 0xEC25},
+	{0, 0x099a, 0xFD30},
+	{0, 0x099c, 0xC5FC},
+	{0, 0x099e, 0x6D6},
+	{0, 0x098A, 0x10F0},
+	{0, 0x0990, 0xFD30},
+	{0, 0x0992, 0xC701},
+	{0, 0x0994, 0xFC30},
+	{0, 0x0996, 0xC0FD},
+	{0, 0x0998, 0xBED},
+	{0, 0x099a, 0xFC30},
+	{0, 0x099c, 0xC2FD},
+	{0, 0x099e, 0xBEF},
+	{0, 0x098A, 0x1100},
+	{0, 0x0990, 0x30E6},
+	{0, 0x0992, 0xBD},
+	{0, 0x0994, 0x5203},
+	{0, 0x0996, 0x3139},
+	{0, 0x0998, 0x7E9E},
+	{0, 0x099a, 0x143C},
+	{0, 0x099c, 0x3C3C},
+	{0, 0x099e, 0x2101},
+	{0, 0x098A, 0x1110},
+	{0, 0x0990, 0xCC00},
+	{0, 0x0992, 0x18BD},
+	{0, 0x0994, 0x6FD1},
+	{0, 0x0996, 0xC504},
+	{0, 0x0998, 0x26F5},
+	{0, 0x099a, 0xDC25},
+	{0, 0x099c, 0x30ED},
+	{0, 0x099e, 0x420},
+	{0, 0x098A, 0x1120},
+	{0, 0x0990, 0x12EE},
+	{0, 0x0992, 0x43C},
+	{0, 0x0994, 0x1838},
+	{0, 0x0996, 0xE621},
+	{0, 0x0998, 0x18E7},
+	{0, 0x099a, 0xBE30},
+	{0, 0x099c, 0xEE04},
+	{0, 0x099e, 0xEC1D},
+	{0, 0x098A, 0x1130},
+	{0, 0x0990, 0x30ED},
+	{0, 0x0992, 0x4EC},
+	{0, 0x0994, 0x426},
+	{0, 0x0996, 0xEACC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0xED02},
+	{0, 0x099c, 0xCCFB},
+	{0, 0x099e, 0xFFED},
+	{0, 0x098A, 0x1140},
+	{0, 0x0990, 0xCC},
+	{0, 0x0992, 0x400},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6DCC},
+	{0, 0x0998, 0x1A},
+	{0, 0x099a, 0x30ED},
+	{0, 0x099c, 0x2CC},
+	{0, 0x099e, 0xFBFF},
+	{0, 0x098A, 0x1150},
+	{0, 0x0990, 0xED00},
+	{0, 0x0992, 0x5F4F},
+	{0, 0x0994, 0xBD70},
+	{0, 0x0996, 0x6D5F},
+	{0, 0x0998, 0xBD5B},
+	{0, 0x099a, 0x17BD},
+	{0, 0x099c, 0x558B},
+	{0, 0x099e, 0x3838},
+	{0, 0x098A, 0x1160},
+	{0, 0x0990, 0x3839},
+	{0, 0x0992, 0x3C3C},
+	{0, 0x0994, 0xC640},
+	{0, 0x0996, 0xF730},
+	{0, 0x0998, 0xC4FC},
+	{0, 0x099a, 0xBED},
+	{0, 0x099c, 0xFD30},
+	{0, 0x099e, 0xC0FC},
+	{0, 0x098A, 0x1170},
+	{0, 0x0990, 0xBEF},
+	{0, 0x0992, 0xFD30},
+	{0, 0x0994, 0xC2DE},
+	{0, 0x0996, 0x1DEC},
+	{0, 0x0998, 0x25FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1180},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xD6EC},
+	{0, 0x0996, 0xC5F},
+	{0, 0x0998, 0x8402},
+	{0, 0x099a, 0x4416},
+	{0, 0x099c, 0x4F30},
+	{0, 0x099e, 0xE703},
+	{0, 0x098A, 0x1190},
+	{0, 0x0990, 0xF10C},
+	{0, 0x0992, 0xCD27},
+	{0, 0x0994, 0x15F1},
+	{0, 0x0996, 0xCCD},
+	{0, 0x0998, 0x2309},
+	{0, 0x099a, 0xFC06},
+	{0, 0x099c, 0xD604},
+	{0, 0x099e, 0xFD06},
+	{0, 0x098A, 0x11A0},
+	{0, 0x0990, 0xD620},
+	{0, 0x0992, 0x7FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0x5FD},
+	{0, 0x0998, 0x6D6},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xE60B},
+	{0, 0x099e, 0xC407},
+	{0, 0x098A, 0x11B0},
+	{0, 0x0990, 0x30E7},
+	{0, 0x0992, 0x2F1},
+	{0, 0x0994, 0xCCE},
+	{0, 0x0996, 0x272C},
+	{0, 0x0998, 0x7D0C},
+	{0, 0x099a, 0xCE27},
+	{0, 0x099c, 0x275D},
+	{0, 0x099e, 0x2724},
+	{0, 0x098A, 0x11C0},
+	{0, 0x0990, 0x7F30},
+	{0, 0x0992, 0xC4FC},
+	{0, 0x0994, 0x6D6},
+	{0, 0x0996, 0xFD30},
+	{0, 0x0998, 0xC5F6},
+	{0, 0x099a, 0xCCE},
+	{0, 0x099c, 0x4FFD},
+	{0, 0x099e, 0x30C7},
+	{0, 0x098A, 0x11D0},
+	{0, 0x0990, 0xC640},
+	{0, 0x0992, 0xF730},
+	{0, 0x0994, 0xC4E6},
+	{0, 0x0996, 0x24F},
+	{0, 0x0998, 0xFD30},
+	{0, 0x099a, 0xC501},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x11E0},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0x7D06},
+	{0, 0x0996, 0xCB27},
+	{0, 0x0998, 0x2EC6},
+	{0, 0x099a, 0x40F7},
+	{0, 0x099c, 0x30C4},
+	{0, 0x099e, 0xFC06},
+	{0, 0x098A, 0x11F0},
+	{0, 0x0990, 0xC104},
+	{0, 0x0992, 0xF306},
+	{0, 0x0994, 0xD6ED},
+	{0, 0x0996, 0x5F},
+	{0, 0x0998, 0x6D00},
+	{0, 0x099a, 0x2A01},
+	{0, 0x099c, 0x5317},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1200},
+	{0, 0x0990, 0xC0EC},
+	{0, 0x0992, 0xFD},
+	{0, 0x0994, 0x30C2},
+	{0, 0x0996, 0xFC06},
+	{0, 0x0998, 0xC1FD},
+	{0, 0x099a, 0x30C5},
+	{0, 0x099c, 0x101},
+	{0, 0x099e, 0x1FC},
+	{0, 0x098A, 0x1210},
+	{0, 0x0990, 0x30C2},
+	{0, 0x0992, 0xFD06},
+	{0, 0x0994, 0xC720},
+	{0, 0x0996, 0x227F},
+	{0, 0x0998, 0x30C4},
+	{0, 0x099a, 0xDE1D},
+	{0, 0x099c, 0xEC25},
+	{0, 0x099e, 0xFD30},
+	{0, 0x098A, 0x1220},
+	{0, 0x0990, 0xC5FC},
+	{0, 0x0992, 0x6D6},
+	{0, 0x0994, 0xFD30},
+	{0, 0x0996, 0xC701},
+	{0, 0x0998, 0xFC30},
+	{0, 0x099a, 0xC0FD},
+	{0, 0x099c, 0x6D0},
+	{0, 0x099e, 0xFC30},
+	{0, 0x098A, 0x1230},
+	{0, 0x0990, 0xC2FD},
+	{0, 0x0992, 0x6D2},
+	{0, 0x0994, 0xEC25},
+	{0, 0x0996, 0xFD06},
+	{0, 0x0998, 0xC3BD},
+	{0, 0x099a, 0x953C},
+	{0, 0x099c, 0xDE3F},
+	{0, 0x099e, 0xEE10},
+	{0, 0x098A, 0x1240},
+	{0, 0x0990, 0xAD00},
+	{0, 0x0992, 0x3838},
+	{0, 0x0994, 0x3930},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0xFFE9},
+	{0, 0x099a, 0x8F35},
+	{0, 0x099c, 0xBDAD},
+	{0, 0x099e, 0x1530},
+	{0, 0x098A, 0x1250},
+	{0, 0x0990, 0x6F16},
+	{0, 0x0992, 0x18DE},
+	{0, 0x0994, 0x1918},
+	{0, 0x0996, 0x8FC3},
+	{0, 0x0998, 0x14B},
+	{0, 0x099a, 0x188F},
+	{0, 0x099c, 0x18EC},
+	{0, 0x099e, 0xFD},
+	{0, 0x098A, 0x1260},
+	{0, 0x0990, 0x50E},
+	{0, 0x0992, 0x18EC},
+	{0, 0x0994, 0x2FD},
+	{0, 0x0996, 0x510},
+	{0, 0x0998, 0xE616},
+	{0, 0x099a, 0x4FED},
+	{0, 0x099c, 0x418},
+	{0, 0x099e, 0x8FC3},
+	{0, 0x098A, 0x1270},
+	{0, 0x0990, 0xFFCB},
+	{0, 0x0992, 0xE304},
+	{0, 0x0994, 0x8FE6},
+	{0, 0x0996, 0xF7},
+	{0, 0x0998, 0x514},
+	{0, 0x099a, 0x18DE},
+	{0, 0x099c, 0x1930},
+	{0, 0x099e, 0xE616},
+	{0, 0x098A, 0x1280},
+	{0, 0x0990, 0x4FED},
+	{0, 0x0992, 0x418},
+	{0, 0x0994, 0x8FC3},
+	{0, 0x0996, 0x119},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FE6},
+	{0, 0x099c, 0xF7},
+	{0, 0x099e, 0x515},
+	{0, 0x098A, 0x1290},
+	{0, 0x0990, 0xFC05},
+	{0, 0x0992, 0x5BFD},
+	{0, 0x0994, 0x512},
+	{0, 0x0996, 0xDE37},
+	{0, 0x0998, 0xEE08},
+	{0, 0x099a, 0xAD00},
+	{0, 0x099c, 0x30E6},
+	{0, 0x099e, 0x164F},
+	{0, 0x098A, 0x12A0},
+	{0, 0x0990, 0x5ED},
+	{0, 0x0992, 0x48F},
+	{0, 0x0994, 0xC300},
+	{0, 0x0996, 0x630},
+	{0, 0x0998, 0xE304},
+	{0, 0x099a, 0x8FF6},
+	{0, 0x099c, 0x516},
+	{0, 0x099e, 0x4FED},
+	{0, 0x098A, 0x12B0},
+	{0, 0x0990, 0x30},
+	{0, 0x0992, 0x6C16},
+	{0, 0x0994, 0xE616},
+	{0, 0x0996, 0xC103},
+	{0, 0x0998, 0x2598},
+	{0, 0x099a, 0xCC32},
+	{0, 0x099c, 0x8EED},
+	{0, 0x099e, 0xEC},
+	{0, 0x098A, 0x12C0},
+	{0, 0x0990, 0x6BD},
+	{0, 0x0992, 0x7021},
+	{0, 0x0994, 0xCC32},
+	{0, 0x0996, 0x6C30},
+	{0, 0x0998, 0xED02},
+	{0, 0x099a, 0xCCF8},
+	{0, 0x099c, 0xED},
+	{0, 0x099e, 0xA6},
+	{0, 0x098A, 0x12D0},
+	{0, 0x0990, 0x9E3},
+	{0, 0x0992, 0xA84},
+	{0, 0x0994, 0x7BD},
+	{0, 0x0996, 0x706D},
+	{0, 0x0998, 0x30C6},
+	{0, 0x099a, 0x173A},
+	{0, 0x099c, 0x3539},
+	{0, 0x099e, 0x3CBD},
+	{0, 0x098A, 0x12E0},
+	{0, 0x0990, 0x776D},
+	{0, 0x0992, 0xCC32},
+	{0, 0x0994, 0x5C30},
+	{0, 0x0996, 0xED00},
+	{0, 0x0998, 0xFC13},
+	{0, 0x099a, 0x8683},
+	{0, 0x099c, 0x1},
+	{0, 0x099e, 0xBD70},
+	{0, 0x098A, 0x12F0},
+	{0, 0x0990, 0x21CC},
+	{0, 0x0992, 0x325E},
+	{0, 0x0994, 0x30ED},
+	{0, 0x0996, 0xFC},
+	{0, 0x0998, 0x1388},
+	{0, 0x099a, 0x8300},
+	{0, 0x099c, 0x1BD},
+	{0, 0x099e, 0x7021},
+	{0, 0x098A, 0x1300},
+	{0, 0x0990, 0x3839},
+	{0, 0x098E, 0x0010},
+	{0, 0x0990, 0x1000},
+	{0, 0x098E, 0x0003},
+	{100, 0x0990, 0x0004}
+};
+
+mt9t111_regs def_regs1[] = {
+	{0, 0x001A, 0x0218},
+	{0, 0x001E, 0x0777},
+	{0, 0x3084, 0x2409},
+	{0, 0x3092, 0x0A49},
+	{0, 0x3094, 0x4949},
+	{0, 0x3096, 0x4950},
+	{0, 0x0018, 0x402D},
+	{100, 0x0018, 0x402C},
+	{0, 0x098E, 0x6800},
+	{0, 0x0990, 0x0280},
+	{0, 0x098E, 0x6802},
+	{0, 0x0990, 0x01E0},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x4802},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4804},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x4806},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4808},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x480A},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x480C},
+	{0, 0x0990, 0x046C},
+	{0, 0x098E, 0x480F},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4811},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x4813},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x481D},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x481F},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x4825},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0x6C00},
+	{0, 0x0990, 0x0800},
+	{0, 0x098E, 0x6C02},
+	{0, 0x0990, 0x0600},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082D},
+	{0, 0x098E, 0x484A},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484C},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x484E},
+	{0, 0x0990, 0x060D},
+	{0, 0x098E, 0x4850},
+	{0, 0x0990, 0x080D},
+	{0, 0x098E, 0x4852},
+	{0, 0x0990, 0x0111},
+	{0, 0x098E, 0x4854},
+	{0, 0x0990, 0x146C},
+	{0, 0x098E, 0x4857},
+	{0, 0x0990, 0x00CC},
+	{0, 0x098E, 0x4859},
+	{0, 0x0990, 0x0381},
+	{0, 0x098E, 0x485B},
+	{0, 0x0990, 0x024F},
+	{0, 0x098E, 0x4865},
+	{0, 0x0990, 0x05AE},
+	{0, 0x098E, 0x4867},
+	{0, 0x0990, 0x05D0},
+	{0, 0x098E, 0x486D},
+	{0, 0x0990, 0x07AC},
+	{0, 0x098E, 0xC8A5},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC8A6},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC8A7},
+	{0, 0x0990, 0x0023},
+	{0, 0x098E, 0xC8A8},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC844},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC92F},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC845},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92D},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88C},
+	{0, 0x0990, 0x0091},
+	{0, 0x098E, 0xC930},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC88D},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0xC92E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xA002},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xA009},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0xA00A},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xA00C},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x4846},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x68AA},
+	{0, 0x0990, 0x0278},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x6CAA},
+	{0, 0x0990, 0x0218},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0005},
+	{0, 0x3C20, 0x0001},
+	{0, 0x364A, 0x7D2F},
+	{0, 0x364C, 0x79EB},
+	{0, 0x364E, 0x18D2},
+	{0, 0x3650, 0x9F8F},
+	{0, 0x3652, 0xA7D2},
+	{0, 0x368A, 0x460C},
+	{0, 0x368C, 0x14F0},
+	{0, 0x368E, 0x946F},
+	{0, 0x3690, 0xC471},
+	{0, 0x3692, 0x04B1},
+	{0, 0x36CA, 0x0433},
+	{0, 0x36CC, 0x680D},
+	{0, 0x36CE, 0xEEF3},
+	{0, 0x36D0, 0x4850},
+	{0, 0x36D2, 0xF233},
+	{0, 0x370A, 0xB2AF},
+	{0, 0x370C, 0x2CF0},
+	{0, 0x370E, 0x3F10},
+	{0, 0x3710, 0xC673},
+	{0, 0x3712, 0xA972},
+	{0, 0x374A, 0x0590},
+	{0, 0x374C, 0xAFB3},
+	{0, 0x374E, 0x93D7},
+	{0, 0x3750, 0x8D12},
+	{0, 0x3752, 0x2539},
+	{0, 0x3640, 0x0350},
+	{0, 0x3642, 0x322C},
+	{0, 0x3644, 0x77D1},
+	{0, 0x3646, 0xA26F},
+	{0, 0x3648, 0xC872},
+	{0, 0x3680, 0x0C4C},
+	{0, 0x3682, 0x9510},
+	{0, 0x3684, 0x110E},
+	{0, 0x3686, 0x4331},
+	{0, 0x3688, 0xC1CF},
+	{0, 0x36C0, 0x6152},
+	{0, 0x36C2, 0x038E},
+	{0, 0x36C4, 0x9AF4},
+	{0, 0x36C6, 0xE12F},
+	{0, 0x36C8, 0x09F3},
+	{0, 0x3700, 0xC5AF},
+	{0, 0x3702, 0xCA90},
+	{0, 0x3704, 0x5D0F},
+	{0, 0x3706, 0x3293},
+	{0, 0x3708, 0x2B92},
+	{0, 0x3740, 0xC590},
+	{0, 0x3742, 0x8133},
+	{0, 0x3744, 0xE0F6},
+	{0, 0x3746, 0x0254},
+	{0, 0x3748, 0x10B9},
+	{0, 0x3654, 0x7F8F},
+	{0, 0x3656, 0x6F6C},
+	{0, 0x3658, 0x5971},
+	{0, 0x365A, 0x9A0F},
+	{0, 0x365C, 0xA1B2},
+	{0, 0x3694, 0xB00C},
+	{0, 0x3696, 0xEBCF},
+	{0, 0x3698, 0x06AD},
+	{0, 0x369A, 0x4D31},
+	{0, 0x369C, 0x2A4E},
+	{0, 0x36D4, 0x4752},
+	{0, 0x36D6, 0x724D},
+	{0, 0x36D8, 0xAD34},
+	{0, 0x36DA, 0x1350},
+	{0, 0x36DC, 0x4E94},
+	{0, 0x3714, 0xA06E},
+	{0, 0x3716, 0x9152},
+	{0, 0x3718, 0x1F53},
+	{0, 0x371A, 0x3933},
+	{0, 0x371C, 0xBA94},
+	{0, 0x3754, 0x1233},
+	{0, 0x3756, 0xA032},
+	{0, 0x3758, 0xE936},
+	{0, 0x375A, 0xBE34},
+	{0, 0x375C, 0x02D9},
+	{0, 0x365E, 0x7DEF},
+	{0, 0x3660, 0x434B},
+	{0, 0x3662, 0x69F1},
+	{0, 0x3664, 0x8A0F},
+	{0, 0x3666, 0xBDB2},
+	{0, 0x369E, 0x290D},
+	{0, 0x36A0, 0x42CF},
+	{0, 0x36A2, 0xDC6D},
+	{0, 0x36A4, 0x91B1},
+	{0, 0x36A6, 0x9DE9},
+	{0, 0x36DE, 0x70B2},
+	{0, 0x36E0, 0x02AC},
+	{0, 0x36E2, 0x9714},
+	{0, 0x36E4, 0xF3CF},
+	{0, 0x36E6, 0x6BD1},
+	{0, 0x371E, 0xE42E},
+	{0, 0x3720, 0x1D32},
+	{0, 0x3722, 0xCC31},
+	{0, 0x3724, 0xAE94},
+	{0, 0x3726, 0x6413},
+	{0, 0x375E, 0xE290},
+	{0, 0x3760, 0x8F53},
+	{0, 0x3762, 0xF936},
+	{0, 0x3764, 0x4614},
+	{0, 0x3766, 0x1B59},
+	{0, 0x3784, 0x0404},
+	{0, 0x3782, 0x0304},
+	{0, 0x3210, 0x01B8},
+	{0, 0x098E, 0xC913},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0x686B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x686D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x6C6B},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x6C6D},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x3439},
+	{0, 0x0990, 0x05DC},
+	{0, 0x098E, 0x343B},
+	{0, 0x0990, 0x0BB8},
+	{0, 0x098E, 0x4926},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4928},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x492A},
+	{0, 0x0990, 0x0656},
+	{0, 0x098E, 0x4D26},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0x4D28},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x4D2A},
+	{0, 0x0990, 0x0656},
+	{0, 0x33F4, 0x040B},
+	{0, 0x098E, 0xC916},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC919},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xC917},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC918},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC91A},
+	{0, 0x0990, 0x0001},
+	{0, 0x098E, 0xC91B},
+	{0, 0x0990, 0x0009},
+	{0, 0x326C, 0x0C00},
+	{0, 0x098E, 0x494B},
+	{0, 0x0990, 0x0042},
+	{0, 0x098E, 0x494D},
+	{0, 0x0990, 0x012C},
+	{0, 0x098E, 0xC91E},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC91F},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC920},
+	{0, 0x0990, 0x0012},
+	{0, 0x098E, 0xC921},
+	{0, 0x0990, 0x000A},
+	{0, 0x098E, 0xC922},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC923},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xC924},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xC925},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0xBC02},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xBC05},
+	{0, 0x0990, 0x000E},
+	{0, 0x098E, 0xC950},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC94F},
+	{0, 0x0990, 0x0038},
+	{0, 0x098E, 0xC952},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xC951},
+	{0, 0x0990, 0x0051},
+	{0, 0x098E, 0xC954},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC953},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC956},
+	{0, 0x0990, 0x0010},
+	{0, 0x098E, 0xC955},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC958},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC957},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0xC95A},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xC959},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xC95C},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95B},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95E},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0xC95D},
+	{0, 0x0990, 0x0008},
+	{0, 0x098E, 0xC95F},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0x48DC},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48DE},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E0},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E2},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48E4},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48E6},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0x48E8},
+	{0, 0x0990, 0x004D},
+	{0, 0x098E, 0x48EA},
+	{0, 0x0990, 0x0096},
+	{0, 0x098E, 0x48EC},
+	{0, 0x0990, 0x001D},
+	{0, 0x098E, 0xDC2A},
+	{0, 0x0990, 0x000B},
+	{0, 0x098E, 0xDC2B},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0xBC0B},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC0C},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC0D},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC0E},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC0F},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC10},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC11},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC12},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC13},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC14},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC15},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC16},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC17},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC18},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC19},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC1A},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC1B},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC1C},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC1D},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC1E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC1F},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xBC20},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0xBC21},
+	{0, 0x0990, 0x003E},
+	{0, 0x098E, 0xBC22},
+	{0, 0x0990, 0x005A},
+	{0, 0x098E, 0xBC23},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC24},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC25},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC26},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC27},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC28},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC29},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC2A},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC2B},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC2C},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC2D},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC2E},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC2F},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC30},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xBC31},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xBC32},
+	{0, 0x0990, 0x000D},
+	{0, 0x098E, 0xBC33},
+	{0, 0x0990, 0x0019},
+	{0, 0x098E, 0xBC34},
+	{0, 0x0990, 0x0030},
+	{0, 0x098E, 0xBC35},
+	{0, 0x0990, 0x0056},
+	{0, 0x098E, 0xBC36},
+	{0, 0x0990, 0x0070},
+	{0, 0x098E, 0xBC37},
+	{0, 0x0990, 0x0081},
+	{0, 0x098E, 0xBC38},
+	{0, 0x0990, 0x0090},
+	{0, 0x098E, 0xBC39},
+	{0, 0x0990, 0x009E},
+	{0, 0x098E, 0xBC3A},
+	{0, 0x0990, 0x00AB},
+	{0, 0x098E, 0xBC3B},
+	{0, 0x0990, 0x00B6},
+	{0, 0x098E, 0xBC3C},
+	{0, 0x0990, 0x00C1},
+	{0, 0x098E, 0xBC3D},
+	{0, 0x0990, 0x00CB},
+	{0, 0x098E, 0xBC3E},
+	{0, 0x0990, 0x00D5},
+	{0, 0x098E, 0xBC3F},
+	{0, 0x0990, 0x00DE},
+	{0, 0x098E, 0xBC40},
+	{0, 0x0990, 0x00E7},
+	{0, 0x098E, 0xBC41},
+	{0, 0x0990, 0x00EF},
+	{0, 0x098E, 0xBC42},
+	{0, 0x0990, 0x00F7},
+	{0, 0x098E, 0xBC43},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0x6865},
+	{0, 0x0990, 0x00E0},
+	{0, 0x098E, 0x6867},
+	{0, 0x0990, 0x00F4},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xBC4A},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4B},
+	{0, 0x0990, 0x007F},
+	{0, 0x098E, 0xBC4C},
+	{0, 0x0990, 0x007F},
+	{0, 0x3542, 0x0010},
+	{0, 0x3544, 0x0030},
+	{0, 0x3546, 0x0040},
+	{0, 0x3548, 0x0080},
+	{0, 0x354A, 0x0100},
+	{0, 0x354C, 0x0200},
+	{0, 0x354E, 0x0300},
+	{0, 0x3550, 0x0010},
+	{0, 0x3552, 0x0030},
+	{0, 0x3554, 0x0040},
+	{0, 0x3556, 0x0080},
+	{0, 0x3558, 0x012C},
+	{0, 0x355A, 0x0320},
+	{0, 0x355C, 0x03E8},
+	{0, 0x3560, 0x0040},
+	{0, 0x3562, 0x0020},
+	{0, 0x3564, 0x0040},
+	{0, 0x3566, 0x0010},
+	{0, 0x3568, 0x0008},
+	{0, 0x356A, 0x0004},
+	{0, 0x356C, 0x0004},
+	{0, 0x356E, 0x0004},
+	{0, 0x098E, 0x3C4D},
+	{0, 0x0990, 0x0DAC},
+	{0, 0x098E, 0x3C4F},
+	{0, 0x0990, 0x148A},
+	{0, 0x098E, 0xC911},
+	{0, 0x0990, 0x00C8},
+	{0, 0x098E, 0xC8F4},
+	{0, 0x0990, 0x0004},
+	{0, 0x098E, 0xC8F5},
+	{0, 0x0990, 0x0002},
+	{0, 0x098E, 0x48F6},
+	{0, 0x0990, 0x3B4D},
+	{0, 0x098E, 0x48F8},
+	{0, 0x0990, 0x6380},
+	{0, 0x098E, 0x48FA},
+	{0, 0x0990, 0x9B18},
+	{0, 0x098E, 0x48FC},
+	{0, 0x0990, 0x5D51},
+	{0, 0x098E, 0x48FE},
+	{0, 0x0990, 0xEDE8},
+	{0, 0x098E, 0x4900},
+	{0, 0x0990, 0xE515},
+	{0, 0x098E, 0x4902},
+	{0, 0x0990, 0xBFF4},
+	{0, 0x098E, 0x4904},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0x4906},
+	{0, 0x0990, 0x0026},
+	{0, 0x098E, 0x4908},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0xE84A},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84D},
+	{0, 0x0990, 0x0083},
+	{0, 0x098E, 0xE84C},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0xE84F},
+	{0, 0x0990, 0x0080},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0x48B0},
+	{0, 0x0990, 0x0180},
+	{0, 0x098E, 0x48B2},
+	{0, 0x0990, 0xFF7A},
+	{0, 0x098E, 0x48B4},
+	{0, 0x0990, 0x0018},
+	{0, 0x098E, 0x48B6},
+	{0, 0x0990, 0xFFCA},
+	{0, 0x098E, 0x48B8},
+	{0, 0x0990, 0x017C},
+	{0, 0x098E, 0x48BA},
+	{0, 0x0990, 0xFFCC},
+	{0, 0x098E, 0x48BC},
+	{0, 0x0990, 0x000C},
+	{0, 0x098E, 0x48BE},
+	{0, 0x0990, 0xFF1F},
+	{0, 0x098E, 0x48C0},
+	{0, 0x0990, 0x01E8},
+	{0, 0x098E, 0x48C2},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x48C4},
+	{0, 0x0990, 0x0044},
+	{0, 0x098E, 0x48C6},
+	{0, 0x0990, 0x0079},
+	{0, 0x098E, 0x48C8},
+	{0, 0x0990, 0xFFAD},
+	{0, 0x098E, 0x48CA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x098E, 0x48CC},
+	{0, 0x0990, 0x0033},
+	{0, 0x098E, 0x48CE},
+	{0, 0x0990, 0x002A},
+	{0, 0x098E, 0x48D0},
+	{0, 0x0990, 0xFFAA},
+	{0, 0x098E, 0x48D2},
+	{0, 0x0990, 0x0017},
+	{0, 0x098E, 0x48D4},
+	{0, 0x0990, 0x004B},
+	{0, 0x098E, 0x48D6},
+	{0, 0x0990, 0xFFA5},
+	{0, 0x098E, 0x48D8},
+	{0, 0x0990, 0x0015},
+	{0, 0x098E, 0x48DA},
+	{0, 0x0990, 0xFFE2},
+	{0, 0x35A2, 0x0014},
+	{0, 0x098E, 0xC949},
+	{0, 0x0990, 0x0024},
+	{0, 0x35A4, 0x0596},
+	{0, 0x098E, 0xC94A},
+	{0, 0x0990, 0x0062},
+	{0, 0x098E, 0xC948},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xC914},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xC915},
+	{0, 0x0990, 0x00FF},
+	{0, 0x098E, 0xE86F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xE870},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xEC6F},
+	{0, 0x0990, 0x0060},
+	{0, 0x098E, 0xEC70},
+	{0, 0x0990, 0x003C},
+	{0, 0x098E, 0xE883},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC83},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE885},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xE886},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xEC85},
+	{0, 0x0990, 0x001E},
+	{0, 0x098E, 0xEC86},
+	{0, 0x0990, 0x00D8},
+	{0, 0x098E, 0xE884},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0xEC84},
+	{0, 0x0990, 0x005C},
+	{0, 0x098E, 0x490A},
+	{0, 0x0990, 0x0666},
+	{0, 0x098E, 0x490C},
+	{0, 0x0990, 0x0140},
+	{0, 0x098E, 0x6857},
+	{0, 0x0990, 0x0014},
+	{0, 0x098E, 0x685C},
+	{0, 0x0990, 0x0005},
+	{0, 0x098E, 0x490E},
+	{0, 0x0990, 0x00A4},
+	{0, 0x098E, 0xB43D},
+	{0, 0x0990, 0x0031},
+	{0, 0x098E, 0xB43E},
+	{0, 0x0990, 0x001B},
+	{0, 0x098E, 0xB43F},
+	{0, 0x0990, 0x0028},
+	{0, 0x098E, 0xB440},
+	{0, 0x0990, 0x0003},
+	{0, 0x098E, 0xB441},
+	{0, 0x0990, 0x00CD},
+	{0, 0x098E, 0xB442},
+	{0, 0x0990, 0x0064},
+	{0, 0x098E, 0xB443},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0xB444},
+	{0, 0x0990, 0x0007},
+	{0, 0x098E, 0x300D},
+	{0, 0x0990, 0x000F},
+	{0, 0x098E, 0x3017},
+	{0, 0x0990, 0x0F0F},
+	{0, 0x098E, 0x8400},
+	{0, 0x0990, 0x0006},
+	{0, 0x098E, 0xE81F},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0x68A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x6CA0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x70A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x098E, 0x74A0},
+	{0, 0x0990, 0x082E},
+	{0, 0x3C52, 0x082E},
+	{0, 0x098E, 0x488E},
+	{0, 0x0990, 0x0020},
+	{0, 0x098E, 0xECAC},
+	{0, 0x0990, 0x0000}
+};
+
+mt9t111_regs def_regs2[] = {
+	{100, 0x0018, 0x0028},
+	{0, 0x316C, 0x350F},
+	{0, 0x098E, 0x6817},
+	{0, 0x0990, 0x000C},
+	{0, 0x0034, 0x0000}
+};
+
+mt9t111_regs pll_regs1[] = {
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2425},
+	{0, 0x0014, 0x2145},
+	{0, 0x0010, 0x0219},
+	{0, 0x0012, 0x0090},
+	{0, 0x002A, 0x79DD},
+	{0, 0x0014, 0x2545},
+	{0, 0x0014, 0x2547},
+	{0, 0x0014, 0x3447},
+	{0, 0x0014, 0x3047}
+};
+
+mt9t111_regs pll_regs2[] = {
+	{0, 0x0014, 0x3046},
+	{0, 0x0022, 0x01E0},
+	{0, 0x001E, 0x0707},
+	{0, 0x3B84, 0x011D}
+};
+
+mt9t111_regs bayer_pattern_regs[] = {
+	{0, 0x098E, 0x6807},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6809},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xE88E},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0x6C07},
+	{0, 0x0990, 0x0100},
+	{0, 0x098E, 0x6C09},
+	{0, 0x0990, 0x0000},
+	{0, 0x098E, 0xEC8E},
+	{0, 0x0990, 0x0000}
+};
+
+#endif
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
index 32114a3..aba49e2 100644
--- a/drivers/media/video/mt9t112.c
+++ b/drivers/media/video/mt9t112.c
@@ -24,12 +24,16 @@
 #include <linux/slab.h>
 #include <linux/v4l2-mediabus.h>
 #include <linux/videodev2.h>
+#include <linux/regulator/consumer.h>
 
 #include <media/mt9t112.h>
+#include <media/mt9t111.h>
 #include <media/soc_camera.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-common.h>
 
+#include "mt9t111_reg.h"
+
 /* you can check PLL/clock info */
 /* #define EXT_CLOCK 24000000 */
 
@@ -88,11 +92,15 @@ struct mt9t112_format {
 struct mt9t112_priv {
 	struct v4l2_subdev		 subdev;
 	struct mt9t112_camera_info	*info;
+	struct media_pad		pad;
 	struct i2c_client		*client;
 	struct v4l2_rect		 frame;
 	const struct mt9t112_format	*format;
+	struct v4l2_mbus_framefmt	fmt;
 	int				 model;
 	u32				 flags;
+	struct regulator		*omap3evm_1v8;
+	struct regulator		*omap3evm_2v8;
 /* for flags */
 #define INIT_DONE	(1 << 0)
 #define PCLK_RISING	(1 << 1)
@@ -206,6 +214,33 @@ static int __mt9t112_reg_write(const struct i2c_client *client,
 	return ret;
 }
 
+static int mt9t111_write_regs(struct i2c_client *client,
+				mt9t111_regs *reg_in, int cnt)
+{
+	int err = 0, i;
+	mt9t111_regs *reg = reg_in;
+
+	for (i = 0; i < cnt; i++) {
+		if (reg->delay_time == 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+		} else if (reg->addr != 0 || reg->data != 0) {
+			mt9t112_reg_write(err, client, reg->addr, reg->data);
+			mdelay(reg->delay_time);
+		} else {
+			mdelay(reg->delay_time);
+		}
+		if (err < 0) {
+			dev_warn(&client->dev, "write reg error, addr = 0x%x,"
+					"data = 0x%x\n",
+					reg->addr, reg->data);
+			return err;
+		}
+		reg++;
+	}
+
+	return err;
+}
+
 static int __mt9t112_reg_mask_set(const struct i2c_client *client,
 				  u16  command,
 				  u16  mask,
@@ -733,6 +768,82 @@ static int mt9t112_init_camera(const struct i2c_client *client)
 	return ret;
 }
 
+static int mt9t111_configure(struct v4l2_subdev *subdev)
+{
+	int i, ret = 0;
+	unsigned short value;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x001D);
+	if (ret)
+		goto out;
+
+	msleep(1);
+
+	mt9t112_reg_write(ret, client, 0x001A, 0x0018);
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, pll_regs1,
+			sizeof(pll_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_read(value, client, 0x0014);
+		if ((value & 0x8000) != 0)
+			break;
+		mdelay(2);
+	}
+
+	ret = mt9t111_write_regs(client, pll_regs2,
+			sizeof(pll_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs1,
+			sizeof(def_regs1) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, patch_rev6,
+			sizeof(patch_rev6) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	ret = mt9t111_write_regs(client, def_regs2,
+			sizeof(def_regs2) / sizeof(mt9t111_regs));
+	if (ret)
+		goto out;
+
+	/* MCU_ADDRESS [SEQ_CMD] -- refresh mode */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0006);
+	if (ret)
+		goto out;
+
+	/* refresh command */
+	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+	if (ret)
+		goto out;
+	mt9t112_reg_write(ret, client, 0x0990, 0x0005);
+	if (ret)
+		goto out;
+	for (i = 0; i < 100; i++) {
+		mt9t112_reg_write(ret, client, 0x098E, 0x8400);
+		if (ret)
+			break;
+		mt9t112_reg_read(value , client, 0x0990);
+		if (value == 0)
+			break;
+		mdelay(5);
+	}
+out:
+	return ret;
+}
+
 /************************************************************************
 			v4l2_subdev_core_ops
 ************************************************************************/
@@ -775,15 +886,72 @@ static int mt9t112_s_register(struct v4l2_subdev *sd,
 }
 #endif
 
+static int omap3evm_regulator_ctrl(struct mt9t112_priv *priv, u32 on)
+{
+	if (!(priv->omap3evm_1v8) || !(priv->omap3evm_2v8)) {
+		printk(KERN_ERR "No regulator available\n");
+		return -ENODEV;
+	}
+	if (on) {
+		regulator_enable(priv->omap3evm_1v8);
+		mdelay(1);
+		regulator_enable(priv->omap3evm_2v8);
+		mdelay(50);
+	} else {
+		if (regulator_is_enabled(priv->omap3evm_1v8))
+			regulator_disable(priv->omap3evm_1v8);
+		if (regulator_is_enabled(priv->omap3evm_2v8))
+			regulator_disable(priv->omap3evm_2v8);
+	}
+	return 0;
+}
+
+static int mt9t111_s_power(struct v4l2_subdev *subdev, int on)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+	struct mt9t111_platform_data  *pdata;
+	int rval;
+
+	pdata = (struct mt9t111_platform_data *) icl;
+	if (on) {
+		rval = omap3evm_regulator_ctrl(priv, on);
+		if (rval)
+			goto out;
+
+		rval = pdata->s_power(subdev, 1);
+		if (rval)
+			goto out;
+
+		rval = mt9t111_configure(subdev);
+		if (rval) {
+			pdata->s_power(subdev, 0);
+			goto out;
+	}
+
+	} else {
+		rval = pdata->s_power(subdev, 0);
+		if (rval)
+			goto out;
+	}
+
+out:
+	if (rval)
+		v4l_err(client, "Unable to set target power state\n");
+
+	return rval;
+}
+
 static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
 	.g_chip_ident	= mt9t112_g_chip_ident,
+	.s_power	= mt9t111_s_power,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-	.g_register	= mt9t112_g_register,
-	.s_register	= mt9t112_s_register,
+	.g_register     = mt9t112_g_register,
+	.s_register     = mt9t112_s_register,
 #endif
 };
 
-
 /************************************************************************
 			v4l2_subdev_video_ops
 ************************************************************************/
@@ -793,51 +961,56 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable)
 	struct mt9t112_priv *priv = to_mt9t112(client);
 	int ret = 0;
 
-	if (!enable) {
-		/* FIXME
-		 *
-		 * If user selected large output size,
-		 * and used it long time,
-		 * mt9t112 camera will be very warm.
-		 *
-		 * But current driver can not stop mt9t112 camera.
-		 * So, set small size here to solve this problem.
-		 */
-		mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+	if (priv->model == V4L2_IDENT_MT9T111) {
 		return ret;
-	}
 
-	if (!(priv->flags & INIT_DONE)) {
-		u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
+	} else {
+		if (!enable) {
+			/* FIXME
+			 *
+			 * If user selected large output size,
+			 * and used it long time,
+			 * mt9t112 camera will be very warm.
+			 *
+			 * But current driver can not stop mt9t112 camera.
+			 * So, set small size here to solve this problem.
+			 */
+			mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
+			return ret;
+		}
 
-		ECHECKER(ret, mt9t112_init_camera(client));
+		if (!(priv->flags & INIT_DONE)) {
+			u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
 
-		/* Invert PCLK (Data sampled on falling edge of pixclk) */
-		mt9t112_reg_write(ret, client, 0x3C20, param);
+			ECHECKER(ret, mt9t112_init_camera(client));
 
-		mdelay(5);
+			/* Invert PCLK (Data sampled on falling edge of pixclk) */
+			mt9t112_reg_write(ret, client, 0x3C20, param);
 
-		priv->flags |= INIT_DONE;
-	}
+			mdelay(5);
 
-	mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
-	mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
-	mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
+			priv->flags |= INIT_DONE;
+		}
 
-	mt9t112_set_a_frame_size(client,
-				 priv->frame.width,
-				 priv->frame.height);
+		mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
+		mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
+		mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
 
-	ECHECKER(ret, mt9t112_auto_focus_trigger(client));
+		mt9t112_set_a_frame_size(client,
+					priv->frame.width,
+					priv->frame.height);
 
-	dev_dbg(&client->dev, "format : %d\n", priv->format->code);
-	dev_dbg(&client->dev, "size   : %d x %d\n",
-		priv->frame.width,
-		priv->frame.height);
+		ECHECKER(ret, mt9t112_auto_focus_trigger(client));
 
-	CLOCK_INFO(client, EXT_CLOCK);
+		dev_dbg(&client->dev, "format : %d\n", priv->format->code);
+		dev_dbg(&client->dev, "size   : %d x %d\n",
+			priv->frame.width,
+			priv->frame.height);
 
-	return ret;
+		CLOCK_INFO(client, EXT_CLOCK);
+
+		return ret;
+	}
 }
 
 static int mt9t112_set_params(struct mt9t112_priv *priv,
@@ -1019,11 +1192,60 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = {
 };
 
 /************************************************************************
+		v4l2_subdev_pad_ops
+************************************************************************/
+static int mt9t111_get_pad_format(struct v4l2_subdev *subdev,
+		struct v4l2_subdev_fh *fh,
+		struct v4l2_subdev_format *fmt)
+{
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	fmt->format = priv->fmt;
+	return 0;
+}
+
+static int mt9t111_set_pad_format(struct v4l2_subdev *subdev,
+				struct v4l2_subdev_fh *fh,
+				struct v4l2_subdev_format *fmt)
+{
+	int i;
+	struct i2c_client *client = v4l2_get_subdevdata(subdev);
+	struct mt9t112_priv *priv = to_mt9t112(client);
+
+	for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) {
+		if (fmt->format.code == mt9t112_cfmts[i].code)
+			goto fmt_found;
+	}
+	if (i >= ARRAY_SIZE(mt9t112_cfmts))
+		return -EINVAL;
+
+fmt_found:
+	/*
+	 * Only VGA resolution supported
+	 */
+	fmt->format.width = VGA_WIDTH;
+	fmt->format.height = VGA_HEIGHT;
+	fmt->format.field = V4L2_FIELD_NONE;
+	fmt->format.colorspace = V4L2_COLORSPACE_JPEG;
+
+	priv->fmt = fmt->format;
+
+	return 0;
+}
+
+static const struct v4l2_subdev_pad_ops mt9t111_pad_ops = {
+	.get_fmt        = mt9t111_get_pad_format,
+	.set_fmt        = mt9t111_set_pad_format,
+};
+
+/************************************************************************
 			i2c driver
 ************************************************************************/
 static struct v4l2_subdev_ops mt9t112_subdev_ops = {
 	.core	= &mt9t112_subdev_core_ops,
 	.video	= &mt9t112_subdev_video_ops,
+	.pad    = &mt9t111_pad_ops,
 };
 
 static int mt9t112_camera_probe(struct i2c_client *client)
@@ -1089,6 +1311,32 @@ static int mt9t112_probe(struct i2c_client *client,
 	/* Cannot fail: using the default supported pixel code */
 	mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
 
+	if (priv->model == V4L2_IDENT_MT9T111) {
+		priv->omap3evm_1v8 = regulator_get(NULL, "vio_1v8");
+		if (IS_ERR(priv->omap3evm_1v8)) {
+			printk(KERN_ERR "vio_1v8 regulator missing\n");
+			ret =  PTR_ERR(priv->omap3evm_1v8);
+			goto err_1;
+		}
+		priv->omap3evm_2v8 = regulator_get(NULL, "cam_2v8");
+		if (IS_ERR(priv->omap3evm_2v8)) {
+			printk(KERN_ERR "cam_2v8 regulator missing\n");
+			ret = PTR_ERR(priv->omap3evm_2v8);
+			goto err_2;
+		}
+
+		priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
+		ret = media_entity_init(&priv->subdev.entity, 1, &priv->pad, 0);
+		if (!ret)
+			return 0;
+		kfree(priv);
+err_2:
+		regulator_put(priv->omap3evm_2v8);
+err_1:
+		regulator_put(priv->omap3evm_1v8);
+	}
+
 	return ret;
 }
 
diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
new file mode 100644
index 0000000..372dc0d
--- /dev/null
+++ b/include/media/mt9t111.h
@@ -0,0 +1,45 @@
+/*
+ * include/media/mt9t111.h
+ *
+ * mt9t111 sensor driver
+ *
+ * Copyright (C) 2009 Leopard Imaging
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef	MT9T111_H
+#define	MT9T111_H
+
+struct v4l2_subdev;
+
+/*
+ * Defines and Macros and globals
+ */
+#define MT9T111_MODULE_NAME		"mt9t112"
+
+/*i2c adress for MT9T111*/
+#define MT9T111_I2C_ADDR		(0x78 >> 1)
+
+#define MT9T111_CLK_MAX			(96000000) /* 96MHz */
+#define MT9T111_CLK_MIN			(6000000)  /* 6Mhz */
+
+#define MT9T111_I2C_CONFIG		(1)
+#define I2C_ONE_BYTE_TRANSFER		(1)
+#define I2C_TWO_BYTE_TRANSFER		(2)
+#define I2C_THREE_BYTE_TRANSFER		(3)
+#define I2C_FOUR_BYTE_TRANSFER		(4)
+#define I2C_TXRX_DATA_MASK		(0x00FF)
+#define I2C_TXRX_DATA_MASK_UPPER	(0xFF00)
+#define I2C_TXRX_DATA_SHIFT		(8)
+
+struct mt9t111_platform_data {
+	int (*s_power) (struct v4l2_subdev *subdev, u32 on);
+	int (*set_xclk) (struct v4l2_subdev *subdev, u32 hz);
+	int (*configure_interface) (struct v4l2_subdev *subdev, u32 pixclk);
+};
+
+#endif	/* ifndef MT9T111 */
+
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file
  2011-09-27 13:40 ` Deepthy Ravi
  (?)
@ 2011-09-27 13:40   ` Deepthy Ravi
  -1 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

From: Vaibhav Hiremath <hvaibhav@ti.com>

Adds board support for MT9T111 sensor.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3evm.c        |    4 +
 3 files changed, 194 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f343365..a19753c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -280,3 +280,8 @@ disp-$(CONFIG_OMAP2_DSS)		:= display.o
 obj-y					+= $(disp-m) $(disp-y)
 
 obj-y					+= common-board-devices.o twl-common.o
+
+ifeq ($(CONFIG_MACH_OMAP3EVM),y)
+evm-camera-$(CONFIG_VIDEO_OMAP3)       := board-omap3evm-camera.o
+obj-y                                  += $(evm-camera-m) $(evm-camera-y)
+endif
diff --git a/arch/arm/mach-omap2/board-omap3evm-camera.c b/arch/arm/mach-omap2/board-omap3evm-camera.c
new file mode 100644
index 0000000..e762f61
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm-camera.c
@@ -0,0 +1,185 @@
+/*
+ * arch/arm/mach-omap2/board-omap3evm-camera.c
+ *
+ * OMAP3EVM: Driver for Leopard Module Board
+ *
+ * Copyright (C) 2011 Texas Instruments Inc
+ * Author: Vaibhav Hiremath <hvaibhav@ti.com>
+ *
+ * This package 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/io.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <mach/gpio.h>
+#include <media/mt9t111.h>
+#include <media/omap3isp.h>
+#include <../drivers/media/video/omap3isp/isp.h>
+#include "devices.h"
+
+#define CAM_USE_XCLKA			0
+
+#define T2_GPIO_2			194
+#define nCAM_VD_SEL			157
+#define nCAM_VD_EN			200
+
+/* mux id to enable/disable signal routing to different peripherals */
+enum omap3evm_cam_mux {
+	MUX_EN_TVP5146 = 0,
+	MUX_EN_CAMERA_SENSOR,
+	MUX_EN_EXP_CAMERA_SENSOR,
+	MUX_INVALID,
+};
+
+/**
+ * @brief omap3evm_set_mux - Sets mux to enable/disable signal routing to
+ *                             different peripherals present on new EVM board
+ *
+ * @param mux_id - enum, mux id to enable/disable
+ * @param value - enum, ENABLE_MUX for enabling and DISABLE_MUX for disabling
+ *
+ */
+static void omap3evm_set_mux(enum omap3evm_cam_mux mux_id)
+{
+	switch (mux_id) {
+	/*
+	* JP1 jumper need to configure to choose between on-board
+	* camera sensor conn and on-board LI-3MC02 camera sensor.
+	*/
+	case MUX_EN_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 0 */
+		gpio_set_value(nCAM_VD_SEL, 0);
+		break;
+	case MUX_EN_EXP_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 1 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 1);
+		break;
+	case MUX_EN_TVP5146:
+	default:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 1 */
+		gpio_set_value(nCAM_VD_SEL, 1);
+		break;
+	}
+}
+
+/* MT9T111: 3M sensor */
+static int omap3evm_mt9t111_s_power(struct v4l2_subdev *subdev, u32 on)
+{
+	struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
+
+	omap3evm_set_mux(MUX_EN_CAMERA_SENSOR);
+
+	if (on) {
+		/* Enable EXTCLK */
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 24000000, CAM_USE_XCLKA);
+		udelay(5);
+	} else {
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 0, CAM_USE_XCLKA);
+	}
+
+	return 0;
+}
+
+static struct mt9t111_platform_data omap3evm_mt9t111_platform_data = {
+	.s_power		= omap3evm_mt9t111_s_power,
+};
+
+
+#define MT9T111_I2C_BUS_NUM		2
+
+static struct i2c_board_info omap3evm_camera_i2c_devices[] = {
+	{
+		I2C_BOARD_INFO(MT9T111_MODULE_NAME, MT9T111_I2C_ADDR),
+		.platform_data = &omap3evm_mt9t111_platform_data,
+	}
+};
+
+static struct isp_subdev_i2c_board_info omap3evm_mt9t111_subdevs[] = {
+	{
+		.board_info = &omap3evm_camera_i2c_devices[0],
+		.i2c_adapter_id = MT9T111_I2C_BUS_NUM,
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_v4l2_subdevs_group omap3evm_camera_subdevs[] = {
+	{
+		.subdevs = omap3evm_mt9t111_subdevs,
+		.interface = ISP_INTERFACE_PARALLEL,
+		.bus = {
+			.parallel = {
+				.data_lane_shift	= 1,
+				.clk_pol		= 0,
+				.hs_pol			= 0,
+				.vs_pol			= 0,
+				.bridge			= 3,
+				.bt656			= 0,
+			},
+		},
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_platform_data omap3evm_isp_platform_data = {
+	.subdevs = omap3evm_camera_subdevs,
+};
+
+static struct gpio omap3evm_gpios[] __initdata = {
+	/* First level GPIO enable: T2_GPIO.2 */
+	{ T2_GPIO_2, GPIOF_OUT_INIT_LOW, "T2_GPIO.2" },
+	/* nCAM_VD_SEL (GPIO157) */
+	{ nCAM_VD_SEL, GPIOF_OUT_INIT_HIGH, "cam_vd_sel" },
+	/*EXP_nCAM_VD_EN (T2_GPIO.8) */
+	{ nCAM_VD_EN, GPIOF_OUT_INIT_LOW, "cam_vd_en" },
+};
+
+static int __init omap3evm_cam_init(void)
+{
+	int ret;
+
+	ret = gpio_request_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+	if (ret < 0) {
+		printk(KERN_ERR "Unable to get GPIO pins\n");
+		return ret;
+	}
+
+	omap3_init_camera(&omap3evm_isp_platform_data);
+
+	printk(KERN_INFO "omap3evm camera init done successfully...\n");
+	return 0;
+}
+
+static void __exit omap3evm_cam_exit(void)
+{
+	gpio_free_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+}
+
+module_init(omap3evm_cam_init);
+module_exit(omap3evm_cam_exit);
+
+MODULE_AUTHOR("Texas Instruments");
+MODULE_DESCRIPTION("OMAP3EVM: Driver for Leopard Module Board");
+MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index f63a8fa..485bc1c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
 				OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_NONE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 #ifdef CONFIG_WL12XX_PLATFORM_DATA
 	/* WLAN IRQ - GPIO 149 */
 	OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
@@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
 	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
 				OMAP_PIN_OFF_WAKEUPENABLE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 	/* AM/DM37x EVM: DSS data bus muxed with sys_boot */
 	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: linux-omap, Deepthy Ravi

From: Vaibhav Hiremath <hvaibhav@ti.com>

Adds board support for MT9T111 sensor.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3evm.c        |    4 +
 3 files changed, 194 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f343365..a19753c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -280,3 +280,8 @@ disp-$(CONFIG_OMAP2_DSS)		:= display.o
 obj-y					+= $(disp-m) $(disp-y)
 
 obj-y					+= common-board-devices.o twl-common.o
+
+ifeq ($(CONFIG_MACH_OMAP3EVM),y)
+evm-camera-$(CONFIG_VIDEO_OMAP3)       := board-omap3evm-camera.o
+obj-y                                  += $(evm-camera-m) $(evm-camera-y)
+endif
diff --git a/arch/arm/mach-omap2/board-omap3evm-camera.c b/arch/arm/mach-omap2/board-omap3evm-camera.c
new file mode 100644
index 0000000..e762f61
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm-camera.c
@@ -0,0 +1,185 @@
+/*
+ * arch/arm/mach-omap2/board-omap3evm-camera.c
+ *
+ * OMAP3EVM: Driver for Leopard Module Board
+ *
+ * Copyright (C) 2011 Texas Instruments Inc
+ * Author: Vaibhav Hiremath <hvaibhav@ti.com>
+ *
+ * This package 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/io.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <mach/gpio.h>
+#include <media/mt9t111.h>
+#include <media/omap3isp.h>
+#include <../drivers/media/video/omap3isp/isp.h>
+#include "devices.h"
+
+#define CAM_USE_XCLKA			0
+
+#define T2_GPIO_2			194
+#define nCAM_VD_SEL			157
+#define nCAM_VD_EN			200
+
+/* mux id to enable/disable signal routing to different peripherals */
+enum omap3evm_cam_mux {
+	MUX_EN_TVP5146 = 0,
+	MUX_EN_CAMERA_SENSOR,
+	MUX_EN_EXP_CAMERA_SENSOR,
+	MUX_INVALID,
+};
+
+/**
+ * @brief omap3evm_set_mux - Sets mux to enable/disable signal routing to
+ *                             different peripherals present on new EVM board
+ *
+ * @param mux_id - enum, mux id to enable/disable
+ * @param value - enum, ENABLE_MUX for enabling and DISABLE_MUX for disabling
+ *
+ */
+static void omap3evm_set_mux(enum omap3evm_cam_mux mux_id)
+{
+	switch (mux_id) {
+	/*
+	* JP1 jumper need to configure to choose between on-board
+	* camera sensor conn and on-board LI-3MC02 camera sensor.
+	*/
+	case MUX_EN_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 0 */
+		gpio_set_value(nCAM_VD_SEL, 0);
+		break;
+	case MUX_EN_EXP_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 1 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 1);
+		break;
+	case MUX_EN_TVP5146:
+	default:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 1 */
+		gpio_set_value(nCAM_VD_SEL, 1);
+		break;
+	}
+}
+
+/* MT9T111: 3M sensor */
+static int omap3evm_mt9t111_s_power(struct v4l2_subdev *subdev, u32 on)
+{
+	struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
+
+	omap3evm_set_mux(MUX_EN_CAMERA_SENSOR);
+
+	if (on) {
+		/* Enable EXTCLK */
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 24000000, CAM_USE_XCLKA);
+		udelay(5);
+	} else {
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 0, CAM_USE_XCLKA);
+	}
+
+	return 0;
+}
+
+static struct mt9t111_platform_data omap3evm_mt9t111_platform_data = {
+	.s_power		= omap3evm_mt9t111_s_power,
+};
+
+
+#define MT9T111_I2C_BUS_NUM		2
+
+static struct i2c_board_info omap3evm_camera_i2c_devices[] = {
+	{
+		I2C_BOARD_INFO(MT9T111_MODULE_NAME, MT9T111_I2C_ADDR),
+		.platform_data = &omap3evm_mt9t111_platform_data,
+	}
+};
+
+static struct isp_subdev_i2c_board_info omap3evm_mt9t111_subdevs[] = {
+	{
+		.board_info = &omap3evm_camera_i2c_devices[0],
+		.i2c_adapter_id = MT9T111_I2C_BUS_NUM,
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_v4l2_subdevs_group omap3evm_camera_subdevs[] = {
+	{
+		.subdevs = omap3evm_mt9t111_subdevs,
+		.interface = ISP_INTERFACE_PARALLEL,
+		.bus = {
+			.parallel = {
+				.data_lane_shift	= 1,
+				.clk_pol		= 0,
+				.hs_pol			= 0,
+				.vs_pol			= 0,
+				.bridge			= 3,
+				.bt656			= 0,
+			},
+		},
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_platform_data omap3evm_isp_platform_data = {
+	.subdevs = omap3evm_camera_subdevs,
+};
+
+static struct gpio omap3evm_gpios[] __initdata = {
+	/* First level GPIO enable: T2_GPIO.2 */
+	{ T2_GPIO_2, GPIOF_OUT_INIT_LOW, "T2_GPIO.2" },
+	/* nCAM_VD_SEL (GPIO157) */
+	{ nCAM_VD_SEL, GPIOF_OUT_INIT_HIGH, "cam_vd_sel" },
+	/*EXP_nCAM_VD_EN (T2_GPIO.8) */
+	{ nCAM_VD_EN, GPIOF_OUT_INIT_LOW, "cam_vd_en" },
+};
+
+static int __init omap3evm_cam_init(void)
+{
+	int ret;
+
+	ret = gpio_request_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+	if (ret < 0) {
+		printk(KERN_ERR "Unable to get GPIO pins\n");
+		return ret;
+	}
+
+	omap3_init_camera(&omap3evm_isp_platform_data);
+
+	printk(KERN_INFO "omap3evm camera init done successfully...\n");
+	return 0;
+}
+
+static void __exit omap3evm_cam_exit(void)
+{
+	gpio_free_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+}
+
+module_init(omap3evm_cam_init);
+module_exit(omap3evm_cam_exit);
+
+MODULE_AUTHOR("Texas Instruments");
+MODULE_DESCRIPTION("OMAP3EVM: Driver for Leopard Module Board");
+MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index f63a8fa..485bc1c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
 				OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_NONE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 #ifdef CONFIG_WL12XX_PLATFORM_DATA
 	/* WLAN IRQ - GPIO 149 */
 	OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
@@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
 	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
 				OMAP_PIN_OFF_WAKEUPENABLE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 	/* AM/DM37x EVM: DSS data bus muxed with sys_boot */
 	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vaibhav Hiremath <hvaibhav@ti.com>

Adds board support for MT9T111 sensor.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/mach-omap2/Makefile                |    5 +
 arch/arm/mach-omap2/board-omap3evm-camera.c |  185 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3evm.c        |    4 +
 3 files changed, 194 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f343365..a19753c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -280,3 +280,8 @@ disp-$(CONFIG_OMAP2_DSS)		:= display.o
 obj-y					+= $(disp-m) $(disp-y)
 
 obj-y					+= common-board-devices.o twl-common.o
+
+ifeq ($(CONFIG_MACH_OMAP3EVM),y)
+evm-camera-$(CONFIG_VIDEO_OMAP3)       := board-omap3evm-camera.o
+obj-y                                  += $(evm-camera-m) $(evm-camera-y)
+endif
diff --git a/arch/arm/mach-omap2/board-omap3evm-camera.c b/arch/arm/mach-omap2/board-omap3evm-camera.c
new file mode 100644
index 0000000..e762f61
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3evm-camera.c
@@ -0,0 +1,185 @@
+/*
+ * arch/arm/mach-omap2/board-omap3evm-camera.c
+ *
+ * OMAP3EVM: Driver for Leopard Module Board
+ *
+ * Copyright (C) 2011 Texas Instruments Inc
+ * Author: Vaibhav Hiremath <hvaibhav@ti.com>
+ *
+ * This package 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/io.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <mach/gpio.h>
+#include <media/mt9t111.h>
+#include <media/omap3isp.h>
+#include <../drivers/media/video/omap3isp/isp.h>
+#include "devices.h"
+
+#define CAM_USE_XCLKA			0
+
+#define T2_GPIO_2			194
+#define nCAM_VD_SEL			157
+#define nCAM_VD_EN			200
+
+/* mux id to enable/disable signal routing to different peripherals */
+enum omap3evm_cam_mux {
+	MUX_EN_TVP5146 = 0,
+	MUX_EN_CAMERA_SENSOR,
+	MUX_EN_EXP_CAMERA_SENSOR,
+	MUX_INVALID,
+};
+
+/**
+ * @brief omap3evm_set_mux - Sets mux to enable/disable signal routing to
+ *                             different peripherals present on new EVM board
+ *
+ * @param mux_id - enum, mux id to enable/disable
+ * @param value - enum, ENABLE_MUX for enabling and DISABLE_MUX for disabling
+ *
+ */
+static void omap3evm_set_mux(enum omap3evm_cam_mux mux_id)
+{
+	switch (mux_id) {
+	/*
+	* JP1 jumper need to configure to choose between on-board
+	* camera sensor conn and on-board LI-3MC02 camera sensor.
+	*/
+	case MUX_EN_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 0 */
+		gpio_set_value(nCAM_VD_SEL, 0);
+		break;
+	case MUX_EN_EXP_CAMERA_SENSOR:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 1 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 1);
+		break;
+	case MUX_EN_TVP5146:
+	default:
+		/* Set nCAM_VD_EN (T2_GPIO8) = 0 */
+		gpio_set_value_cansleep(nCAM_VD_EN, 0);
+		/* Set nCAM_VD_SEL (GPIO157) = 1 */
+		gpio_set_value(nCAM_VD_SEL, 1);
+		break;
+	}
+}
+
+/* MT9T111: 3M sensor */
+static int omap3evm_mt9t111_s_power(struct v4l2_subdev *subdev, u32 on)
+{
+	struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
+
+	omap3evm_set_mux(MUX_EN_CAMERA_SENSOR);
+
+	if (on) {
+		/* Enable EXTCLK */
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 24000000, CAM_USE_XCLKA);
+		udelay(5);
+	} else {
+		if (isp->platform_cb.set_xclk)
+			isp->platform_cb.set_xclk(isp, 0, CAM_USE_XCLKA);
+	}
+
+	return 0;
+}
+
+static struct mt9t111_platform_data omap3evm_mt9t111_platform_data = {
+	.s_power		= omap3evm_mt9t111_s_power,
+};
+
+
+#define MT9T111_I2C_BUS_NUM		2
+
+static struct i2c_board_info omap3evm_camera_i2c_devices[] = {
+	{
+		I2C_BOARD_INFO(MT9T111_MODULE_NAME, MT9T111_I2C_ADDR),
+		.platform_data = &omap3evm_mt9t111_platform_data,
+	}
+};
+
+static struct isp_subdev_i2c_board_info omap3evm_mt9t111_subdevs[] = {
+	{
+		.board_info = &omap3evm_camera_i2c_devices[0],
+		.i2c_adapter_id = MT9T111_I2C_BUS_NUM,
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_v4l2_subdevs_group omap3evm_camera_subdevs[] = {
+	{
+		.subdevs = omap3evm_mt9t111_subdevs,
+		.interface = ISP_INTERFACE_PARALLEL,
+		.bus = {
+			.parallel = {
+				.data_lane_shift	= 1,
+				.clk_pol		= 0,
+				.hs_pol			= 0,
+				.vs_pol			= 0,
+				.bridge			= 3,
+				.bt656			= 0,
+			},
+		},
+	},
+	{ NULL, 0 },
+};
+
+static struct isp_platform_data omap3evm_isp_platform_data = {
+	.subdevs = omap3evm_camera_subdevs,
+};
+
+static struct gpio omap3evm_gpios[] __initdata = {
+	/* First level GPIO enable: T2_GPIO.2 */
+	{ T2_GPIO_2, GPIOF_OUT_INIT_LOW, "T2_GPIO.2" },
+	/* nCAM_VD_SEL (GPIO157) */
+	{ nCAM_VD_SEL, GPIOF_OUT_INIT_HIGH, "cam_vd_sel" },
+	/*EXP_nCAM_VD_EN (T2_GPIO.8) */
+	{ nCAM_VD_EN, GPIOF_OUT_INIT_LOW, "cam_vd_en" },
+};
+
+static int __init omap3evm_cam_init(void)
+{
+	int ret;
+
+	ret = gpio_request_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+	if (ret < 0) {
+		printk(KERN_ERR "Unable to get GPIO pins\n");
+		return ret;
+	}
+
+	omap3_init_camera(&omap3evm_isp_platform_data);
+
+	printk(KERN_INFO "omap3evm camera init done successfully...\n");
+	return 0;
+}
+
+static void __exit omap3evm_cam_exit(void)
+{
+	gpio_free_array(omap3evm_gpios,
+			ARRAY_SIZE(omap3evm_gpios));
+}
+
+module_init(omap3evm_cam_init);
+module_exit(omap3evm_cam_exit);
+
+MODULE_AUTHOR("Texas Instruments");
+MODULE_DESCRIPTION("OMAP3EVM: Driver for Leopard Module Board");
+MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index f63a8fa..485bc1c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
 				OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_NONE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 #ifdef CONFIG_WL12XX_PLATFORM_DATA
 	/* WLAN IRQ - GPIO 149 */
 	OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
@@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
 	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
 				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
 				OMAP_PIN_OFF_WAKEUPENABLE),
+	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+				OMAP_PIN_OFF_NONE),
 	/* AM/DM37x EVM: DSS data bus muxed with sys_boot */
 	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
 	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 4/5] ispccdc: Configure CCDC_SYN_MODE register
  2011-09-27 13:40 ` Deepthy Ravi
  (?)
@ 2011-09-27 13:40   ` Deepthy Ravi
  -1 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

Configure INPMOD and PACK8 fileds for UYVY8_2X8
and YUYV8_2X8 formats.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/omap3isp/ispccdc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 3bc9b7d..7791acb 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -985,8 +985,12 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
 
 	syn_mode &= ~ISPCCDC_SYN_MODE_INPMOD_MASK;
 	if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 ||
-	    format->code == V4L2_MBUS_FMT_UYVY8_2X8)
-		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+	    format->code == V4L2_MBUS_FMT_UYVY8_2X8){
+		if (pdata && pdata->bt656)
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+		else
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
+	}
 	else if (format->code == V4L2_MBUS_FMT_YUYV8_1X16 ||
 		 format->code == V4L2_MBUS_FMT_UYVY8_1X16)
 		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
@@ -1172,7 +1176,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
 		syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
 
 	/* Use PACK8 mode for 1byte per pixel formats. */
-	if (omap3isp_video_format_info(format->code)->width <= 8)
+	if ((omap3isp_video_format_info(format->code)->width <= 8) &&
+			(omap3isp_video_format_info(format->code)->bpp <= 8))
 		syn_mode |= ISPCCDC_SYN_MODE_PACK8;
 	else
 		syn_mode &= ~ISPCCDC_SYN_MODE_PACK8;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 4/5] ispccdc: Configure CCDC_SYN_MODE register
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: linux-omap, Deepthy Ravi

Configure INPMOD and PACK8 fileds for UYVY8_2X8
and YUYV8_2X8 formats.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/omap3isp/ispccdc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 3bc9b7d..7791acb 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -985,8 +985,12 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
 
 	syn_mode &= ~ISPCCDC_SYN_MODE_INPMOD_MASK;
 	if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 ||
-	    format->code == V4L2_MBUS_FMT_UYVY8_2X8)
-		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+	    format->code == V4L2_MBUS_FMT_UYVY8_2X8){
+		if (pdata && pdata->bt656)
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+		else
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
+	}
 	else if (format->code == V4L2_MBUS_FMT_YUYV8_1X16 ||
 		 format->code == V4L2_MBUS_FMT_UYVY8_1X16)
 		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
@@ -1172,7 +1176,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
 		syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
 
 	/* Use PACK8 mode for 1byte per pixel formats. */
-	if (omap3isp_video_format_info(format->code)->width <= 8)
+	if ((omap3isp_video_format_info(format->code)->width <= 8) &&
+			(omap3isp_video_format_info(format->code)->bpp <= 8))
 		syn_mode |= ISPCCDC_SYN_MODE_PACK8;
 	else
 		syn_mode &= ~ISPCCDC_SYN_MODE_PACK8;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 4/5] ispccdc: Configure CCDC_SYN_MODE register
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

Configure INPMOD and PACK8 fileds for UYVY8_2X8
and YUYV8_2X8 formats.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 drivers/media/video/omap3isp/ispccdc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 3bc9b7d..7791acb 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -985,8 +985,12 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
 
 	syn_mode &= ~ISPCCDC_SYN_MODE_INPMOD_MASK;
 	if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 ||
-	    format->code == V4L2_MBUS_FMT_UYVY8_2X8)
-		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+	    format->code == V4L2_MBUS_FMT_UYVY8_2X8){
+		if (pdata && pdata->bt656)
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR8;
+		else
+			syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
+	}
 	else if (format->code == V4L2_MBUS_FMT_YUYV8_1X16 ||
 		 format->code == V4L2_MBUS_FMT_UYVY8_1X16)
 		syn_mode |= ISPCCDC_SYN_MODE_INPMOD_YCBCR16;
@@ -1172,7 +1176,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
 		syn_mode &= ~ISPCCDC_SYN_MODE_SDR2RSZ;
 
 	/* Use PACK8 mode for 1byte per pixel formats. */
-	if (omap3isp_video_format_info(format->code)->width <= 8)
+	if ((omap3isp_video_format_info(format->code)->width <= 8) &&
+			(omap3isp_video_format_info(format->code)->bpp <= 8))
 		syn_mode |= ISPCCDC_SYN_MODE_PACK8;
 	else
 		syn_mode &= ~ISPCCDC_SYN_MODE_PACK8;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 5/5] omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers
  2011-09-27 13:40 ` Deepthy Ravi
  (?)
@ 2011-09-27 13:40   ` Deepthy Ravi
  -1 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel
  Cc: linux-omap, Deepthy Ravi

Enables multimedia driver, media controller api,
v4l2-subdev-api, omap3isp and mt9t111 sensor
drivers in omap2plus_defconfig. Also enables
soc-camera and mt9t112 support since mt9t111
sensor is using mt9t112 driver which is based
on soc-camera subsystem.
Loading soc_camera.ko fails. Hence built into
the kernel.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d5f00d7..48032b6 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -133,6 +133,15 @@ CONFIG_TWL4030_WATCHDOG=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_VIDEO_MEDIA=y
+CONFIG_VIDEO_MT9T111=m
+CONFIG_VIDEO_OMAP3=m
+CONFIG_SOC_CAMERA=y
+CONFIG_SOC_CAMERA_MT9T112=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 5/5] omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel
  Cc: linux-omap, Deepthy Ravi

Enables multimedia driver, media controller api,
v4l2-subdev-api, omap3isp and mt9t111 sensor
drivers in omap2plus_defconfig. Also enables
soc-camera and mt9t112 support since mt9t111
sensor is using mt9t112 driver which is based
on soc-camera subsystem.
Loading soc_camera.ko fails. Hence built into
the kernel.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d5f00d7..48032b6 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -133,6 +133,15 @@ CONFIG_TWL4030_WATCHDOG=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_VIDEO_MEDIA=y
+CONFIG_VIDEO_MT9T111=m
+CONFIG_VIDEO_OMAP3=m
+CONFIG_SOC_CAMERA=y
+CONFIG_SOC_CAMERA_MT9T112=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v2 5/5] omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers
@ 2011-09-27 13:40   ` Deepthy Ravi
  0 siblings, 0 replies; 25+ messages in thread
From: Deepthy Ravi @ 2011-09-27 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

Enables multimedia driver, media controller api,
v4l2-subdev-api, omap3isp and mt9t111 sensor
drivers in omap2plus_defconfig. Also enables
soc-camera and mt9t112 support since mt9t111
sensor is using mt9t112 driver which is based
on soc-camera subsystem.
Loading soc_camera.ko fails. Hence built into
the kernel.

Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
---
 arch/arm/configs/omap2plus_defconfig |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d5f00d7..48032b6 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -133,6 +133,15 @@ CONFIG_TWL4030_WATCHDOG=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_TPS65023=y
 CONFIG_REGULATOR_TPS6507X=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_VIDEO_MEDIA=y
+CONFIG_VIDEO_MT9T111=m
+CONFIG_VIDEO_OMAP3=m
+CONFIG_SOC_CAMERA=y
+CONFIG_SOC_CAMERA_MT9T112=m
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor
  2011-09-27 13:40 ` Deepthy Ravi
@ 2011-09-27 13:51   ` Gary Thomas
  -1 siblings, 0 replies; 25+ messages in thread
From: Gary Thomas @ 2011-09-27 13:51 UTC (permalink / raw)
  To: Deepthy Ravi
  Cc: laurent.pinchart, mchehab, tony, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel,
	linux-omap

On 2011-09-27 07:40, Deepthy Ravi wrote:
> This patchset
> 	-adds support for MT9T111 sensor on omap3evm.
> 	Currently the sensor driver supports only
> 	VGA resolution.
> 	-enables MT9T111 sensor in omap2plus_defconfig.
>
> This is dependent on the following patchset
> http://www.spinics.net/lists/linux-media/msg37270.html
> which adds YUYV input support for OMAP3ISP. And is
> applied on top of rc1-for-3.2 of gliakhovetski/v4l-dvb.git

Why not use the same base as Lennart?
   The set is based on
   http://git.linuxtv.org/pinchartl/media.git/shortlog/refs/heads/omap3isp-omap3isp-next

> ---
> Changes in v2:
> 	As per the discussion here,
> 	https://lkml.org/lkml/2011/9/20/280
> 	the existing mt9t112 driver is reused for
> 	adding support for mt9t111 sensor.
> Deepthy Ravi (3):
>    [media] v4l: Add support for mt9t111 sensor driver
>    ispccdc: Configure CCDC_SYN_MODE register
>    omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers
>
> Vaibhav Hiremath (2):
>    omap3evm: Enable regulators for camera interface
>    omap3evm: Add Camera board init/hookup file
>
>   arch/arm/configs/omap2plus_defconfig        |    9 +
>   arch/arm/mach-omap2/Makefile                |    5 +
>   arch/arm/mach-omap2/board-omap3evm-camera.c |  185 ++++
>   arch/arm/mach-omap2/board-omap3evm.c        |   26 +
>   drivers/media/video/Kconfig                 |    7 +
>   drivers/media/video/Makefile                |    1 +
>   drivers/media/video/mt9t111_reg.h           | 1367 +++++++++++++++++++++++++++
>   drivers/media/video/mt9t112.c               |  320 ++++++-
>   drivers/media/video/omap3isp/ispccdc.c      |   11 +-
>   include/media/mt9t111.h                     |   45 +
>   10 files changed, 1937 insertions(+), 39 deletions(-)
>   create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c
>   create mode 100644 drivers/media/video/mt9t111_reg.h
>   create mode 100644 include/media/mt9t111.h

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor
@ 2011-09-27 13:51   ` Gary Thomas
  0 siblings, 0 replies; 25+ messages in thread
From: Gary Thomas @ 2011-09-27 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 2011-09-27 07:40, Deepthy Ravi wrote:
> This patchset
> 	-adds support for MT9T111 sensor on omap3evm.
> 	Currently the sensor driver supports only
> 	VGA resolution.
> 	-enables MT9T111 sensor in omap2plus_defconfig.
>
> This is dependent on the following patchset
> http://www.spinics.net/lists/linux-media/msg37270.html
> which adds YUYV input support for OMAP3ISP. And is
> applied on top of rc1-for-3.2 of gliakhovetski/v4l-dvb.git

Why not use the same base as Lennart?
   The set is based on
   http://git.linuxtv.org/pinchartl/media.git/shortlog/refs/heads/omap3isp-omap3isp-next

> ---
> Changes in v2:
> 	As per the discussion here,
> 	https://lkml.org/lkml/2011/9/20/280
> 	the existing mt9t112 driver is reused for
> 	adding support for mt9t111 sensor.
> Deepthy Ravi (3):
>    [media] v4l: Add support for mt9t111 sensor driver
>    ispccdc: Configure CCDC_SYN_MODE register
>    omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers
>
> Vaibhav Hiremath (2):
>    omap3evm: Enable regulators for camera interface
>    omap3evm: Add Camera board init/hookup file
>
>   arch/arm/configs/omap2plus_defconfig        |    9 +
>   arch/arm/mach-omap2/Makefile                |    5 +
>   arch/arm/mach-omap2/board-omap3evm-camera.c |  185 ++++
>   arch/arm/mach-omap2/board-omap3evm.c        |   26 +
>   drivers/media/video/Kconfig                 |    7 +
>   drivers/media/video/Makefile                |    1 +
>   drivers/media/video/mt9t111_reg.h           | 1367 +++++++++++++++++++++++++++
>   drivers/media/video/mt9t112.c               |  320 ++++++-
>   drivers/media/video/omap3isp/ispccdc.c      |   11 +-
>   include/media/mt9t111.h                     |   45 +
>   10 files changed, 1937 insertions(+), 39 deletions(-)
>   create mode 100644 arch/arm/mach-omap2/board-omap3evm-camera.c
>   create mode 100644 drivers/media/video/mt9t111_reg.h
>   create mode 100644 include/media/mt9t111.h

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
  2011-09-27 13:40   ` Deepthy Ravi
  (?)
  (?)
@ 2011-09-27 23:20   ` Laurent Pinchart
  -1 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2011-09-27 23:20 UTC (permalink / raw)
  To: Deepthy Ravi; +Cc: hvaibhav, linux-media, g.liakhovetski

Hi Deepthy,

Thanks for the patch.

Please try to avoid adding too many people (and mailing lists) to the CC list. 
I've pruned it down as most of them are not directly concerned by this patch.

On Tuesday 27 September 2011 15:40:45 Deepthy Ravi wrote:
> Added support for mt9t111 sensor in the existing
> mt9t112 driver. Also added support for media controller
> framework. The sensor driver currently supports only
> VGA resolution.
> 
> Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>

[snip]

> +mt9t111_regs patch_rev6[] = {
> +	{0, 0x0982, 0x0},
> +	{0, 0x098A, 0xCE7},
> +	{0, 0x0990, 0x3C3C},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0x3C5F},
> +	{0, 0x0996, 0x4F30},
> +	{0, 0x0998, 0xED08},
> +	{0, 0x099a, 0xBD61},
> +	{0, 0x099c, 0xD5CE},

[snip]

I'm afraid register lists are not an option. You will need to follow the 
mt9t112 driver practice and program the registers based on formats, crop 
rectangles and other settings.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
  2011-09-27 13:40   ` Deepthy Ravi
@ 2011-09-27 23:30     ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 25+ messages in thread
From: Guennadi Liakhovetski @ 2011-09-27 23:30 UTC (permalink / raw)
  To: Deepthy Ravi
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, tony, hvaibhav,
	Linux Media Mailing List, linux, linux-arm-kernel, kyungmin.park,
	Hans Verkuil, m.szyprowski, santosh.shilimkar, khilman,
	linux-kernel, linux-omap

Hi Deepthy

(personally, I don't think this long CC list is justified, you might want 
to drop most of them on the next round, but it's up to you eventually)

Nice, that you managed to re-use the existing mt9t112 driver and extend it 
to work outside of soc-camera and with mt9t111 on omap3. See comments 
below.

On Tue, 27 Sep 2011, Deepthy Ravi wrote:

> Added support for mt9t111 sensor in the existing
> mt9t112 driver. Also added support for media controller
> framework. The sensor driver currently supports only
> VGA resolution.

I think we should support same resolutions on mt9t111 as what is supported 
on mt9t112.

> 
> Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
> ---
>  drivers/media/video/Kconfig       |    7 +
>  drivers/media/video/Makefile      |    1 +
>  drivers/media/video/mt9t111_reg.h | 1367 +++++++++++++++++++++++++++++++++++++
>  drivers/media/video/mt9t112.c     |  320 ++++++++-
>  include/media/mt9t111.h           |   45 ++
>  5 files changed, 1704 insertions(+), 36 deletions(-)
>  create mode 100644 drivers/media/video/mt9t111_reg.h
>  create mode 100644 include/media/mt9t111.h
> 
> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
> index 14326d7..b5806e8 100644
> --- a/drivers/media/video/Kconfig
> +++ b/drivers/media/video/Kconfig
> @@ -482,6 +482,13 @@ config VIDEO_MT9V032
>  	  This is a Video4Linux2 sensor-level driver for the Micron
>  	  MT9V032 752x480 CMOS sensor.
>  
> +config VIDEO_MT9T111
> +	tristate "Aptina MT9T111 VGA CMOS IMAGE SENSOR"
> +	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
> +	---help---
> +	 This is a Video4Linux2 sensor-level driver for the Aptina MT9T111
> +	 image sensor.
> +

This is not needed, just add a note to the MT9T112 entry saying, that 
mt9t111 is supported too, and remove dependency on soc-camera, add 
VIDEO_V4L2 instead. VIDEO_V4L2_SUBDEV_API shouldn't be required.

>  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 c06f515..02a8b70 100644
> --- a/drivers/media/video/Makefile
> +++ b/drivers/media/video/Makefile
> @@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
>  obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
>  obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
>  obj-$(CONFIG_VIDEO_SR030PC30)	+= sr030pc30.o
> +obj-$(CONFIG_VIDEO_MT9T111) += mt9t112.o

unneeded

>  obj-$(CONFIG_VIDEO_NOON010PC30)	+= noon010pc30.o
>  obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
>  obj-$(CONFIG_VIDEO_ADP1653)	+= adp1653.o
> diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
> new file mode 100644
> index 0000000..2f610d4
> --- /dev/null
> +++ b/drivers/media/video/mt9t111_reg.h
> @@ -0,0 +1,1367 @@
> +/*
> + * drivers/media/video/mt9t111_reg.h
> + *
> + * mt9t111 sensor driver header file
> + *
> + * Copyright (C) 2009 Leopard Imaging
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#ifndef MT9T111_REG_H
> +#define MT9T111_REG_H
> +
> +/* register addr */
> +#define MT9T111_CHIP_ID		(0x0000)
> +
> +/* register value */
> +#define MT9T111_CHIP_ID_VALUE	(0x2680)
> +
> +#define MT9T111_IMAGE_WIDTH		(640)
> +#define MT9T111_IMAGE_HEIGHT		(480)

A general note. We assume, that mt9t112 and mt9t111 are _very_ similar and 
can be supported by one driver with maybe some _minor_ chip-specific 
differences. What you seem to be doing is combine two drivers in one. 
Practically duplicating most functionality. If the chips are indeed that 
different, we need two drivers. Otherwise you really only should need some 
_small_ additions to mt9t112.

> +
> +typedef struct {
> +	u16 delay_time;
> +	u16 addr;
> +	u16 data;
> +} mt9t111_regs;
> +
> +mt9t111_regs patch_rev6[] = {
> +	{0, 0x0982, 0x0},

mt9t112 doesn't need any such register magic. If they are similar, we 
shouldn't have to add them for mt9t111 either.

> +	{0, 0x098A, 0xCE7},
> +	{0, 0x0990, 0x3C3C},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0x3C5F},
> +	{0, 0x0996, 0x4F30},
> +	{0, 0x0998, 0xED08},
> +	{0, 0x099a, 0xBD61},
> +	{0, 0x099c, 0xD5CE},
> +	{0, 0x099e, 0x4CD},
> +	{0, 0x098A, 0xCF7},
> +	{0, 0x0990, 0x1F17},
> +	{0, 0x0992, 0x211},
> +	{0, 0x0994, 0xCC33},
> +	{0, 0x0996, 0x2E30},
> +	{0, 0x0998, 0xED02},
> +	{0, 0x099a, 0xCCFF},
> +	{0, 0x099c, 0xFDED},
> +	{0, 0x099e, 0xCC},
> +	{0, 0x098A, 0xD07},
> +	{0, 0x0990, 0x2},
> +	{0, 0x0992, 0xBD70},
> +	{0, 0x0994, 0x6D18},
> +	{0, 0x0996, 0xDE1F},
> +	{0, 0x0998, 0x181F},
> +	{0, 0x099a, 0x8E01},
> +	{0, 0x099c, 0x10CC},
> +	{0, 0x099e, 0x3C52},
> +	{0, 0x098A, 0xD17},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x18},
> +	{0, 0x0994, 0xECA0},
> +	{0, 0x0996, 0xC4FD},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x2120},
> +	{0, 0x099c, 0x1ECC},
> +	{0, 0x099e, 0x3C52},
> +	{0, 0x098A, 0xD27},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0xDE},
> +	{0, 0x0994, 0x1FEC},
> +	{0, 0x0996, 0xA0BD},
> +	{0, 0x0998, 0x7021},
> +	{0, 0x099a, 0xCC3C},
> +	{0, 0x099c, 0x5230},
> +	{0, 0x099e, 0xED02},
> +	{0, 0x098A, 0xD37},
> +	{0, 0x0990, 0xCCFF},
> +	{0, 0x0992, 0xFCED},
> +	{0, 0x0994, 0xCC},
> +	{0, 0x0996, 0x2},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x6DFC},
> +	{0, 0x099c, 0x4E1},
> +	{0, 0x099e, 0x1A83},
> +	{0, 0x098A, 0xD47},
> +	{0, 0x0990, 0x1},
> +	{0, 0x0992, 0x2720},
> +	{0, 0x0994, 0x1A83},
> +	{0, 0x0996, 0x4},
> +	{0, 0x0998, 0x271E},
> +	{0, 0x099a, 0x1A83},
> +	{0, 0x099c, 0x8},
> +	{0, 0x099e, 0x271C},
> +	{0, 0x098A, 0xD57},
> +	{0, 0x0990, 0x1A83},
> +	{0, 0x0992, 0x10},
> +	{0, 0x0994, 0x271A},
> +	{0, 0x0996, 0x1A83},
> +	{0, 0x0998, 0x20},
> +	{0, 0x099a, 0x2718},
> +	{0, 0x099c, 0x1A83},
> +	{0, 0x099e, 0x40},
> +	{0, 0x098A, 0xD67},
> +	{0, 0x0990, 0x2716},
> +	{0, 0x0992, 0x2019},
> +	{0, 0x0994, 0xC61E},
> +	{0, 0x0996, 0x2012},
> +	{0, 0x0998, 0xC622},
> +	{0, 0x099a, 0x200E},
> +	{0, 0x099c, 0xC621},
> +	{0, 0x099e, 0x200A},
> +	{0, 0x098A, 0xD77},
> +	{0, 0x0990, 0xC620},
> +	{0, 0x0992, 0x2006},
> +	{0, 0x0994, 0xC62A},
> +	{0, 0x0996, 0x2002},
> +	{0, 0x0998, 0xC62B},
> +	{0, 0x099a, 0x30ED},
> +	{0, 0x099c, 0x8CC},
> +	{0, 0x099e, 0x3400},
> +	{0, 0x098A, 0xD87},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x34},
> +	{0, 0x0994, 0xBD6F},
> +	{0, 0x0996, 0xD184},
> +	{0, 0x0998, 0x330},
> +	{0, 0x099a, 0xED07},
> +	{0, 0x099c, 0xA60A},
> +	{0, 0x099e, 0x4848},
> +	{0, 0x098A, 0xD97},
> +	{0, 0x0990, 0x5FED},
> +	{0, 0x0992, 0x5EA},
> +	{0, 0x0994, 0x8AA},
> +	{0, 0x0996, 0x731},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x2130},
> +	{0, 0x099c, 0xC60A},
> +	{0, 0x099e, 0x3A35},
> +	{0, 0x098A, 0xDA7},
> +	{0, 0x0990, 0x3937},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0x3C34},
> +	{0, 0x0996, 0xDE2F},
> +	{0, 0x0998, 0xEE0E},
> +	{0, 0x099a, 0xAD00},
> +	{0, 0x099c, 0x7D13},
> +	{0, 0x099e, 0xEF27},
> +	{0, 0x098A, 0xDB7},
> +	{0, 0x0990, 0x7CCE},
> +	{0, 0x0992, 0x13E0},
> +	{0, 0x0994, 0x1E05},
> +	{0, 0x0996, 0x1060},
> +	{0, 0x0998, 0xE60E},
> +	{0, 0x099a, 0x4FC3},
> +	{0, 0x099c, 0x13F0},
> +	{0, 0x099e, 0x8FE6},
> +	{0, 0x098A, 0xDC7},
> +	{0, 0x0990, 0x30},
> +	{0, 0x0992, 0xE107},
> +	{0, 0x0994, 0x2216},
> +	{0, 0x0996, 0xF613},
> +	{0, 0x0998, 0xEE4F},
> +	{0, 0x099a, 0xC313},
> +	{0, 0x099c, 0xF38F},
> +	{0, 0x099e, 0xE600},
> +	{0, 0x098A, 0xDD7},
> +	{0, 0x0990, 0x30E1},
> +	{0, 0x0992, 0x725},
> +	{0, 0x0994, 0x7F6},
> +	{0, 0x0996, 0x13EE},
> +	{0, 0x0998, 0xC103},
> +	{0, 0x099a, 0x253C},
> +	{0, 0x099c, 0x7F13},
> +	{0, 0x099e, 0xEEF6},
> +	{0, 0x098A, 0xDE7},
> +	{0, 0x0990, 0x13EF},
> +	{0, 0x0992, 0xE706},
> +	{0, 0x0994, 0xCC13},
> +	{0, 0x0996, 0xF0ED},
> +	{0, 0x0998, 0x4CC},
> +	{0, 0x099a, 0x13F3},
> +	{0, 0x099c, 0x200F},
> +	{0, 0x099e, 0x7C13},
> +	{0, 0x098A, 0xDF7},
> +	{0, 0x0990, 0xEEEC},
> +	{0, 0x0992, 0x4C3},
> +	{0, 0x0994, 0x1},
> +	{0, 0x0996, 0xED04},
> +	{0, 0x0998, 0xEC02},
> +	{0, 0x099a, 0xC300},
> +	{0, 0x099c, 0x1ED},
> +	{0, 0x099e, 0x2F6},
> +	{0, 0x098A, 0xE07},
> +	{0, 0x0990, 0x13EE},
> +	{0, 0x0992, 0xE106},
> +	{0, 0x0994, 0x2412},
> +	{0, 0x0996, 0xEE04},
> +	{0, 0x0998, 0xE600},
> +	{0, 0x099a, 0x30E1},
> +	{0, 0x099c, 0x722},
> +	{0, 0x099e, 0xDFEE},
> +	{0, 0x098A, 0xE17},
> +	{0, 0x0990, 0x2E6},
> +	{0, 0x0992, 0x30},
> +	{0, 0x0994, 0xE107},
> +	{0, 0x0996, 0x25D6},
> +	{0, 0x0998, 0xDE49},
> +	{0, 0x099a, 0xEE08},
> +	{0, 0x099c, 0xAD00},
> +	{0, 0x099e, 0xCC13},
> +	{0, 0x098A, 0xE27},
> +	{0, 0x0990, 0xF630},
> +	{0, 0x0992, 0xED00},
> +	{0, 0x0994, 0xDE2F},
> +	{0, 0x0996, 0xEE10},
> +	{0, 0x0998, 0xCC13},
> +	{0, 0x099a, 0xFAAD},
> +	{0, 0x099c, 0x38},
> +	{0, 0x099e, 0x3838},
> +	{0, 0x098A, 0xE37},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x098A, 0x1000},
> +	{0, 0x0990, 0xCC10},
> +	{0, 0x0992, 0x9BD},
> +	{0, 0x0994, 0x4224},
> +	{0, 0x0996, 0x7E10},
> +	{0, 0x0998, 0x9C6},
> +	{0, 0x099a, 0x1F7},
> +	{0, 0x099c, 0x18A},
> +	{0, 0x099e, 0xC606},
> +	{0, 0x098A, 0x1010},
> +	{0, 0x0990, 0xF701},
> +	{0, 0x0992, 0x8BDE},
> +	{0, 0x0994, 0x3F18},
> +	{0, 0x0996, 0xCE0B},
> +	{0, 0x0998, 0xF1CC},
> +	{0, 0x099a, 0x11},
> +	{0, 0x099c, 0xBDD7},
> +	{0, 0x099e, 0xCC},
> +	{0, 0x098A, 0x1020},
> +	{0, 0x0990, 0xBF1},
> +	{0, 0x0992, 0xDD3F},
> +	{0, 0x0994, 0xDE35},
> +	{0, 0x0996, 0x18CE},
> +	{0, 0x0998, 0xC03},
> +	{0, 0x099a, 0xCC00},
> +	{0, 0x099c, 0x3FBD},
> +	{0, 0x099e, 0xD700},
> +	{0, 0x098A, 0x1030},
> +	{0, 0x0990, 0xCC0C},
> +	{0, 0x0992, 0x3DD},
> +	{0, 0x0994, 0x35DE},
> +	{0, 0x0996, 0x4718},
> +	{0, 0x0998, 0xCE0C},
> +	{0, 0x099a, 0x43CC},
> +	{0, 0x099c, 0x15},
> +	{0, 0x099e, 0xBDD7},
> +	{0, 0x098A, 0x1040},
> +	{0, 0x0990, 0xCC},
> +	{0, 0x0992, 0xC43},
> +	{0, 0x0994, 0xDD47},
> +	{0, 0x0996, 0xFE00},
> +	{0, 0x0998, 0x3318},
> +	{0, 0x099a, 0xCE0C},
> +	{0, 0x099c, 0x59CC},
> +	{0, 0x099e, 0x9},
> +	{0, 0x098A, 0x1050},
> +	{0, 0x0990, 0xBDD7},
> +	{0, 0x0992, 0xCC},
> +	{0, 0x0994, 0xC59},
> +	{0, 0x0996, 0xFD00},
> +	{0, 0x0998, 0x33DE},
> +	{0, 0x099a, 0x4118},
> +	{0, 0x099c, 0xCE0C},
> +	{0, 0x099e, 0x63CC},
> +	{0, 0x098A, 0x1060},
> +	{0, 0x0990, 0xD},
> +	{0, 0x0992, 0xBDD7},
> +	{0, 0x0994, 0xCC},
> +	{0, 0x0996, 0xC63},
> +	{0, 0x0998, 0xDD41},
> +	{0, 0x099a, 0xFE00},
> +	{0, 0x099c, 0x3118},
> +	{0, 0x099e, 0xCE0C},
> +	{0, 0x098A, 0x1070},
> +	{0, 0x0990, 0x71CC},
> +	{0, 0x0992, 0x29},
> +	{0, 0x0994, 0xBDD7},
> +	{0, 0x0996, 0xCC},
> +	{0, 0x0998, 0xC71},
> +	{0, 0x099a, 0xFD00},
> +	{0, 0x099c, 0x31DE},
> +	{0, 0x099e, 0x3918},
> +	{0, 0x098A, 0x1080},
> +	{0, 0x0990, 0xCE0C},
> +	{0, 0x0992, 0x9BCC},
> +	{0, 0x0994, 0x23},
> +	{0, 0x0996, 0xBDD7},
> +	{0, 0x0998, 0xCC},
> +	{0, 0x099a, 0xC9B},
> +	{0, 0x099c, 0xDD39},
> +	{0, 0x099e, 0xDE49},
> +	{0, 0x098A, 0x1090},
> +	{0, 0x0990, 0x18CE},
> +	{0, 0x0992, 0xCBF},
> +	{0, 0x0994, 0xCC00},
> +	{0, 0x0996, 0xDBD},
> +	{0, 0x0998, 0xD700},
> +	{0, 0x099a, 0xCC0C},
> +	{0, 0x099c, 0xBFDD},
> +	{0, 0x099e, 0x49CC},
> +	{0, 0x098A, 0x10A0},
> +	{0, 0x0990, 0x1162},
> +	{0, 0x0992, 0xFD0B},
> +	{0, 0x0994, 0xFDCC},
> +	{0, 0x0996, 0xCE7},
> +	{0, 0x0998, 0xFD0C},
> +	{0, 0x099a, 0x1FCC},
> +	{0, 0x099c, 0x1245},
> +	{0, 0x099e, 0xFD0C},
> +	{0, 0x098A, 0x10B0},
> +	{0, 0x0990, 0x51CC},
> +	{0, 0x0992, 0x110B},
> +	{0, 0x0994, 0xFD0C},
> +	{0, 0x0996, 0x5BCC},
> +	{0, 0x0998, 0x1108},
> +	{0, 0x099a, 0xFD0C},
> +	{0, 0x099c, 0x65CC},
> +	{0, 0x099e, 0x10D0},
> +	{0, 0x098A, 0x10C0},
> +	{0, 0x0990, 0xFD0C},
> +	{0, 0x0992, 0x7BCC},
> +	{0, 0x0994, 0x12DE},
> +	{0, 0x0996, 0xFD0C},
> +	{0, 0x0998, 0xA7CC},
> +	{0, 0x099a, 0xDA8},
> +	{0, 0x099c, 0xFD0C},
> +	{0, 0x099e, 0xCB39},
> +	{0, 0x098A, 0x10D0},
> +	{0, 0x0990, 0x37DE},
> +	{0, 0x0992, 0x1DEC},
> +	{0, 0x0994, 0xC5F},
> +	{0, 0x0996, 0x8402},
> +	{0, 0x0998, 0x4416},
> +	{0, 0x099a, 0x4FF7},
> +	{0, 0x099c, 0xCCD},
> +	{0, 0x099e, 0xE60B},
> +	{0, 0x098A, 0x10E0},
> +	{0, 0x0990, 0xC407},
> +	{0, 0x0992, 0xF70C},
> +	{0, 0x0994, 0xCE7F},
> +	{0, 0x0996, 0x30C4},
> +	{0, 0x0998, 0xEC25},
> +	{0, 0x099a, 0xFD30},
> +	{0, 0x099c, 0xC5FC},
> +	{0, 0x099e, 0x6D6},
> +	{0, 0x098A, 0x10F0},
> +	{0, 0x0990, 0xFD30},
> +	{0, 0x0992, 0xC701},
> +	{0, 0x0994, 0xFC30},
> +	{0, 0x0996, 0xC0FD},
> +	{0, 0x0998, 0xBED},
> +	{0, 0x099a, 0xFC30},
> +	{0, 0x099c, 0xC2FD},
> +	{0, 0x099e, 0xBEF},
> +	{0, 0x098A, 0x1100},
> +	{0, 0x0990, 0x30E6},
> +	{0, 0x0992, 0xBD},
> +	{0, 0x0994, 0x5203},
> +	{0, 0x0996, 0x3139},
> +	{0, 0x0998, 0x7E9E},
> +	{0, 0x099a, 0x143C},
> +	{0, 0x099c, 0x3C3C},
> +	{0, 0x099e, 0x2101},
> +	{0, 0x098A, 0x1110},
> +	{0, 0x0990, 0xCC00},
> +	{0, 0x0992, 0x18BD},
> +	{0, 0x0994, 0x6FD1},
> +	{0, 0x0996, 0xC504},
> +	{0, 0x0998, 0x26F5},
> +	{0, 0x099a, 0xDC25},
> +	{0, 0x099c, 0x30ED},
> +	{0, 0x099e, 0x420},
> +	{0, 0x098A, 0x1120},
> +	{0, 0x0990, 0x12EE},
> +	{0, 0x0992, 0x43C},
> +	{0, 0x0994, 0x1838},
> +	{0, 0x0996, 0xE621},
> +	{0, 0x0998, 0x18E7},
> +	{0, 0x099a, 0xBE30},
> +	{0, 0x099c, 0xEE04},
> +	{0, 0x099e, 0xEC1D},
> +	{0, 0x098A, 0x1130},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x4EC},
> +	{0, 0x0994, 0x426},
> +	{0, 0x0996, 0xEACC},
> +	{0, 0x0998, 0x1A},
> +	{0, 0x099a, 0xED02},
> +	{0, 0x099c, 0xCCFB},
> +	{0, 0x099e, 0xFFED},
> +	{0, 0x098A, 0x1140},
> +	{0, 0x0990, 0xCC},
> +	{0, 0x0992, 0x400},
> +	{0, 0x0994, 0xBD70},
> +	{0, 0x0996, 0x6DCC},
> +	{0, 0x0998, 0x1A},
> +	{0, 0x099a, 0x30ED},
> +	{0, 0x099c, 0x2CC},
> +	{0, 0x099e, 0xFBFF},
> +	{0, 0x098A, 0x1150},
> +	{0, 0x0990, 0xED00},
> +	{0, 0x0992, 0x5F4F},
> +	{0, 0x0994, 0xBD70},
> +	{0, 0x0996, 0x6D5F},
> +	{0, 0x0998, 0xBD5B},
> +	{0, 0x099a, 0x17BD},
> +	{0, 0x099c, 0x558B},
> +	{0, 0x099e, 0x3838},
> +	{0, 0x098A, 0x1160},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0xC640},
> +	{0, 0x0996, 0xF730},
> +	{0, 0x0998, 0xC4FC},
> +	{0, 0x099a, 0xBED},
> +	{0, 0x099c, 0xFD30},
> +	{0, 0x099e, 0xC0FC},
> +	{0, 0x098A, 0x1170},
> +	{0, 0x0990, 0xBEF},
> +	{0, 0x0992, 0xFD30},
> +	{0, 0x0994, 0xC2DE},
> +	{0, 0x0996, 0x1DEC},
> +	{0, 0x0998, 0x25FD},
> +	{0, 0x099a, 0x30C5},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0x1FC},
> +	{0, 0x098A, 0x1180},
> +	{0, 0x0990, 0x30C2},
> +	{0, 0x0992, 0xFD06},
> +	{0, 0x0994, 0xD6EC},
> +	{0, 0x0996, 0xC5F},
> +	{0, 0x0998, 0x8402},
> +	{0, 0x099a, 0x4416},
> +	{0, 0x099c, 0x4F30},
> +	{0, 0x099e, 0xE703},
> +	{0, 0x098A, 0x1190},
> +	{0, 0x0990, 0xF10C},
> +	{0, 0x0992, 0xCD27},
> +	{0, 0x0994, 0x15F1},
> +	{0, 0x0996, 0xCCD},
> +	{0, 0x0998, 0x2309},
> +	{0, 0x099a, 0xFC06},
> +	{0, 0x099c, 0xD604},
> +	{0, 0x099e, 0xFD06},
> +	{0, 0x098A, 0x11A0},
> +	{0, 0x0990, 0xD620},
> +	{0, 0x0992, 0x7FC},
> +	{0, 0x0994, 0x6D6},
> +	{0, 0x0996, 0x5FD},
> +	{0, 0x0998, 0x6D6},
> +	{0, 0x099a, 0xDE1D},
> +	{0, 0x099c, 0xE60B},
> +	{0, 0x099e, 0xC407},
> +	{0, 0x098A, 0x11B0},
> +	{0, 0x0990, 0x30E7},
> +	{0, 0x0992, 0x2F1},
> +	{0, 0x0994, 0xCCE},
> +	{0, 0x0996, 0x272C},
> +	{0, 0x0998, 0x7D0C},
> +	{0, 0x099a, 0xCE27},
> +	{0, 0x099c, 0x275D},
> +	{0, 0x099e, 0x2724},
> +	{0, 0x098A, 0x11C0},
> +	{0, 0x0990, 0x7F30},
> +	{0, 0x0992, 0xC4FC},
> +	{0, 0x0994, 0x6D6},
> +	{0, 0x0996, 0xFD30},
> +	{0, 0x0998, 0xC5F6},
> +	{0, 0x099a, 0xCCE},
> +	{0, 0x099c, 0x4FFD},
> +	{0, 0x099e, 0x30C7},
> +	{0, 0x098A, 0x11D0},
> +	{0, 0x0990, 0xC640},
> +	{0, 0x0992, 0xF730},
> +	{0, 0x0994, 0xC4E6},
> +	{0, 0x0996, 0x24F},
> +	{0, 0x0998, 0xFD30},
> +	{0, 0x099a, 0xC501},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0xFC30},
> +	{0, 0x098A, 0x11E0},
> +	{0, 0x0990, 0xC2FD},
> +	{0, 0x0992, 0x6D6},
> +	{0, 0x0994, 0x7D06},
> +	{0, 0x0996, 0xCB27},
> +	{0, 0x0998, 0x2EC6},
> +	{0, 0x099a, 0x40F7},
> +	{0, 0x099c, 0x30C4},
> +	{0, 0x099e, 0xFC06},
> +	{0, 0x098A, 0x11F0},
> +	{0, 0x0990, 0xC104},
> +	{0, 0x0992, 0xF306},
> +	{0, 0x0994, 0xD6ED},
> +	{0, 0x0996, 0x5F},
> +	{0, 0x0998, 0x6D00},
> +	{0, 0x099a, 0x2A01},
> +	{0, 0x099c, 0x5317},
> +	{0, 0x099e, 0xFD30},
> +	{0, 0x098A, 0x1200},
> +	{0, 0x0990, 0xC0EC},
> +	{0, 0x0992, 0xFD},
> +	{0, 0x0994, 0x30C2},
> +	{0, 0x0996, 0xFC06},
> +	{0, 0x0998, 0xC1FD},
> +	{0, 0x099a, 0x30C5},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0x1FC},
> +	{0, 0x098A, 0x1210},
> +	{0, 0x0990, 0x30C2},
> +	{0, 0x0992, 0xFD06},
> +	{0, 0x0994, 0xC720},
> +	{0, 0x0996, 0x227F},
> +	{0, 0x0998, 0x30C4},
> +	{0, 0x099a, 0xDE1D},
> +	{0, 0x099c, 0xEC25},
> +	{0, 0x099e, 0xFD30},
> +	{0, 0x098A, 0x1220},
> +	{0, 0x0990, 0xC5FC},
> +	{0, 0x0992, 0x6D6},
> +	{0, 0x0994, 0xFD30},
> +	{0, 0x0996, 0xC701},
> +	{0, 0x0998, 0xFC30},
> +	{0, 0x099a, 0xC0FD},
> +	{0, 0x099c, 0x6D0},
> +	{0, 0x099e, 0xFC30},
> +	{0, 0x098A, 0x1230},
> +	{0, 0x0990, 0xC2FD},
> +	{0, 0x0992, 0x6D2},
> +	{0, 0x0994, 0xEC25},
> +	{0, 0x0996, 0xFD06},
> +	{0, 0x0998, 0xC3BD},
> +	{0, 0x099a, 0x953C},
> +	{0, 0x099c, 0xDE3F},
> +	{0, 0x099e, 0xEE10},
> +	{0, 0x098A, 0x1240},
> +	{0, 0x0990, 0xAD00},
> +	{0, 0x0992, 0x3838},
> +	{0, 0x0994, 0x3930},
> +	{0, 0x0996, 0x8FC3},
> +	{0, 0x0998, 0xFFE9},
> +	{0, 0x099a, 0x8F35},
> +	{0, 0x099c, 0xBDAD},
> +	{0, 0x099e, 0x1530},
> +	{0, 0x098A, 0x1250},
> +	{0, 0x0990, 0x6F16},
> +	{0, 0x0992, 0x18DE},
> +	{0, 0x0994, 0x1918},
> +	{0, 0x0996, 0x8FC3},
> +	{0, 0x0998, 0x14B},
> +	{0, 0x099a, 0x188F},
> +	{0, 0x099c, 0x18EC},
> +	{0, 0x099e, 0xFD},
> +	{0, 0x098A, 0x1260},
> +	{0, 0x0990, 0x50E},
> +	{0, 0x0992, 0x18EC},
> +	{0, 0x0994, 0x2FD},
> +	{0, 0x0996, 0x510},
> +	{0, 0x0998, 0xE616},
> +	{0, 0x099a, 0x4FED},
> +	{0, 0x099c, 0x418},
> +	{0, 0x099e, 0x8FC3},
> +	{0, 0x098A, 0x1270},
> +	{0, 0x0990, 0xFFCB},
> +	{0, 0x0992, 0xE304},
> +	{0, 0x0994, 0x8FE6},
> +	{0, 0x0996, 0xF7},
> +	{0, 0x0998, 0x514},
> +	{0, 0x099a, 0x18DE},
> +	{0, 0x099c, 0x1930},
> +	{0, 0x099e, 0xE616},
> +	{0, 0x098A, 0x1280},
> +	{0, 0x0990, 0x4FED},
> +	{0, 0x0992, 0x418},
> +	{0, 0x0994, 0x8FC3},
> +	{0, 0x0996, 0x119},
> +	{0, 0x0998, 0xE304},
> +	{0, 0x099a, 0x8FE6},
> +	{0, 0x099c, 0xF7},
> +	{0, 0x099e, 0x515},
> +	{0, 0x098A, 0x1290},
> +	{0, 0x0990, 0xFC05},
> +	{0, 0x0992, 0x5BFD},
> +	{0, 0x0994, 0x512},
> +	{0, 0x0996, 0xDE37},
> +	{0, 0x0998, 0xEE08},
> +	{0, 0x099a, 0xAD00},
> +	{0, 0x099c, 0x30E6},
> +	{0, 0x099e, 0x164F},
> +	{0, 0x098A, 0x12A0},
> +	{0, 0x0990, 0x5ED},
> +	{0, 0x0992, 0x48F},
> +	{0, 0x0994, 0xC300},
> +	{0, 0x0996, 0x630},
> +	{0, 0x0998, 0xE304},
> +	{0, 0x099a, 0x8FF6},
> +	{0, 0x099c, 0x516},
> +	{0, 0x099e, 0x4FED},
> +	{0, 0x098A, 0x12B0},
> +	{0, 0x0990, 0x30},
> +	{0, 0x0992, 0x6C16},
> +	{0, 0x0994, 0xE616},
> +	{0, 0x0996, 0xC103},
> +	{0, 0x0998, 0x2598},
> +	{0, 0x099a, 0xCC32},
> +	{0, 0x099c, 0x8EED},
> +	{0, 0x099e, 0xEC},
> +	{0, 0x098A, 0x12C0},
> +	{0, 0x0990, 0x6BD},
> +	{0, 0x0992, 0x7021},
> +	{0, 0x0994, 0xCC32},
> +	{0, 0x0996, 0x6C30},
> +	{0, 0x0998, 0xED02},
> +	{0, 0x099a, 0xCCF8},
> +	{0, 0x099c, 0xED},
> +	{0, 0x099e, 0xA6},
> +	{0, 0x098A, 0x12D0},
> +	{0, 0x0990, 0x9E3},
> +	{0, 0x0992, 0xA84},
> +	{0, 0x0994, 0x7BD},
> +	{0, 0x0996, 0x706D},
> +	{0, 0x0998, 0x30C6},
> +	{0, 0x099a, 0x173A},
> +	{0, 0x099c, 0x3539},
> +	{0, 0x099e, 0x3CBD},
> +	{0, 0x098A, 0x12E0},
> +	{0, 0x0990, 0x776D},
> +	{0, 0x0992, 0xCC32},
> +	{0, 0x0994, 0x5C30},
> +	{0, 0x0996, 0xED00},
> +	{0, 0x0998, 0xFC13},
> +	{0, 0x099a, 0x8683},
> +	{0, 0x099c, 0x1},
> +	{0, 0x099e, 0xBD70},
> +	{0, 0x098A, 0x12F0},
> +	{0, 0x0990, 0x21CC},
> +	{0, 0x0992, 0x325E},
> +	{0, 0x0994, 0x30ED},
> +	{0, 0x0996, 0xFC},
> +	{0, 0x0998, 0x1388},
> +	{0, 0x099a, 0x8300},
> +	{0, 0x099c, 0x1BD},
> +	{0, 0x099e, 0x7021},
> +	{0, 0x098A, 0x1300},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x098E, 0x0010},
> +	{0, 0x0990, 0x1000},
> +	{0, 0x098E, 0x0003},
> +	{100, 0x0990, 0x0004}
> +};
> +
> +mt9t111_regs def_regs1[] = {
> +	{0, 0x001A, 0x0218},
> +	{0, 0x001E, 0x0777},
> +	{0, 0x3084, 0x2409},
> +	{0, 0x3092, 0x0A49},
> +	{0, 0x3094, 0x4949},
> +	{0, 0x3096, 0x4950},
> +	{0, 0x0018, 0x402D},
> +	{100, 0x0018, 0x402C},
> +	{0, 0x098E, 0x6800},
> +	{0, 0x0990, 0x0280},
> +	{0, 0x098E, 0x6802},
> +	{0, 0x0990, 0x01E0},
> +	{0, 0x098E, 0xE88E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x68A0},
> +	{0, 0x0990, 0x082D},
> +	{0, 0x098E, 0x4802},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x4804},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x4806},
> +	{0, 0x0990, 0x060D},
> +	{0, 0x098E, 0x4808},
> +	{0, 0x0990, 0x080D},
> +	{0, 0x098E, 0x480A},
> +	{0, 0x0990, 0x0111},
> +	{0, 0x098E, 0x480C},
> +	{0, 0x0990, 0x046C},
> +	{0, 0x098E, 0x480F},
> +	{0, 0x0990, 0x00CC},
> +	{0, 0x098E, 0x4811},
> +	{0, 0x0990, 0x0381},
> +	{0, 0x098E, 0x4813},
> +	{0, 0x0990, 0x024F},
> +	{0, 0x098E, 0x481D},
> +	{0, 0x0990, 0x05AE},
> +	{0, 0x098E, 0x481F},
> +	{0, 0x0990, 0x05D0},
> +	{0, 0x098E, 0x4825},
> +	{0, 0x0990, 0x07AC},
> +	{0, 0x098E, 0x6C00},
> +	{0, 0x0990, 0x0800},
> +	{0, 0x098E, 0x6C02},
> +	{0, 0x0990, 0x0600},
> +	{0, 0x098E, 0xEC8E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x6CA0},
> +	{0, 0x0990, 0x082D},
> +	{0, 0x098E, 0x484A},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x484C},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x484E},
> +	{0, 0x0990, 0x060D},
> +	{0, 0x098E, 0x4850},
> +	{0, 0x0990, 0x080D},
> +	{0, 0x098E, 0x4852},
> +	{0, 0x0990, 0x0111},
> +	{0, 0x098E, 0x4854},
> +	{0, 0x0990, 0x146C},
> +	{0, 0x098E, 0x4857},
> +	{0, 0x0990, 0x00CC},
> +	{0, 0x098E, 0x4859},
> +	{0, 0x0990, 0x0381},
> +	{0, 0x098E, 0x485B},
> +	{0, 0x0990, 0x024F},
> +	{0, 0x098E, 0x4865},
> +	{0, 0x0990, 0x05AE},
> +	{0, 0x098E, 0x4867},
> +	{0, 0x0990, 0x05D0},
> +	{0, 0x098E, 0x486D},
> +	{0, 0x0990, 0x07AC},
> +	{0, 0x098E, 0xC8A5},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xC8A6},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC8A7},
> +	{0, 0x0990, 0x0023},
> +	{0, 0x098E, 0xC8A8},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC844},
> +	{0, 0x0990, 0x0091},
> +	{0, 0x098E, 0xC92F},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC845},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0xC92D},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC88C},
> +	{0, 0x0990, 0x0091},
> +	{0, 0x098E, 0xC930},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC88D},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0xC92E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xA002},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xA009},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0xA00A},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xA00C},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0x4846},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x68AA},
> +	{0, 0x0990, 0x0278},
> +	{0, 0x098E, 0x488E},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x6CAA},
> +	{0, 0x0990, 0x0218},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0005},
> +	{0, 0x3C20, 0x0001},
> +	{0, 0x364A, 0x7D2F},
> +	{0, 0x364C, 0x79EB},
> +	{0, 0x364E, 0x18D2},
> +	{0, 0x3650, 0x9F8F},
> +	{0, 0x3652, 0xA7D2},
> +	{0, 0x368A, 0x460C},
> +	{0, 0x368C, 0x14F0},
> +	{0, 0x368E, 0x946F},
> +	{0, 0x3690, 0xC471},
> +	{0, 0x3692, 0x04B1},
> +	{0, 0x36CA, 0x0433},
> +	{0, 0x36CC, 0x680D},
> +	{0, 0x36CE, 0xEEF3},
> +	{0, 0x36D0, 0x4850},
> +	{0, 0x36D2, 0xF233},
> +	{0, 0x370A, 0xB2AF},
> +	{0, 0x370C, 0x2CF0},
> +	{0, 0x370E, 0x3F10},
> +	{0, 0x3710, 0xC673},
> +	{0, 0x3712, 0xA972},
> +	{0, 0x374A, 0x0590},
> +	{0, 0x374C, 0xAFB3},
> +	{0, 0x374E, 0x93D7},
> +	{0, 0x3750, 0x8D12},
> +	{0, 0x3752, 0x2539},
> +	{0, 0x3640, 0x0350},
> +	{0, 0x3642, 0x322C},
> +	{0, 0x3644, 0x77D1},
> +	{0, 0x3646, 0xA26F},
> +	{0, 0x3648, 0xC872},
> +	{0, 0x3680, 0x0C4C},
> +	{0, 0x3682, 0x9510},
> +	{0, 0x3684, 0x110E},
> +	{0, 0x3686, 0x4331},
> +	{0, 0x3688, 0xC1CF},
> +	{0, 0x36C0, 0x6152},
> +	{0, 0x36C2, 0x038E},
> +	{0, 0x36C4, 0x9AF4},
> +	{0, 0x36C6, 0xE12F},
> +	{0, 0x36C8, 0x09F3},
> +	{0, 0x3700, 0xC5AF},
> +	{0, 0x3702, 0xCA90},
> +	{0, 0x3704, 0x5D0F},
> +	{0, 0x3706, 0x3293},
> +	{0, 0x3708, 0x2B92},
> +	{0, 0x3740, 0xC590},
> +	{0, 0x3742, 0x8133},
> +	{0, 0x3744, 0xE0F6},
> +	{0, 0x3746, 0x0254},
> +	{0, 0x3748, 0x10B9},
> +	{0, 0x3654, 0x7F8F},
> +	{0, 0x3656, 0x6F6C},
> +	{0, 0x3658, 0x5971},
> +	{0, 0x365A, 0x9A0F},
> +	{0, 0x365C, 0xA1B2},
> +	{0, 0x3694, 0xB00C},
> +	{0, 0x3696, 0xEBCF},
> +	{0, 0x3698, 0x06AD},
> +	{0, 0x369A, 0x4D31},
> +	{0, 0x369C, 0x2A4E},
> +	{0, 0x36D4, 0x4752},
> +	{0, 0x36D6, 0x724D},
> +	{0, 0x36D8, 0xAD34},
> +	{0, 0x36DA, 0x1350},
> +	{0, 0x36DC, 0x4E94},
> +	{0, 0x3714, 0xA06E},
> +	{0, 0x3716, 0x9152},
> +	{0, 0x3718, 0x1F53},
> +	{0, 0x371A, 0x3933},
> +	{0, 0x371C, 0xBA94},
> +	{0, 0x3754, 0x1233},
> +	{0, 0x3756, 0xA032},
> +	{0, 0x3758, 0xE936},
> +	{0, 0x375A, 0xBE34},
> +	{0, 0x375C, 0x02D9},
> +	{0, 0x365E, 0x7DEF},
> +	{0, 0x3660, 0x434B},
> +	{0, 0x3662, 0x69F1},
> +	{0, 0x3664, 0x8A0F},
> +	{0, 0x3666, 0xBDB2},
> +	{0, 0x369E, 0x290D},
> +	{0, 0x36A0, 0x42CF},
> +	{0, 0x36A2, 0xDC6D},
> +	{0, 0x36A4, 0x91B1},
> +	{0, 0x36A6, 0x9DE9},
> +	{0, 0x36DE, 0x70B2},
> +	{0, 0x36E0, 0x02AC},
> +	{0, 0x36E2, 0x9714},
> +	{0, 0x36E4, 0xF3CF},
> +	{0, 0x36E6, 0x6BD1},
> +	{0, 0x371E, 0xE42E},
> +	{0, 0x3720, 0x1D32},
> +	{0, 0x3722, 0xCC31},
> +	{0, 0x3724, 0xAE94},
> +	{0, 0x3726, 0x6413},
> +	{0, 0x375E, 0xE290},
> +	{0, 0x3760, 0x8F53},
> +	{0, 0x3762, 0xF936},
> +	{0, 0x3764, 0x4614},
> +	{0, 0x3766, 0x1B59},
> +	{0, 0x3784, 0x0404},
> +	{0, 0x3782, 0x0304},
> +	{0, 0x3210, 0x01B8},
> +	{0, 0x098E, 0xC913},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0x686B},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x686D},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x6C6B},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x6C6D},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x3439},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x343B},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x4926},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0x4928},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x492A},
> +	{0, 0x0990, 0x0656},
> +	{0, 0x098E, 0x4D26},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0x4D28},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x4D2A},
> +	{0, 0x0990, 0x0656},
> +	{0, 0x33F4, 0x040B},
> +	{0, 0x098E, 0xC916},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0xC919},
> +	{0, 0x0990, 0x0028},
> +	{0, 0x098E, 0xC917},
> +	{0, 0x0990, 0x0004},
> +	{0, 0x098E, 0xC918},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC91A},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0xC91B},
> +	{0, 0x0990, 0x0009},
> +	{0, 0x326C, 0x0C00},
> +	{0, 0x098E, 0x494B},
> +	{0, 0x0990, 0x0042},
> +	{0, 0x098E, 0x494D},
> +	{0, 0x0990, 0x012C},
> +	{0, 0x098E, 0xC91E},
> +	{0, 0x0990, 0x0012},
> +	{0, 0x098E, 0xC91F},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0xC920},
> +	{0, 0x0990, 0x0012},
> +	{0, 0x098E, 0xC921},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0xC922},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC923},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xC924},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC925},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xBC02},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xBC05},
> +	{0, 0x0990, 0x000E},
> +	{0, 0x098E, 0xC950},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xC94F},
> +	{0, 0x0990, 0x0038},
> +	{0, 0x098E, 0xC952},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xC951},
> +	{0, 0x0990, 0x0051},
> +	{0, 0x098E, 0xC954},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xC953},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC956},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xC955},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC958},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC957},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0xC95A},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xC959},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC95C},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0xC95B},
> +	{0, 0x0990, 0x0008},
> +	{0, 0x098E, 0xC95E},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0xC95D},
> +	{0, 0x0990, 0x0008},
> +	{0, 0x098E, 0xC95F},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0x48DC},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48DE},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48E0},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0x48E2},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48E4},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48E6},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0x48E8},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48EA},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48EC},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xDC2A},
> +	{0, 0x0990, 0x000B},
> +	{0, 0x098E, 0xDC2B},
> +	{0, 0x0990, 0x0017},
> +	{0, 0x098E, 0xBC0B},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC0C},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xBC0D},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0xBC0E},
> +	{0, 0x0990, 0x003E},
> +	{0, 0x098E, 0xBC0F},
> +	{0, 0x0990, 0x005A},
> +	{0, 0x098E, 0xBC10},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC11},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC12},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC13},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC14},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC15},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC16},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC17},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC18},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC19},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC1A},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC1B},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC1C},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC1D},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xBC1E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC1F},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xBC20},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0xBC21},
> +	{0, 0x0990, 0x003E},
> +	{0, 0x098E, 0xBC22},
> +	{0, 0x0990, 0x005A},
> +	{0, 0x098E, 0xBC23},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC24},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC25},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC26},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC27},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC28},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC29},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC2A},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC2B},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC2C},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC2D},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC2E},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC2F},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC30},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xBC31},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC32},
> +	{0, 0x0990, 0x000D},
> +	{0, 0x098E, 0xBC33},
> +	{0, 0x0990, 0x0019},
> +	{0, 0x098E, 0xBC34},
> +	{0, 0x0990, 0x0030},
> +	{0, 0x098E, 0xBC35},
> +	{0, 0x0990, 0x0056},
> +	{0, 0x098E, 0xBC36},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC37},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC38},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC39},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC3A},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC3B},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC3C},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC3D},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC3E},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC3F},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC40},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC41},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC42},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC43},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0x6865},
> +	{0, 0x0990, 0x00E0},
> +	{0, 0x098E, 0x6867},
> +	{0, 0x0990, 0x00F4},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xBC4A},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x098E, 0xBC4B},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x098E, 0xBC4C},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x3542, 0x0010},
> +	{0, 0x3544, 0x0030},
> +	{0, 0x3546, 0x0040},
> +	{0, 0x3548, 0x0080},
> +	{0, 0x354A, 0x0100},
> +	{0, 0x354C, 0x0200},
> +	{0, 0x354E, 0x0300},
> +	{0, 0x3550, 0x0010},
> +	{0, 0x3552, 0x0030},
> +	{0, 0x3554, 0x0040},
> +	{0, 0x3556, 0x0080},
> +	{0, 0x3558, 0x012C},
> +	{0, 0x355A, 0x0320},
> +	{0, 0x355C, 0x03E8},
> +	{0, 0x3560, 0x0040},
> +	{0, 0x3562, 0x0020},
> +	{0, 0x3564, 0x0040},
> +	{0, 0x3566, 0x0010},
> +	{0, 0x3568, 0x0008},
> +	{0, 0x356A, 0x0004},
> +	{0, 0x356C, 0x0004},
> +	{0, 0x356E, 0x0004},
> +	{0, 0x098E, 0x3C4D},
> +	{0, 0x0990, 0x0DAC},
> +	{0, 0x098E, 0x3C4F},
> +	{0, 0x0990, 0x148A},
> +	{0, 0x098E, 0xC911},
> +	{0, 0x0990, 0x00C8},
> +	{0, 0x098E, 0xC8F4},
> +	{0, 0x0990, 0x0004},
> +	{0, 0x098E, 0xC8F5},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x48F6},
> +	{0, 0x0990, 0x3B4D},
> +	{0, 0x098E, 0x48F8},
> +	{0, 0x0990, 0x6380},
> +	{0, 0x098E, 0x48FA},
> +	{0, 0x0990, 0x9B18},
> +	{0, 0x098E, 0x48FC},
> +	{0, 0x0990, 0x5D51},
> +	{0, 0x098E, 0x48FE},
> +	{0, 0x0990, 0xEDE8},
> +	{0, 0x098E, 0x4900},
> +	{0, 0x0990, 0xE515},
> +	{0, 0x098E, 0x4902},
> +	{0, 0x0990, 0xBFF4},
> +	{0, 0x098E, 0x4904},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0x4906},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0x4908},
> +	{0, 0x0990, 0x0033},
> +	{0, 0x098E, 0xE84A},
> +	{0, 0x0990, 0x0083},
> +	{0, 0x098E, 0xE84D},
> +	{0, 0x0990, 0x0083},
> +	{0, 0x098E, 0xE84C},
> +	{0, 0x0990, 0x0080},
> +	{0, 0x098E, 0xE84F},
> +	{0, 0x0990, 0x0080},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0x48B0},
> +	{0, 0x0990, 0x0180},
> +	{0, 0x098E, 0x48B2},
> +	{0, 0x0990, 0xFF7A},
> +	{0, 0x098E, 0x48B4},
> +	{0, 0x0990, 0x0018},
> +	{0, 0x098E, 0x48B6},
> +	{0, 0x0990, 0xFFCA},
> +	{0, 0x098E, 0x48B8},
> +	{0, 0x0990, 0x017C},
> +	{0, 0x098E, 0x48BA},
> +	{0, 0x0990, 0xFFCC},
> +	{0, 0x098E, 0x48BC},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0x48BE},
> +	{0, 0x0990, 0xFF1F},
> +	{0, 0x098E, 0x48C0},
> +	{0, 0x0990, 0x01E8},
> +	{0, 0x098E, 0x48C2},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0x48C4},
> +	{0, 0x0990, 0x0044},
> +	{0, 0x098E, 0x48C6},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0x48C8},
> +	{0, 0x0990, 0xFFAD},
> +	{0, 0x098E, 0x48CA},
> +	{0, 0x0990, 0xFFE2},
> +	{0, 0x098E, 0x48CC},
> +	{0, 0x0990, 0x0033},
> +	{0, 0x098E, 0x48CE},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0x48D0},
> +	{0, 0x0990, 0xFFAA},
> +	{0, 0x098E, 0x48D2},
> +	{0, 0x0990, 0x0017},
> +	{0, 0x098E, 0x48D4},
> +	{0, 0x0990, 0x004B},
> +	{0, 0x098E, 0x48D6},
> +	{0, 0x0990, 0xFFA5},
> +	{0, 0x098E, 0x48D8},
> +	{0, 0x0990, 0x0015},
> +	{0, 0x098E, 0x48DA},
> +	{0, 0x0990, 0xFFE2},
> +	{0, 0x35A2, 0x0014},
> +	{0, 0x098E, 0xC949},
> +	{0, 0x0990, 0x0024},
> +	{0, 0x35A4, 0x0596},
> +	{0, 0x098E, 0xC94A},
> +	{0, 0x0990, 0x0062},
> +	{0, 0x098E, 0xC948},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xC914},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC915},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xE86F},
> +	{0, 0x0990, 0x0060},
> +	{0, 0x098E, 0xE870},
> +	{0, 0x0990, 0x003C},
> +	{0, 0x098E, 0xEC6F},
> +	{0, 0x0990, 0x0060},
> +	{0, 0x098E, 0xEC70},
> +	{0, 0x0990, 0x003C},
> +	{0, 0x098E, 0xE883},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xEC83},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xE885},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xE886},
> +	{0, 0x0990, 0x00D8},
> +	{0, 0x098E, 0xEC85},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xEC86},
> +	{0, 0x0990, 0x00D8},
> +	{0, 0x098E, 0xE884},
> +	{0, 0x0990, 0x005C},
> +	{0, 0x098E, 0xEC84},
> +	{0, 0x0990, 0x005C},
> +	{0, 0x098E, 0x490A},
> +	{0, 0x0990, 0x0666},
> +	{0, 0x098E, 0x490C},
> +	{0, 0x0990, 0x0140},
> +	{0, 0x098E, 0x6857},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x685C},
> +	{0, 0x0990, 0x0005},
> +	{0, 0x098E, 0x490E},
> +	{0, 0x0990, 0x00A4},
> +	{0, 0x098E, 0xB43D},
> +	{0, 0x0990, 0x0031},
> +	{0, 0x098E, 0xB43E},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xB43F},
> +	{0, 0x0990, 0x0028},
> +	{0, 0x098E, 0xB440},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xB441},
> +	{0, 0x0990, 0x00CD},
> +	{0, 0x098E, 0xB442},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xB443},
> +	{0, 0x0990, 0x000F},
> +	{0, 0x098E, 0xB444},
> +	{0, 0x0990, 0x0007},
> +	{0, 0x098E, 0x300D},
> +	{0, 0x0990, 0x000F},
> +	{0, 0x098E, 0x3017},
> +	{0, 0x0990, 0x0F0F},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xE81F},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0x68A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x6CA0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x70A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x74A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x3C52, 0x082E},
> +	{0, 0x098E, 0x488E},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xECAC},
> +	{0, 0x0990, 0x0000}
> +};
> +
> +mt9t111_regs def_regs2[] = {
> +	{100, 0x0018, 0x0028},
> +	{0, 0x316C, 0x350F},
> +	{0, 0x098E, 0x6817},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x0034, 0x0000}
> +};
> +
> +mt9t111_regs pll_regs1[] = {
> +	{0, 0x0014, 0x2425},
> +	{0, 0x0014, 0x2425},
> +	{0, 0x0014, 0x2145},
> +	{0, 0x0010, 0x0219},
> +	{0, 0x0012, 0x0090},
> +	{0, 0x002A, 0x79DD},
> +	{0, 0x0014, 0x2545},
> +	{0, 0x0014, 0x2547},
> +	{0, 0x0014, 0x3447},
> +	{0, 0x0014, 0x3047}
> +};
> +
> +mt9t111_regs pll_regs2[] = {
> +	{0, 0x0014, 0x3046},
> +	{0, 0x0022, 0x01E0},
> +	{0, 0x001E, 0x0707},
> +	{0, 0x3B84, 0x011D}
> +};
> +
> +mt9t111_regs bayer_pattern_regs[] = {
> +	{0, 0x098E, 0x6807},
> +	{0, 0x0990, 0x0100},
> +	{0, 0x098E, 0x6809},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xE88E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x6C07},
> +	{0, 0x0990, 0x0100},
> +	{0, 0x098E, 0x6C09},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xEC8E},
> +	{0, 0x0990, 0x0000}
> +};
> +
> +#endif
> diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
> index 32114a3..aba49e2 100644
> --- a/drivers/media/video/mt9t112.c
> +++ b/drivers/media/video/mt9t112.c
> @@ -24,12 +24,16 @@
>  #include <linux/slab.h>
>  #include <linux/v4l2-mediabus.h>
>  #include <linux/videodev2.h>
> +#include <linux/regulator/consumer.h>
>  
>  #include <media/mt9t112.h>
> +#include <media/mt9t111.h>
>  #include <media/soc_camera.h>
>  #include <media/v4l2-chip-ident.h>
>  #include <media/v4l2-common.h>
>  
> +#include "mt9t111_reg.h"
> +
>  /* you can check PLL/clock info */
>  /* #define EXT_CLOCK 24000000 */
>  
> @@ -88,11 +92,15 @@ struct mt9t112_format {
>  struct mt9t112_priv {
>  	struct v4l2_subdev		 subdev;
>  	struct mt9t112_camera_info	*info;
> +	struct media_pad		pad;

I have also extended mt9t112 locally to work with the pad-level API. These 
patches have not been published yet, I could try to do that tomorrow. 
Maybe you could use that as a basis.

>  	struct i2c_client		*client;
>  	struct v4l2_rect		 frame;
>  	const struct mt9t112_format	*format;
> +	struct v4l2_mbus_framefmt	fmt;
>  	int				 model;
>  	u32				 flags;
> +	struct regulator		*omap3evm_1v8;
> +	struct regulator		*omap3evm_2v8;

you _certainly_ do not want anything board-specific in generic drivers. 
omap3evm has nothing to do here. Further, we shall not break soc-camera 
functionality. And soc-camera already handles regulators. We should 
discuss this with others and maybe move this somewhere to a more readily 
accessible location. Alternatively we could consider a way to call those 
functions from outside at least for the initial port to try things out.

>  /* for flags */
>  #define INIT_DONE	(1 << 0)
>  #define PCLK_RISING	(1 << 1)
> @@ -206,6 +214,33 @@ static int __mt9t112_reg_write(const struct i2c_client *client,
>  	return ret;
>  }
>  
> +static int mt9t111_write_regs(struct i2c_client *client,
> +				mt9t111_regs *reg_in, int cnt)

We don't want to mix namespaces. Functions and types, that are not 
strictly mt9t111-specific, should continue to use the mt9t112 namespace. 
But this we have to carefully consider, whether we need it at all - 
mt9t112 doesn't need any bulk register writing, and that is also the 
common case for Aptina sensors, AFAIK, we don't want to change it...

> +{
> +	int err = 0, i;
> +	mt9t111_regs *reg = reg_in;
> +
> +	for (i = 0; i < cnt; i++) {
> +		if (reg->delay_time == 0) {
> +			mt9t112_reg_write(err, client, reg->addr, reg->data);
> +		} else if (reg->addr != 0 || reg->data != 0) {
> +			mt9t112_reg_write(err, client, reg->addr, reg->data);
> +			mdelay(reg->delay_time);
> +		} else {
> +			mdelay(reg->delay_time);
> +		}
> +		if (err < 0) {
> +			dev_warn(&client->dev, "write reg error, addr = 0x%x,"
> +					"data = 0x%x\n",
> +					reg->addr, reg->data);
> +			return err;
> +		}
> +		reg++;
> +	}
> +
> +	return err;
> +}
> +
>  static int __mt9t112_reg_mask_set(const struct i2c_client *client,
>  				  u16  command,
>  				  u16  mask,
> @@ -733,6 +768,82 @@ static int mt9t112_init_camera(const struct i2c_client *client)
>  	return ret;
>  }
>  
> +static int mt9t111_configure(struct v4l2_subdev *subdev)
> +{
> +	int i, ret = 0;
> +	unsigned short value;
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +
> +	mt9t112_reg_write(ret, client, 0x001A, 0x001D);
> +	if (ret)
> +		goto out;
> +
> +	msleep(1);
> +
> +	mt9t112_reg_write(ret, client, 0x001A, 0x0018);
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, pll_regs1,
> +			sizeof(pll_regs1) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	for (i = 0; i < 100; i++) {
> +		mt9t112_reg_read(value, client, 0x0014);
> +		if ((value & 0x8000) != 0)
> +			break;
> +		mdelay(2);
> +	}
> +
> +	ret = mt9t111_write_regs(client, pll_regs2,
> +			sizeof(pll_regs2) / sizeof(mt9t111_regs));

I really would prefer to avoid all these...

> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, def_regs1,
> +			sizeof(def_regs1) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, patch_rev6,
> +			sizeof(patch_rev6) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, def_regs2,
> +			sizeof(def_regs2) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	/* MCU_ADDRESS [SEQ_CMD] -- refresh mode */
> +	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +	if (ret)
> +		goto out;
> +	mt9t112_reg_write(ret, client, 0x0990, 0x0006);
> +	if (ret)
> +		goto out;
> +
> +	/* refresh command */
> +	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +	if (ret)
> +		goto out;
> +	mt9t112_reg_write(ret, client, 0x0990, 0x0005);
> +	if (ret)
> +		goto out;
> +	for (i = 0; i < 100; i++) {
> +		mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +		if (ret)
> +			break;
> +		mt9t112_reg_read(value , client, 0x0990);
> +		if (value == 0)
> +			break;
> +		mdelay(5);
> +	}
> +out:
> +	return ret;
> +}
> +
>  /************************************************************************
>  			v4l2_subdev_core_ops
>  ************************************************************************/
> @@ -775,15 +886,72 @@ static int mt9t112_s_register(struct v4l2_subdev *sd,
>  }
>  #endif
>  
> +static int omap3evm_regulator_ctrl(struct mt9t112_priv *priv, u32 on)

As I said, we have to find a way to consolidate this with soc-camera PM.

> +{
> +	if (!(priv->omap3evm_1v8) || !(priv->omap3evm_2v8)) {
> +		printk(KERN_ERR "No regulator available\n");
> +		return -ENODEV;
> +	}
> +	if (on) {
> +		regulator_enable(priv->omap3evm_1v8);
> +		mdelay(1);
> +		regulator_enable(priv->omap3evm_2v8);
> +		mdelay(50);
> +	} else {
> +		if (regulator_is_enabled(priv->omap3evm_1v8))
> +			regulator_disable(priv->omap3evm_1v8);
> +		if (regulator_is_enabled(priv->omap3evm_2v8))
> +			regulator_disable(priv->omap3evm_2v8);
> +	}
> +	return 0;
> +}
> +
> +static int mt9t111_s_power(struct v4l2_subdev *subdev, int on)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +	struct mt9t111_platform_data  *pdata;
> +	int rval;
> +
> +	pdata = (struct mt9t111_platform_data *) icl;
> +	if (on) {
> +		rval = omap3evm_regulator_ctrl(priv, on);
> +		if (rval)
> +			goto out;
> +
> +		rval = pdata->s_power(subdev, 1);
> +		if (rval)
> +			goto out;
> +
> +		rval = mt9t111_configure(subdev);
> +		if (rval) {
> +			pdata->s_power(subdev, 0);
> +			goto out;
> +	}
> +
> +	} else {
> +		rval = pdata->s_power(subdev, 0);
> +		if (rval)
> +			goto out;
> +	}
> +
> +out:
> +	if (rval)
> +		v4l_err(client, "Unable to set target power state\n");
> +
> +	return rval;
> +}
> +
>  static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
>  	.g_chip_ident	= mt9t112_g_chip_ident,
> +	.s_power	= mt9t111_s_power,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
> -	.g_register	= mt9t112_g_register,
> -	.s_register	= mt9t112_s_register,
> +	.g_register     = mt9t112_g_register,
> +	.s_register     = mt9t112_s_register,
>  #endif
>  };

Don't do this.

>  
> -
>  /************************************************************************
>  			v4l2_subdev_video_ops
>  ************************************************************************/
> @@ -793,51 +961,56 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable)
>  	struct mt9t112_priv *priv = to_mt9t112(client);
>  	int ret = 0;
>  
> -	if (!enable) {
> -		/* FIXME
> -		 *
> -		 * If user selected large output size,
> -		 * and used it long time,
> -		 * mt9t112 camera will be very warm.
> -		 *
> -		 * But current driver can not stop mt9t112 camera.
> -		 * So, set small size here to solve this problem.
> -		 */
> -		mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
> +	if (priv->model == V4L2_IDENT_MT9T111) {
>  		return ret;
> -	}
>  
> -	if (!(priv->flags & INIT_DONE)) {
> -		u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
> +	} else {

After a "return" you don't need an "else," which would leave the rest of 
the function intact.

> +		if (!enable) {
> +			/* FIXME
> +			 *
> +			 * If user selected large output size,
> +			 * and used it long time,
> +			 * mt9t112 camera will be very warm.
> +			 *
> +			 * But current driver can not stop mt9t112 camera.
> +			 * So, set small size here to solve this problem.
> +			 */
> +			mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
> +			return ret;
> +		}
>  
> -		ECHECKER(ret, mt9t112_init_camera(client));
> +		if (!(priv->flags & INIT_DONE)) {
> +			u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
>  
> -		/* Invert PCLK (Data sampled on falling edge of pixclk) */
> -		mt9t112_reg_write(ret, client, 0x3C20, param);
> +			ECHECKER(ret, mt9t112_init_camera(client));
>  
> -		mdelay(5);
> +			/* Invert PCLK (Data sampled on falling edge of pixclk) */
> +			mt9t112_reg_write(ret, client, 0x3C20, param);
>  
> -		priv->flags |= INIT_DONE;
> -	}
> +			mdelay(5);
>  
> -	mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
> -	mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
> -	mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
> +			priv->flags |= INIT_DONE;
> +		}
>  
> -	mt9t112_set_a_frame_size(client,
> -				 priv->frame.width,
> -				 priv->frame.height);
> +		mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
> +		mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
> +		mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
>  
> -	ECHECKER(ret, mt9t112_auto_focus_trigger(client));
> +		mt9t112_set_a_frame_size(client,
> +					priv->frame.width,
> +					priv->frame.height);
>  
> -	dev_dbg(&client->dev, "format : %d\n", priv->format->code);
> -	dev_dbg(&client->dev, "size   : %d x %d\n",
> -		priv->frame.width,
> -		priv->frame.height);
> +		ECHECKER(ret, mt9t112_auto_focus_trigger(client));
>  
> -	CLOCK_INFO(client, EXT_CLOCK);
> +		dev_dbg(&client->dev, "format : %d\n", priv->format->code);
> +		dev_dbg(&client->dev, "size   : %d x %d\n",
> +			priv->frame.width,
> +			priv->frame.height);
>  
> -	return ret;
> +		CLOCK_INFO(client, EXT_CLOCK);
> +
> +		return ret;
> +	}
>  }
>  
>  static int mt9t112_set_params(struct mt9t112_priv *priv,
> @@ -1019,11 +1192,60 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = {
>  };
>  
>  /************************************************************************
> +		v4l2_subdev_pad_ops
> +************************************************************************/
> +static int mt9t111_get_pad_format(struct v4l2_subdev *subdev,
> +		struct v4l2_subdev_fh *fh,
> +		struct v4l2_subdev_format *fmt)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +
> +	fmt->format = priv->fmt;
> +	return 0;
> +}
> +
> +static int mt9t111_set_pad_format(struct v4l2_subdev *subdev,
> +				struct v4l2_subdev_fh *fh,
> +				struct v4l2_subdev_format *fmt)
> +{
> +	int i;
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +
> +	for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) {
> +		if (fmt->format.code == mt9t112_cfmts[i].code)
> +			goto fmt_found;
> +	}
> +	if (i >= ARRAY_SIZE(mt9t112_cfmts))
> +		return -EINVAL;
> +
> +fmt_found:
> +	/*
> +	 * Only VGA resolution supported
> +	 */

We should re-use the driver functionality. BTW, I wasn't able to find an 
mt9t112 datasheet on the internet, but I did manage to find an mt9t111 
datasheet. Maybe you could find it too and use to get rid of all the 
register magic, and also to replace existing mt9t112 register addresses 
with symbolic names, at least where registers coincide.

> +	fmt->format.width = VGA_WIDTH;
> +	fmt->format.height = VGA_HEIGHT;
> +	fmt->format.field = V4L2_FIELD_NONE;
> +	fmt->format.colorspace = V4L2_COLORSPACE_JPEG;
> +
> +	priv->fmt = fmt->format;
> +
> +	return 0;
> +}
> +
> +static const struct v4l2_subdev_pad_ops mt9t111_pad_ops = {
> +	.get_fmt        = mt9t111_get_pad_format,
> +	.set_fmt        = mt9t111_set_pad_format,
> +};
> +
> +/************************************************************************
>  			i2c driver
>  ************************************************************************/
>  static struct v4l2_subdev_ops mt9t112_subdev_ops = {
>  	.core	= &mt9t112_subdev_core_ops,
>  	.video	= &mt9t112_subdev_video_ops,
> +	.pad    = &mt9t111_pad_ops,
>  };
>  
>  static int mt9t112_camera_probe(struct i2c_client *client)
> @@ -1089,6 +1311,32 @@ static int mt9t112_probe(struct i2c_client *client,
>  	/* Cannot fail: using the default supported pixel code */
>  	mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
>  
> +	if (priv->model == V4L2_IDENT_MT9T111) {
> +		priv->omap3evm_1v8 = regulator_get(NULL, "vio_1v8");
> +		if (IS_ERR(priv->omap3evm_1v8)) {
> +			printk(KERN_ERR "vio_1v8 regulator missing\n");
> +			ret =  PTR_ERR(priv->omap3evm_1v8);

Same - unify PM with soc-camera.

> +			goto err_1;
> +		}
> +		priv->omap3evm_2v8 = regulator_get(NULL, "cam_2v8");
> +		if (IS_ERR(priv->omap3evm_2v8)) {
> +			printk(KERN_ERR "cam_2v8 regulator missing\n");
> +			ret = PTR_ERR(priv->omap3evm_2v8);
> +			goto err_2;
> +		}
> +
> +		priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> +		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
> +		ret = media_entity_init(&priv->subdev.entity, 1, &priv->pad, 0);
> +		if (!ret)
> +			return 0;
> +		kfree(priv);
> +err_2:
> +		regulator_put(priv->omap3evm_2v8);
> +err_1:
> +		regulator_put(priv->omap3evm_1v8);
> +	}
> +
>  	return ret;
>  }
>  
> diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
> new file mode 100644
> index 0000000..372dc0d
> --- /dev/null
> +++ b/include/media/mt9t111.h
> @@ -0,0 +1,45 @@
> +/*
> + * include/media/mt9t111.h
> + *
> + * mt9t111 sensor driver
> + *
> + * Copyright (C) 2009 Leopard Imaging
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#ifndef	MT9T111_H
> +#define	MT9T111_H
> +
> +struct v4l2_subdev;
> +
> +/*
> + * Defines and Macros and globals
> + */
> +#define MT9T111_MODULE_NAME		"mt9t112"
> +
> +/*i2c adress for MT9T111*/
> +#define MT9T111_I2C_ADDR		(0x78 >> 1)
> +
> +#define MT9T111_CLK_MAX			(96000000) /* 96MHz */
> +#define MT9T111_CLK_MIN			(6000000)  /* 6Mhz */
> +
> +#define MT9T111_I2C_CONFIG		(1)
> +#define I2C_ONE_BYTE_TRANSFER		(1)
> +#define I2C_TWO_BYTE_TRANSFER		(2)
> +#define I2C_THREE_BYTE_TRANSFER		(3)
> +#define I2C_FOUR_BYTE_TRANSFER		(4)
> +#define I2C_TXRX_DATA_MASK		(0x00FF)
> +#define I2C_TXRX_DATA_MASK_UPPER	(0xFF00)
> +#define I2C_TXRX_DATA_SHIFT		(8)

I don't think you need parenthesis around simple numeric constants.

> +
> +struct mt9t111_platform_data {
> +	int (*s_power) (struct v4l2_subdev *subdev, u32 on);
> +	int (*set_xclk) (struct v4l2_subdev *subdev, u32 hz);
> +	int (*configure_interface) (struct v4l2_subdev *subdev, u32 pixclk);
> +};
> +
> +#endif	/* ifndef MT9T111 */
> +
> -- 
> 1.7.0.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver
@ 2011-09-27 23:30     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 25+ messages in thread
From: Guennadi Liakhovetski @ 2011-09-27 23:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Deepthy

(personally, I don't think this long CC list is justified, you might want 
to drop most of them on the next round, but it's up to you eventually)

Nice, that you managed to re-use the existing mt9t112 driver and extend it 
to work outside of soc-camera and with mt9t111 on omap3. See comments 
below.

On Tue, 27 Sep 2011, Deepthy Ravi wrote:

> Added support for mt9t111 sensor in the existing
> mt9t112 driver. Also added support for media controller
> framework. The sensor driver currently supports only
> VGA resolution.

I think we should support same resolutions on mt9t111 as what is supported 
on mt9t112.

> 
> Signed-off-by: Deepthy Ravi <deepthy.ravi@ti.com>
> ---
>  drivers/media/video/Kconfig       |    7 +
>  drivers/media/video/Makefile      |    1 +
>  drivers/media/video/mt9t111_reg.h | 1367 +++++++++++++++++++++++++++++++++++++
>  drivers/media/video/mt9t112.c     |  320 ++++++++-
>  include/media/mt9t111.h           |   45 ++
>  5 files changed, 1704 insertions(+), 36 deletions(-)
>  create mode 100644 drivers/media/video/mt9t111_reg.h
>  create mode 100644 include/media/mt9t111.h
> 
> diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
> index 14326d7..b5806e8 100644
> --- a/drivers/media/video/Kconfig
> +++ b/drivers/media/video/Kconfig
> @@ -482,6 +482,13 @@ config VIDEO_MT9V032
>  	  This is a Video4Linux2 sensor-level driver for the Micron
>  	  MT9V032 752x480 CMOS sensor.
>  
> +config VIDEO_MT9T111
> +	tristate "Aptina MT9T111 VGA CMOS IMAGE SENSOR"
> +	depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
> +	---help---
> +	 This is a Video4Linux2 sensor-level driver for the Aptina MT9T111
> +	 image sensor.
> +

This is not needed, just add a note to the MT9T112 entry saying, that 
mt9t111 is supported too, and remove dependency on soc-camera, add 
VIDEO_V4L2 instead. VIDEO_V4L2_SUBDEV_API shouldn't be required.

>  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 c06f515..02a8b70 100644
> --- a/drivers/media/video/Makefile
> +++ b/drivers/media/video/Makefile
> @@ -68,6 +68,7 @@ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
>  obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
>  obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
>  obj-$(CONFIG_VIDEO_SR030PC30)	+= sr030pc30.o
> +obj-$(CONFIG_VIDEO_MT9T111) += mt9t112.o

unneeded

>  obj-$(CONFIG_VIDEO_NOON010PC30)	+= noon010pc30.o
>  obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
>  obj-$(CONFIG_VIDEO_ADP1653)	+= adp1653.o
> diff --git a/drivers/media/video/mt9t111_reg.h b/drivers/media/video/mt9t111_reg.h
> new file mode 100644
> index 0000000..2f610d4
> --- /dev/null
> +++ b/drivers/media/video/mt9t111_reg.h
> @@ -0,0 +1,1367 @@
> +/*
> + * drivers/media/video/mt9t111_reg.h
> + *
> + * mt9t111 sensor driver header file
> + *
> + * Copyright (C) 2009 Leopard Imaging
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#ifndef MT9T111_REG_H
> +#define MT9T111_REG_H
> +
> +/* register addr */
> +#define MT9T111_CHIP_ID		(0x0000)
> +
> +/* register value */
> +#define MT9T111_CHIP_ID_VALUE	(0x2680)
> +
> +#define MT9T111_IMAGE_WIDTH		(640)
> +#define MT9T111_IMAGE_HEIGHT		(480)

A general note. We assume, that mt9t112 and mt9t111 are _very_ similar and 
can be supported by one driver with maybe some _minor_ chip-specific 
differences. What you seem to be doing is combine two drivers in one. 
Practically duplicating most functionality. If the chips are indeed that 
different, we need two drivers. Otherwise you really only should need some 
_small_ additions to mt9t112.

> +
> +typedef struct {
> +	u16 delay_time;
> +	u16 addr;
> +	u16 data;
> +} mt9t111_regs;
> +
> +mt9t111_regs patch_rev6[] = {
> +	{0, 0x0982, 0x0},

mt9t112 doesn't need any such register magic. If they are similar, we 
shouldn't have to add them for mt9t111 either.

> +	{0, 0x098A, 0xCE7},
> +	{0, 0x0990, 0x3C3C},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0x3C5F},
> +	{0, 0x0996, 0x4F30},
> +	{0, 0x0998, 0xED08},
> +	{0, 0x099a, 0xBD61},
> +	{0, 0x099c, 0xD5CE},
> +	{0, 0x099e, 0x4CD},
> +	{0, 0x098A, 0xCF7},
> +	{0, 0x0990, 0x1F17},
> +	{0, 0x0992, 0x211},
> +	{0, 0x0994, 0xCC33},
> +	{0, 0x0996, 0x2E30},
> +	{0, 0x0998, 0xED02},
> +	{0, 0x099a, 0xCCFF},
> +	{0, 0x099c, 0xFDED},
> +	{0, 0x099e, 0xCC},
> +	{0, 0x098A, 0xD07},
> +	{0, 0x0990, 0x2},
> +	{0, 0x0992, 0xBD70},
> +	{0, 0x0994, 0x6D18},
> +	{0, 0x0996, 0xDE1F},
> +	{0, 0x0998, 0x181F},
> +	{0, 0x099a, 0x8E01},
> +	{0, 0x099c, 0x10CC},
> +	{0, 0x099e, 0x3C52},
> +	{0, 0x098A, 0xD17},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x18},
> +	{0, 0x0994, 0xECA0},
> +	{0, 0x0996, 0xC4FD},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x2120},
> +	{0, 0x099c, 0x1ECC},
> +	{0, 0x099e, 0x3C52},
> +	{0, 0x098A, 0xD27},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0xDE},
> +	{0, 0x0994, 0x1FEC},
> +	{0, 0x0996, 0xA0BD},
> +	{0, 0x0998, 0x7021},
> +	{0, 0x099a, 0xCC3C},
> +	{0, 0x099c, 0x5230},
> +	{0, 0x099e, 0xED02},
> +	{0, 0x098A, 0xD37},
> +	{0, 0x0990, 0xCCFF},
> +	{0, 0x0992, 0xFCED},
> +	{0, 0x0994, 0xCC},
> +	{0, 0x0996, 0x2},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x6DFC},
> +	{0, 0x099c, 0x4E1},
> +	{0, 0x099e, 0x1A83},
> +	{0, 0x098A, 0xD47},
> +	{0, 0x0990, 0x1},
> +	{0, 0x0992, 0x2720},
> +	{0, 0x0994, 0x1A83},
> +	{0, 0x0996, 0x4},
> +	{0, 0x0998, 0x271E},
> +	{0, 0x099a, 0x1A83},
> +	{0, 0x099c, 0x8},
> +	{0, 0x099e, 0x271C},
> +	{0, 0x098A, 0xD57},
> +	{0, 0x0990, 0x1A83},
> +	{0, 0x0992, 0x10},
> +	{0, 0x0994, 0x271A},
> +	{0, 0x0996, 0x1A83},
> +	{0, 0x0998, 0x20},
> +	{0, 0x099a, 0x2718},
> +	{0, 0x099c, 0x1A83},
> +	{0, 0x099e, 0x40},
> +	{0, 0x098A, 0xD67},
> +	{0, 0x0990, 0x2716},
> +	{0, 0x0992, 0x2019},
> +	{0, 0x0994, 0xC61E},
> +	{0, 0x0996, 0x2012},
> +	{0, 0x0998, 0xC622},
> +	{0, 0x099a, 0x200E},
> +	{0, 0x099c, 0xC621},
> +	{0, 0x099e, 0x200A},
> +	{0, 0x098A, 0xD77},
> +	{0, 0x0990, 0xC620},
> +	{0, 0x0992, 0x2006},
> +	{0, 0x0994, 0xC62A},
> +	{0, 0x0996, 0x2002},
> +	{0, 0x0998, 0xC62B},
> +	{0, 0x099a, 0x30ED},
> +	{0, 0x099c, 0x8CC},
> +	{0, 0x099e, 0x3400},
> +	{0, 0x098A, 0xD87},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x34},
> +	{0, 0x0994, 0xBD6F},
> +	{0, 0x0996, 0xD184},
> +	{0, 0x0998, 0x330},
> +	{0, 0x099a, 0xED07},
> +	{0, 0x099c, 0xA60A},
> +	{0, 0x099e, 0x4848},
> +	{0, 0x098A, 0xD97},
> +	{0, 0x0990, 0x5FED},
> +	{0, 0x0992, 0x5EA},
> +	{0, 0x0994, 0x8AA},
> +	{0, 0x0996, 0x731},
> +	{0, 0x0998, 0xBD70},
> +	{0, 0x099a, 0x2130},
> +	{0, 0x099c, 0xC60A},
> +	{0, 0x099e, 0x3A35},
> +	{0, 0x098A, 0xDA7},
> +	{0, 0x0990, 0x3937},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0x3C34},
> +	{0, 0x0996, 0xDE2F},
> +	{0, 0x0998, 0xEE0E},
> +	{0, 0x099a, 0xAD00},
> +	{0, 0x099c, 0x7D13},
> +	{0, 0x099e, 0xEF27},
> +	{0, 0x098A, 0xDB7},
> +	{0, 0x0990, 0x7CCE},
> +	{0, 0x0992, 0x13E0},
> +	{0, 0x0994, 0x1E05},
> +	{0, 0x0996, 0x1060},
> +	{0, 0x0998, 0xE60E},
> +	{0, 0x099a, 0x4FC3},
> +	{0, 0x099c, 0x13F0},
> +	{0, 0x099e, 0x8FE6},
> +	{0, 0x098A, 0xDC7},
> +	{0, 0x0990, 0x30},
> +	{0, 0x0992, 0xE107},
> +	{0, 0x0994, 0x2216},
> +	{0, 0x0996, 0xF613},
> +	{0, 0x0998, 0xEE4F},
> +	{0, 0x099a, 0xC313},
> +	{0, 0x099c, 0xF38F},
> +	{0, 0x099e, 0xE600},
> +	{0, 0x098A, 0xDD7},
> +	{0, 0x0990, 0x30E1},
> +	{0, 0x0992, 0x725},
> +	{0, 0x0994, 0x7F6},
> +	{0, 0x0996, 0x13EE},
> +	{0, 0x0998, 0xC103},
> +	{0, 0x099a, 0x253C},
> +	{0, 0x099c, 0x7F13},
> +	{0, 0x099e, 0xEEF6},
> +	{0, 0x098A, 0xDE7},
> +	{0, 0x0990, 0x13EF},
> +	{0, 0x0992, 0xE706},
> +	{0, 0x0994, 0xCC13},
> +	{0, 0x0996, 0xF0ED},
> +	{0, 0x0998, 0x4CC},
> +	{0, 0x099a, 0x13F3},
> +	{0, 0x099c, 0x200F},
> +	{0, 0x099e, 0x7C13},
> +	{0, 0x098A, 0xDF7},
> +	{0, 0x0990, 0xEEEC},
> +	{0, 0x0992, 0x4C3},
> +	{0, 0x0994, 0x1},
> +	{0, 0x0996, 0xED04},
> +	{0, 0x0998, 0xEC02},
> +	{0, 0x099a, 0xC300},
> +	{0, 0x099c, 0x1ED},
> +	{0, 0x099e, 0x2F6},
> +	{0, 0x098A, 0xE07},
> +	{0, 0x0990, 0x13EE},
> +	{0, 0x0992, 0xE106},
> +	{0, 0x0994, 0x2412},
> +	{0, 0x0996, 0xEE04},
> +	{0, 0x0998, 0xE600},
> +	{0, 0x099a, 0x30E1},
> +	{0, 0x099c, 0x722},
> +	{0, 0x099e, 0xDFEE},
> +	{0, 0x098A, 0xE17},
> +	{0, 0x0990, 0x2E6},
> +	{0, 0x0992, 0x30},
> +	{0, 0x0994, 0xE107},
> +	{0, 0x0996, 0x25D6},
> +	{0, 0x0998, 0xDE49},
> +	{0, 0x099a, 0xEE08},
> +	{0, 0x099c, 0xAD00},
> +	{0, 0x099e, 0xCC13},
> +	{0, 0x098A, 0xE27},
> +	{0, 0x0990, 0xF630},
> +	{0, 0x0992, 0xED00},
> +	{0, 0x0994, 0xDE2F},
> +	{0, 0x0996, 0xEE10},
> +	{0, 0x0998, 0xCC13},
> +	{0, 0x099a, 0xFAAD},
> +	{0, 0x099c, 0x38},
> +	{0, 0x099e, 0x3838},
> +	{0, 0x098A, 0xE37},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x098A, 0x1000},
> +	{0, 0x0990, 0xCC10},
> +	{0, 0x0992, 0x9BD},
> +	{0, 0x0994, 0x4224},
> +	{0, 0x0996, 0x7E10},
> +	{0, 0x0998, 0x9C6},
> +	{0, 0x099a, 0x1F7},
> +	{0, 0x099c, 0x18A},
> +	{0, 0x099e, 0xC606},
> +	{0, 0x098A, 0x1010},
> +	{0, 0x0990, 0xF701},
> +	{0, 0x0992, 0x8BDE},
> +	{0, 0x0994, 0x3F18},
> +	{0, 0x0996, 0xCE0B},
> +	{0, 0x0998, 0xF1CC},
> +	{0, 0x099a, 0x11},
> +	{0, 0x099c, 0xBDD7},
> +	{0, 0x099e, 0xCC},
> +	{0, 0x098A, 0x1020},
> +	{0, 0x0990, 0xBF1},
> +	{0, 0x0992, 0xDD3F},
> +	{0, 0x0994, 0xDE35},
> +	{0, 0x0996, 0x18CE},
> +	{0, 0x0998, 0xC03},
> +	{0, 0x099a, 0xCC00},
> +	{0, 0x099c, 0x3FBD},
> +	{0, 0x099e, 0xD700},
> +	{0, 0x098A, 0x1030},
> +	{0, 0x0990, 0xCC0C},
> +	{0, 0x0992, 0x3DD},
> +	{0, 0x0994, 0x35DE},
> +	{0, 0x0996, 0x4718},
> +	{0, 0x0998, 0xCE0C},
> +	{0, 0x099a, 0x43CC},
> +	{0, 0x099c, 0x15},
> +	{0, 0x099e, 0xBDD7},
> +	{0, 0x098A, 0x1040},
> +	{0, 0x0990, 0xCC},
> +	{0, 0x0992, 0xC43},
> +	{0, 0x0994, 0xDD47},
> +	{0, 0x0996, 0xFE00},
> +	{0, 0x0998, 0x3318},
> +	{0, 0x099a, 0xCE0C},
> +	{0, 0x099c, 0x59CC},
> +	{0, 0x099e, 0x9},
> +	{0, 0x098A, 0x1050},
> +	{0, 0x0990, 0xBDD7},
> +	{0, 0x0992, 0xCC},
> +	{0, 0x0994, 0xC59},
> +	{0, 0x0996, 0xFD00},
> +	{0, 0x0998, 0x33DE},
> +	{0, 0x099a, 0x4118},
> +	{0, 0x099c, 0xCE0C},
> +	{0, 0x099e, 0x63CC},
> +	{0, 0x098A, 0x1060},
> +	{0, 0x0990, 0xD},
> +	{0, 0x0992, 0xBDD7},
> +	{0, 0x0994, 0xCC},
> +	{0, 0x0996, 0xC63},
> +	{0, 0x0998, 0xDD41},
> +	{0, 0x099a, 0xFE00},
> +	{0, 0x099c, 0x3118},
> +	{0, 0x099e, 0xCE0C},
> +	{0, 0x098A, 0x1070},
> +	{0, 0x0990, 0x71CC},
> +	{0, 0x0992, 0x29},
> +	{0, 0x0994, 0xBDD7},
> +	{0, 0x0996, 0xCC},
> +	{0, 0x0998, 0xC71},
> +	{0, 0x099a, 0xFD00},
> +	{0, 0x099c, 0x31DE},
> +	{0, 0x099e, 0x3918},
> +	{0, 0x098A, 0x1080},
> +	{0, 0x0990, 0xCE0C},
> +	{0, 0x0992, 0x9BCC},
> +	{0, 0x0994, 0x23},
> +	{0, 0x0996, 0xBDD7},
> +	{0, 0x0998, 0xCC},
> +	{0, 0x099a, 0xC9B},
> +	{0, 0x099c, 0xDD39},
> +	{0, 0x099e, 0xDE49},
> +	{0, 0x098A, 0x1090},
> +	{0, 0x0990, 0x18CE},
> +	{0, 0x0992, 0xCBF},
> +	{0, 0x0994, 0xCC00},
> +	{0, 0x0996, 0xDBD},
> +	{0, 0x0998, 0xD700},
> +	{0, 0x099a, 0xCC0C},
> +	{0, 0x099c, 0xBFDD},
> +	{0, 0x099e, 0x49CC},
> +	{0, 0x098A, 0x10A0},
> +	{0, 0x0990, 0x1162},
> +	{0, 0x0992, 0xFD0B},
> +	{0, 0x0994, 0xFDCC},
> +	{0, 0x0996, 0xCE7},
> +	{0, 0x0998, 0xFD0C},
> +	{0, 0x099a, 0x1FCC},
> +	{0, 0x099c, 0x1245},
> +	{0, 0x099e, 0xFD0C},
> +	{0, 0x098A, 0x10B0},
> +	{0, 0x0990, 0x51CC},
> +	{0, 0x0992, 0x110B},
> +	{0, 0x0994, 0xFD0C},
> +	{0, 0x0996, 0x5BCC},
> +	{0, 0x0998, 0x1108},
> +	{0, 0x099a, 0xFD0C},
> +	{0, 0x099c, 0x65CC},
> +	{0, 0x099e, 0x10D0},
> +	{0, 0x098A, 0x10C0},
> +	{0, 0x0990, 0xFD0C},
> +	{0, 0x0992, 0x7BCC},
> +	{0, 0x0994, 0x12DE},
> +	{0, 0x0996, 0xFD0C},
> +	{0, 0x0998, 0xA7CC},
> +	{0, 0x099a, 0xDA8},
> +	{0, 0x099c, 0xFD0C},
> +	{0, 0x099e, 0xCB39},
> +	{0, 0x098A, 0x10D0},
> +	{0, 0x0990, 0x37DE},
> +	{0, 0x0992, 0x1DEC},
> +	{0, 0x0994, 0xC5F},
> +	{0, 0x0996, 0x8402},
> +	{0, 0x0998, 0x4416},
> +	{0, 0x099a, 0x4FF7},
> +	{0, 0x099c, 0xCCD},
> +	{0, 0x099e, 0xE60B},
> +	{0, 0x098A, 0x10E0},
> +	{0, 0x0990, 0xC407},
> +	{0, 0x0992, 0xF70C},
> +	{0, 0x0994, 0xCE7F},
> +	{0, 0x0996, 0x30C4},
> +	{0, 0x0998, 0xEC25},
> +	{0, 0x099a, 0xFD30},
> +	{0, 0x099c, 0xC5FC},
> +	{0, 0x099e, 0x6D6},
> +	{0, 0x098A, 0x10F0},
> +	{0, 0x0990, 0xFD30},
> +	{0, 0x0992, 0xC701},
> +	{0, 0x0994, 0xFC30},
> +	{0, 0x0996, 0xC0FD},
> +	{0, 0x0998, 0xBED},
> +	{0, 0x099a, 0xFC30},
> +	{0, 0x099c, 0xC2FD},
> +	{0, 0x099e, 0xBEF},
> +	{0, 0x098A, 0x1100},
> +	{0, 0x0990, 0x30E6},
> +	{0, 0x0992, 0xBD},
> +	{0, 0x0994, 0x5203},
> +	{0, 0x0996, 0x3139},
> +	{0, 0x0998, 0x7E9E},
> +	{0, 0x099a, 0x143C},
> +	{0, 0x099c, 0x3C3C},
> +	{0, 0x099e, 0x2101},
> +	{0, 0x098A, 0x1110},
> +	{0, 0x0990, 0xCC00},
> +	{0, 0x0992, 0x18BD},
> +	{0, 0x0994, 0x6FD1},
> +	{0, 0x0996, 0xC504},
> +	{0, 0x0998, 0x26F5},
> +	{0, 0x099a, 0xDC25},
> +	{0, 0x099c, 0x30ED},
> +	{0, 0x099e, 0x420},
> +	{0, 0x098A, 0x1120},
> +	{0, 0x0990, 0x12EE},
> +	{0, 0x0992, 0x43C},
> +	{0, 0x0994, 0x1838},
> +	{0, 0x0996, 0xE621},
> +	{0, 0x0998, 0x18E7},
> +	{0, 0x099a, 0xBE30},
> +	{0, 0x099c, 0xEE04},
> +	{0, 0x099e, 0xEC1D},
> +	{0, 0x098A, 0x1130},
> +	{0, 0x0990, 0x30ED},
> +	{0, 0x0992, 0x4EC},
> +	{0, 0x0994, 0x426},
> +	{0, 0x0996, 0xEACC},
> +	{0, 0x0998, 0x1A},
> +	{0, 0x099a, 0xED02},
> +	{0, 0x099c, 0xCCFB},
> +	{0, 0x099e, 0xFFED},
> +	{0, 0x098A, 0x1140},
> +	{0, 0x0990, 0xCC},
> +	{0, 0x0992, 0x400},
> +	{0, 0x0994, 0xBD70},
> +	{0, 0x0996, 0x6DCC},
> +	{0, 0x0998, 0x1A},
> +	{0, 0x099a, 0x30ED},
> +	{0, 0x099c, 0x2CC},
> +	{0, 0x099e, 0xFBFF},
> +	{0, 0x098A, 0x1150},
> +	{0, 0x0990, 0xED00},
> +	{0, 0x0992, 0x5F4F},
> +	{0, 0x0994, 0xBD70},
> +	{0, 0x0996, 0x6D5F},
> +	{0, 0x0998, 0xBD5B},
> +	{0, 0x099a, 0x17BD},
> +	{0, 0x099c, 0x558B},
> +	{0, 0x099e, 0x3838},
> +	{0, 0x098A, 0x1160},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x0992, 0x3C3C},
> +	{0, 0x0994, 0xC640},
> +	{0, 0x0996, 0xF730},
> +	{0, 0x0998, 0xC4FC},
> +	{0, 0x099a, 0xBED},
> +	{0, 0x099c, 0xFD30},
> +	{0, 0x099e, 0xC0FC},
> +	{0, 0x098A, 0x1170},
> +	{0, 0x0990, 0xBEF},
> +	{0, 0x0992, 0xFD30},
> +	{0, 0x0994, 0xC2DE},
> +	{0, 0x0996, 0x1DEC},
> +	{0, 0x0998, 0x25FD},
> +	{0, 0x099a, 0x30C5},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0x1FC},
> +	{0, 0x098A, 0x1180},
> +	{0, 0x0990, 0x30C2},
> +	{0, 0x0992, 0xFD06},
> +	{0, 0x0994, 0xD6EC},
> +	{0, 0x0996, 0xC5F},
> +	{0, 0x0998, 0x8402},
> +	{0, 0x099a, 0x4416},
> +	{0, 0x099c, 0x4F30},
> +	{0, 0x099e, 0xE703},
> +	{0, 0x098A, 0x1190},
> +	{0, 0x0990, 0xF10C},
> +	{0, 0x0992, 0xCD27},
> +	{0, 0x0994, 0x15F1},
> +	{0, 0x0996, 0xCCD},
> +	{0, 0x0998, 0x2309},
> +	{0, 0x099a, 0xFC06},
> +	{0, 0x099c, 0xD604},
> +	{0, 0x099e, 0xFD06},
> +	{0, 0x098A, 0x11A0},
> +	{0, 0x0990, 0xD620},
> +	{0, 0x0992, 0x7FC},
> +	{0, 0x0994, 0x6D6},
> +	{0, 0x0996, 0x5FD},
> +	{0, 0x0998, 0x6D6},
> +	{0, 0x099a, 0xDE1D},
> +	{0, 0x099c, 0xE60B},
> +	{0, 0x099e, 0xC407},
> +	{0, 0x098A, 0x11B0},
> +	{0, 0x0990, 0x30E7},
> +	{0, 0x0992, 0x2F1},
> +	{0, 0x0994, 0xCCE},
> +	{0, 0x0996, 0x272C},
> +	{0, 0x0998, 0x7D0C},
> +	{0, 0x099a, 0xCE27},
> +	{0, 0x099c, 0x275D},
> +	{0, 0x099e, 0x2724},
> +	{0, 0x098A, 0x11C0},
> +	{0, 0x0990, 0x7F30},
> +	{0, 0x0992, 0xC4FC},
> +	{0, 0x0994, 0x6D6},
> +	{0, 0x0996, 0xFD30},
> +	{0, 0x0998, 0xC5F6},
> +	{0, 0x099a, 0xCCE},
> +	{0, 0x099c, 0x4FFD},
> +	{0, 0x099e, 0x30C7},
> +	{0, 0x098A, 0x11D0},
> +	{0, 0x0990, 0xC640},
> +	{0, 0x0992, 0xF730},
> +	{0, 0x0994, 0xC4E6},
> +	{0, 0x0996, 0x24F},
> +	{0, 0x0998, 0xFD30},
> +	{0, 0x099a, 0xC501},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0xFC30},
> +	{0, 0x098A, 0x11E0},
> +	{0, 0x0990, 0xC2FD},
> +	{0, 0x0992, 0x6D6},
> +	{0, 0x0994, 0x7D06},
> +	{0, 0x0996, 0xCB27},
> +	{0, 0x0998, 0x2EC6},
> +	{0, 0x099a, 0x40F7},
> +	{0, 0x099c, 0x30C4},
> +	{0, 0x099e, 0xFC06},
> +	{0, 0x098A, 0x11F0},
> +	{0, 0x0990, 0xC104},
> +	{0, 0x0992, 0xF306},
> +	{0, 0x0994, 0xD6ED},
> +	{0, 0x0996, 0x5F},
> +	{0, 0x0998, 0x6D00},
> +	{0, 0x099a, 0x2A01},
> +	{0, 0x099c, 0x5317},
> +	{0, 0x099e, 0xFD30},
> +	{0, 0x098A, 0x1200},
> +	{0, 0x0990, 0xC0EC},
> +	{0, 0x0992, 0xFD},
> +	{0, 0x0994, 0x30C2},
> +	{0, 0x0996, 0xFC06},
> +	{0, 0x0998, 0xC1FD},
> +	{0, 0x099a, 0x30C5},
> +	{0, 0x099c, 0x101},
> +	{0, 0x099e, 0x1FC},
> +	{0, 0x098A, 0x1210},
> +	{0, 0x0990, 0x30C2},
> +	{0, 0x0992, 0xFD06},
> +	{0, 0x0994, 0xC720},
> +	{0, 0x0996, 0x227F},
> +	{0, 0x0998, 0x30C4},
> +	{0, 0x099a, 0xDE1D},
> +	{0, 0x099c, 0xEC25},
> +	{0, 0x099e, 0xFD30},
> +	{0, 0x098A, 0x1220},
> +	{0, 0x0990, 0xC5FC},
> +	{0, 0x0992, 0x6D6},
> +	{0, 0x0994, 0xFD30},
> +	{0, 0x0996, 0xC701},
> +	{0, 0x0998, 0xFC30},
> +	{0, 0x099a, 0xC0FD},
> +	{0, 0x099c, 0x6D0},
> +	{0, 0x099e, 0xFC30},
> +	{0, 0x098A, 0x1230},
> +	{0, 0x0990, 0xC2FD},
> +	{0, 0x0992, 0x6D2},
> +	{0, 0x0994, 0xEC25},
> +	{0, 0x0996, 0xFD06},
> +	{0, 0x0998, 0xC3BD},
> +	{0, 0x099a, 0x953C},
> +	{0, 0x099c, 0xDE3F},
> +	{0, 0x099e, 0xEE10},
> +	{0, 0x098A, 0x1240},
> +	{0, 0x0990, 0xAD00},
> +	{0, 0x0992, 0x3838},
> +	{0, 0x0994, 0x3930},
> +	{0, 0x0996, 0x8FC3},
> +	{0, 0x0998, 0xFFE9},
> +	{0, 0x099a, 0x8F35},
> +	{0, 0x099c, 0xBDAD},
> +	{0, 0x099e, 0x1530},
> +	{0, 0x098A, 0x1250},
> +	{0, 0x0990, 0x6F16},
> +	{0, 0x0992, 0x18DE},
> +	{0, 0x0994, 0x1918},
> +	{0, 0x0996, 0x8FC3},
> +	{0, 0x0998, 0x14B},
> +	{0, 0x099a, 0x188F},
> +	{0, 0x099c, 0x18EC},
> +	{0, 0x099e, 0xFD},
> +	{0, 0x098A, 0x1260},
> +	{0, 0x0990, 0x50E},
> +	{0, 0x0992, 0x18EC},
> +	{0, 0x0994, 0x2FD},
> +	{0, 0x0996, 0x510},
> +	{0, 0x0998, 0xE616},
> +	{0, 0x099a, 0x4FED},
> +	{0, 0x099c, 0x418},
> +	{0, 0x099e, 0x8FC3},
> +	{0, 0x098A, 0x1270},
> +	{0, 0x0990, 0xFFCB},
> +	{0, 0x0992, 0xE304},
> +	{0, 0x0994, 0x8FE6},
> +	{0, 0x0996, 0xF7},
> +	{0, 0x0998, 0x514},
> +	{0, 0x099a, 0x18DE},
> +	{0, 0x099c, 0x1930},
> +	{0, 0x099e, 0xE616},
> +	{0, 0x098A, 0x1280},
> +	{0, 0x0990, 0x4FED},
> +	{0, 0x0992, 0x418},
> +	{0, 0x0994, 0x8FC3},
> +	{0, 0x0996, 0x119},
> +	{0, 0x0998, 0xE304},
> +	{0, 0x099a, 0x8FE6},
> +	{0, 0x099c, 0xF7},
> +	{0, 0x099e, 0x515},
> +	{0, 0x098A, 0x1290},
> +	{0, 0x0990, 0xFC05},
> +	{0, 0x0992, 0x5BFD},
> +	{0, 0x0994, 0x512},
> +	{0, 0x0996, 0xDE37},
> +	{0, 0x0998, 0xEE08},
> +	{0, 0x099a, 0xAD00},
> +	{0, 0x099c, 0x30E6},
> +	{0, 0x099e, 0x164F},
> +	{0, 0x098A, 0x12A0},
> +	{0, 0x0990, 0x5ED},
> +	{0, 0x0992, 0x48F},
> +	{0, 0x0994, 0xC300},
> +	{0, 0x0996, 0x630},
> +	{0, 0x0998, 0xE304},
> +	{0, 0x099a, 0x8FF6},
> +	{0, 0x099c, 0x516},
> +	{0, 0x099e, 0x4FED},
> +	{0, 0x098A, 0x12B0},
> +	{0, 0x0990, 0x30},
> +	{0, 0x0992, 0x6C16},
> +	{0, 0x0994, 0xE616},
> +	{0, 0x0996, 0xC103},
> +	{0, 0x0998, 0x2598},
> +	{0, 0x099a, 0xCC32},
> +	{0, 0x099c, 0x8EED},
> +	{0, 0x099e, 0xEC},
> +	{0, 0x098A, 0x12C0},
> +	{0, 0x0990, 0x6BD},
> +	{0, 0x0992, 0x7021},
> +	{0, 0x0994, 0xCC32},
> +	{0, 0x0996, 0x6C30},
> +	{0, 0x0998, 0xED02},
> +	{0, 0x099a, 0xCCF8},
> +	{0, 0x099c, 0xED},
> +	{0, 0x099e, 0xA6},
> +	{0, 0x098A, 0x12D0},
> +	{0, 0x0990, 0x9E3},
> +	{0, 0x0992, 0xA84},
> +	{0, 0x0994, 0x7BD},
> +	{0, 0x0996, 0x706D},
> +	{0, 0x0998, 0x30C6},
> +	{0, 0x099a, 0x173A},
> +	{0, 0x099c, 0x3539},
> +	{0, 0x099e, 0x3CBD},
> +	{0, 0x098A, 0x12E0},
> +	{0, 0x0990, 0x776D},
> +	{0, 0x0992, 0xCC32},
> +	{0, 0x0994, 0x5C30},
> +	{0, 0x0996, 0xED00},
> +	{0, 0x0998, 0xFC13},
> +	{0, 0x099a, 0x8683},
> +	{0, 0x099c, 0x1},
> +	{0, 0x099e, 0xBD70},
> +	{0, 0x098A, 0x12F0},
> +	{0, 0x0990, 0x21CC},
> +	{0, 0x0992, 0x325E},
> +	{0, 0x0994, 0x30ED},
> +	{0, 0x0996, 0xFC},
> +	{0, 0x0998, 0x1388},
> +	{0, 0x099a, 0x8300},
> +	{0, 0x099c, 0x1BD},
> +	{0, 0x099e, 0x7021},
> +	{0, 0x098A, 0x1300},
> +	{0, 0x0990, 0x3839},
> +	{0, 0x098E, 0x0010},
> +	{0, 0x0990, 0x1000},
> +	{0, 0x098E, 0x0003},
> +	{100, 0x0990, 0x0004}
> +};
> +
> +mt9t111_regs def_regs1[] = {
> +	{0, 0x001A, 0x0218},
> +	{0, 0x001E, 0x0777},
> +	{0, 0x3084, 0x2409},
> +	{0, 0x3092, 0x0A49},
> +	{0, 0x3094, 0x4949},
> +	{0, 0x3096, 0x4950},
> +	{0, 0x0018, 0x402D},
> +	{100, 0x0018, 0x402C},
> +	{0, 0x098E, 0x6800},
> +	{0, 0x0990, 0x0280},
> +	{0, 0x098E, 0x6802},
> +	{0, 0x0990, 0x01E0},
> +	{0, 0x098E, 0xE88E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x68A0},
> +	{0, 0x0990, 0x082D},
> +	{0, 0x098E, 0x4802},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x4804},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x4806},
> +	{0, 0x0990, 0x060D},
> +	{0, 0x098E, 0x4808},
> +	{0, 0x0990, 0x080D},
> +	{0, 0x098E, 0x480A},
> +	{0, 0x0990, 0x0111},
> +	{0, 0x098E, 0x480C},
> +	{0, 0x0990, 0x046C},
> +	{0, 0x098E, 0x480F},
> +	{0, 0x0990, 0x00CC},
> +	{0, 0x098E, 0x4811},
> +	{0, 0x0990, 0x0381},
> +	{0, 0x098E, 0x4813},
> +	{0, 0x0990, 0x024F},
> +	{0, 0x098E, 0x481D},
> +	{0, 0x0990, 0x05AE},
> +	{0, 0x098E, 0x481F},
> +	{0, 0x0990, 0x05D0},
> +	{0, 0x098E, 0x4825},
> +	{0, 0x0990, 0x07AC},
> +	{0, 0x098E, 0x6C00},
> +	{0, 0x0990, 0x0800},
> +	{0, 0x098E, 0x6C02},
> +	{0, 0x0990, 0x0600},
> +	{0, 0x098E, 0xEC8E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x6CA0},
> +	{0, 0x0990, 0x082D},
> +	{0, 0x098E, 0x484A},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x484C},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x484E},
> +	{0, 0x0990, 0x060D},
> +	{0, 0x098E, 0x4850},
> +	{0, 0x0990, 0x080D},
> +	{0, 0x098E, 0x4852},
> +	{0, 0x0990, 0x0111},
> +	{0, 0x098E, 0x4854},
> +	{0, 0x0990, 0x146C},
> +	{0, 0x098E, 0x4857},
> +	{0, 0x0990, 0x00CC},
> +	{0, 0x098E, 0x4859},
> +	{0, 0x0990, 0x0381},
> +	{0, 0x098E, 0x485B},
> +	{0, 0x0990, 0x024F},
> +	{0, 0x098E, 0x4865},
> +	{0, 0x0990, 0x05AE},
> +	{0, 0x098E, 0x4867},
> +	{0, 0x0990, 0x05D0},
> +	{0, 0x098E, 0x486D},
> +	{0, 0x0990, 0x07AC},
> +	{0, 0x098E, 0xC8A5},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xC8A6},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC8A7},
> +	{0, 0x0990, 0x0023},
> +	{0, 0x098E, 0xC8A8},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC844},
> +	{0, 0x0990, 0x0091},
> +	{0, 0x098E, 0xC92F},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC845},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0xC92D},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC88C},
> +	{0, 0x0990, 0x0091},
> +	{0, 0x098E, 0xC930},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC88D},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0xC92E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xA002},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xA009},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0xA00A},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xA00C},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0x4846},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x68AA},
> +	{0, 0x0990, 0x0278},
> +	{0, 0x098E, 0x488E},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x6CAA},
> +	{0, 0x0990, 0x0218},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0005},
> +	{0, 0x3C20, 0x0001},
> +	{0, 0x364A, 0x7D2F},
> +	{0, 0x364C, 0x79EB},
> +	{0, 0x364E, 0x18D2},
> +	{0, 0x3650, 0x9F8F},
> +	{0, 0x3652, 0xA7D2},
> +	{0, 0x368A, 0x460C},
> +	{0, 0x368C, 0x14F0},
> +	{0, 0x368E, 0x946F},
> +	{0, 0x3690, 0xC471},
> +	{0, 0x3692, 0x04B1},
> +	{0, 0x36CA, 0x0433},
> +	{0, 0x36CC, 0x680D},
> +	{0, 0x36CE, 0xEEF3},
> +	{0, 0x36D0, 0x4850},
> +	{0, 0x36D2, 0xF233},
> +	{0, 0x370A, 0xB2AF},
> +	{0, 0x370C, 0x2CF0},
> +	{0, 0x370E, 0x3F10},
> +	{0, 0x3710, 0xC673},
> +	{0, 0x3712, 0xA972},
> +	{0, 0x374A, 0x0590},
> +	{0, 0x374C, 0xAFB3},
> +	{0, 0x374E, 0x93D7},
> +	{0, 0x3750, 0x8D12},
> +	{0, 0x3752, 0x2539},
> +	{0, 0x3640, 0x0350},
> +	{0, 0x3642, 0x322C},
> +	{0, 0x3644, 0x77D1},
> +	{0, 0x3646, 0xA26F},
> +	{0, 0x3648, 0xC872},
> +	{0, 0x3680, 0x0C4C},
> +	{0, 0x3682, 0x9510},
> +	{0, 0x3684, 0x110E},
> +	{0, 0x3686, 0x4331},
> +	{0, 0x3688, 0xC1CF},
> +	{0, 0x36C0, 0x6152},
> +	{0, 0x36C2, 0x038E},
> +	{0, 0x36C4, 0x9AF4},
> +	{0, 0x36C6, 0xE12F},
> +	{0, 0x36C8, 0x09F3},
> +	{0, 0x3700, 0xC5AF},
> +	{0, 0x3702, 0xCA90},
> +	{0, 0x3704, 0x5D0F},
> +	{0, 0x3706, 0x3293},
> +	{0, 0x3708, 0x2B92},
> +	{0, 0x3740, 0xC590},
> +	{0, 0x3742, 0x8133},
> +	{0, 0x3744, 0xE0F6},
> +	{0, 0x3746, 0x0254},
> +	{0, 0x3748, 0x10B9},
> +	{0, 0x3654, 0x7F8F},
> +	{0, 0x3656, 0x6F6C},
> +	{0, 0x3658, 0x5971},
> +	{0, 0x365A, 0x9A0F},
> +	{0, 0x365C, 0xA1B2},
> +	{0, 0x3694, 0xB00C},
> +	{0, 0x3696, 0xEBCF},
> +	{0, 0x3698, 0x06AD},
> +	{0, 0x369A, 0x4D31},
> +	{0, 0x369C, 0x2A4E},
> +	{0, 0x36D4, 0x4752},
> +	{0, 0x36D6, 0x724D},
> +	{0, 0x36D8, 0xAD34},
> +	{0, 0x36DA, 0x1350},
> +	{0, 0x36DC, 0x4E94},
> +	{0, 0x3714, 0xA06E},
> +	{0, 0x3716, 0x9152},
> +	{0, 0x3718, 0x1F53},
> +	{0, 0x371A, 0x3933},
> +	{0, 0x371C, 0xBA94},
> +	{0, 0x3754, 0x1233},
> +	{0, 0x3756, 0xA032},
> +	{0, 0x3758, 0xE936},
> +	{0, 0x375A, 0xBE34},
> +	{0, 0x375C, 0x02D9},
> +	{0, 0x365E, 0x7DEF},
> +	{0, 0x3660, 0x434B},
> +	{0, 0x3662, 0x69F1},
> +	{0, 0x3664, 0x8A0F},
> +	{0, 0x3666, 0xBDB2},
> +	{0, 0x369E, 0x290D},
> +	{0, 0x36A0, 0x42CF},
> +	{0, 0x36A2, 0xDC6D},
> +	{0, 0x36A4, 0x91B1},
> +	{0, 0x36A6, 0x9DE9},
> +	{0, 0x36DE, 0x70B2},
> +	{0, 0x36E0, 0x02AC},
> +	{0, 0x36E2, 0x9714},
> +	{0, 0x36E4, 0xF3CF},
> +	{0, 0x36E6, 0x6BD1},
> +	{0, 0x371E, 0xE42E},
> +	{0, 0x3720, 0x1D32},
> +	{0, 0x3722, 0xCC31},
> +	{0, 0x3724, 0xAE94},
> +	{0, 0x3726, 0x6413},
> +	{0, 0x375E, 0xE290},
> +	{0, 0x3760, 0x8F53},
> +	{0, 0x3762, 0xF936},
> +	{0, 0x3764, 0x4614},
> +	{0, 0x3766, 0x1B59},
> +	{0, 0x3784, 0x0404},
> +	{0, 0x3782, 0x0304},
> +	{0, 0x3210, 0x01B8},
> +	{0, 0x098E, 0xC913},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0x686B},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x686D},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x6C6B},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x6C6D},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x3439},
> +	{0, 0x0990, 0x05DC},
> +	{0, 0x098E, 0x343B},
> +	{0, 0x0990, 0x0BB8},
> +	{0, 0x098E, 0x4926},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0x4928},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x492A},
> +	{0, 0x0990, 0x0656},
> +	{0, 0x098E, 0x4D26},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0x4D28},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x4D2A},
> +	{0, 0x0990, 0x0656},
> +	{0, 0x33F4, 0x040B},
> +	{0, 0x098E, 0xC916},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0xC919},
> +	{0, 0x0990, 0x0028},
> +	{0, 0x098E, 0xC917},
> +	{0, 0x0990, 0x0004},
> +	{0, 0x098E, 0xC918},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC91A},
> +	{0, 0x0990, 0x0001},
> +	{0, 0x098E, 0xC91B},
> +	{0, 0x0990, 0x0009},
> +	{0, 0x326C, 0x0C00},
> +	{0, 0x098E, 0x494B},
> +	{0, 0x0990, 0x0042},
> +	{0, 0x098E, 0x494D},
> +	{0, 0x0990, 0x012C},
> +	{0, 0x098E, 0xC91E},
> +	{0, 0x0990, 0x0012},
> +	{0, 0x098E, 0xC91F},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0xC920},
> +	{0, 0x0990, 0x0012},
> +	{0, 0x098E, 0xC921},
> +	{0, 0x0990, 0x000A},
> +	{0, 0x098E, 0xC922},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC923},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xC924},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xC925},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0xBC02},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xBC05},
> +	{0, 0x0990, 0x000E},
> +	{0, 0x098E, 0xC950},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xC94F},
> +	{0, 0x0990, 0x0038},
> +	{0, 0x098E, 0xC952},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xC951},
> +	{0, 0x0990, 0x0051},
> +	{0, 0x098E, 0xC954},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xC953},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC956},
> +	{0, 0x0990, 0x0010},
> +	{0, 0x098E, 0xC955},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC958},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC957},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0xC95A},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xC959},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xC95C},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0xC95B},
> +	{0, 0x0990, 0x0008},
> +	{0, 0x098E, 0xC95E},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0xC95D},
> +	{0, 0x0990, 0x0008},
> +	{0, 0x098E, 0xC95F},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0x48DC},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48DE},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48E0},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0x48E2},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48E4},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48E6},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0x48E8},
> +	{0, 0x0990, 0x004D},
> +	{0, 0x098E, 0x48EA},
> +	{0, 0x0990, 0x0096},
> +	{0, 0x098E, 0x48EC},
> +	{0, 0x0990, 0x001D},
> +	{0, 0x098E, 0xDC2A},
> +	{0, 0x0990, 0x000B},
> +	{0, 0x098E, 0xDC2B},
> +	{0, 0x0990, 0x0017},
> +	{0, 0x098E, 0xBC0B},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC0C},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xBC0D},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0xBC0E},
> +	{0, 0x0990, 0x003E},
> +	{0, 0x098E, 0xBC0F},
> +	{0, 0x0990, 0x005A},
> +	{0, 0x098E, 0xBC10},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC11},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC12},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC13},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC14},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC15},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC16},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC17},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC18},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC19},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC1A},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC1B},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC1C},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC1D},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xBC1E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC1F},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xBC20},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0xBC21},
> +	{0, 0x0990, 0x003E},
> +	{0, 0x098E, 0xBC22},
> +	{0, 0x0990, 0x005A},
> +	{0, 0x098E, 0xBC23},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC24},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC25},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC26},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC27},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC28},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC29},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC2A},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC2B},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC2C},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC2D},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC2E},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC2F},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC30},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xBC31},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xBC32},
> +	{0, 0x0990, 0x000D},
> +	{0, 0x098E, 0xBC33},
> +	{0, 0x0990, 0x0019},
> +	{0, 0x098E, 0xBC34},
> +	{0, 0x0990, 0x0030},
> +	{0, 0x098E, 0xBC35},
> +	{0, 0x0990, 0x0056},
> +	{0, 0x098E, 0xBC36},
> +	{0, 0x0990, 0x0070},
> +	{0, 0x098E, 0xBC37},
> +	{0, 0x0990, 0x0081},
> +	{0, 0x098E, 0xBC38},
> +	{0, 0x0990, 0x0090},
> +	{0, 0x098E, 0xBC39},
> +	{0, 0x0990, 0x009E},
> +	{0, 0x098E, 0xBC3A},
> +	{0, 0x0990, 0x00AB},
> +	{0, 0x098E, 0xBC3B},
> +	{0, 0x0990, 0x00B6},
> +	{0, 0x098E, 0xBC3C},
> +	{0, 0x0990, 0x00C1},
> +	{0, 0x098E, 0xBC3D},
> +	{0, 0x0990, 0x00CB},
> +	{0, 0x098E, 0xBC3E},
> +	{0, 0x0990, 0x00D5},
> +	{0, 0x098E, 0xBC3F},
> +	{0, 0x0990, 0x00DE},
> +	{0, 0x098E, 0xBC40},
> +	{0, 0x0990, 0x00E7},
> +	{0, 0x098E, 0xBC41},
> +	{0, 0x0990, 0x00EF},
> +	{0, 0x098E, 0xBC42},
> +	{0, 0x0990, 0x00F7},
> +	{0, 0x098E, 0xBC43},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0x6865},
> +	{0, 0x0990, 0x00E0},
> +	{0, 0x098E, 0x6867},
> +	{0, 0x0990, 0x00F4},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xBC4A},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x098E, 0xBC4B},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x098E, 0xBC4C},
> +	{0, 0x0990, 0x007F},
> +	{0, 0x3542, 0x0010},
> +	{0, 0x3544, 0x0030},
> +	{0, 0x3546, 0x0040},
> +	{0, 0x3548, 0x0080},
> +	{0, 0x354A, 0x0100},
> +	{0, 0x354C, 0x0200},
> +	{0, 0x354E, 0x0300},
> +	{0, 0x3550, 0x0010},
> +	{0, 0x3552, 0x0030},
> +	{0, 0x3554, 0x0040},
> +	{0, 0x3556, 0x0080},
> +	{0, 0x3558, 0x012C},
> +	{0, 0x355A, 0x0320},
> +	{0, 0x355C, 0x03E8},
> +	{0, 0x3560, 0x0040},
> +	{0, 0x3562, 0x0020},
> +	{0, 0x3564, 0x0040},
> +	{0, 0x3566, 0x0010},
> +	{0, 0x3568, 0x0008},
> +	{0, 0x356A, 0x0004},
> +	{0, 0x356C, 0x0004},
> +	{0, 0x356E, 0x0004},
> +	{0, 0x098E, 0x3C4D},
> +	{0, 0x0990, 0x0DAC},
> +	{0, 0x098E, 0x3C4F},
> +	{0, 0x0990, 0x148A},
> +	{0, 0x098E, 0xC911},
> +	{0, 0x0990, 0x00C8},
> +	{0, 0x098E, 0xC8F4},
> +	{0, 0x0990, 0x0004},
> +	{0, 0x098E, 0xC8F5},
> +	{0, 0x0990, 0x0002},
> +	{0, 0x098E, 0x48F6},
> +	{0, 0x0990, 0x3B4D},
> +	{0, 0x098E, 0x48F8},
> +	{0, 0x0990, 0x6380},
> +	{0, 0x098E, 0x48FA},
> +	{0, 0x0990, 0x9B18},
> +	{0, 0x098E, 0x48FC},
> +	{0, 0x0990, 0x5D51},
> +	{0, 0x098E, 0x48FE},
> +	{0, 0x0990, 0xEDE8},
> +	{0, 0x098E, 0x4900},
> +	{0, 0x0990, 0xE515},
> +	{0, 0x098E, 0x4902},
> +	{0, 0x0990, 0xBFF4},
> +	{0, 0x098E, 0x4904},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0x4906},
> +	{0, 0x0990, 0x0026},
> +	{0, 0x098E, 0x4908},
> +	{0, 0x0990, 0x0033},
> +	{0, 0x098E, 0xE84A},
> +	{0, 0x0990, 0x0083},
> +	{0, 0x098E, 0xE84D},
> +	{0, 0x0990, 0x0083},
> +	{0, 0x098E, 0xE84C},
> +	{0, 0x0990, 0x0080},
> +	{0, 0x098E, 0xE84F},
> +	{0, 0x0990, 0x0080},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0x48B0},
> +	{0, 0x0990, 0x0180},
> +	{0, 0x098E, 0x48B2},
> +	{0, 0x0990, 0xFF7A},
> +	{0, 0x098E, 0x48B4},
> +	{0, 0x0990, 0x0018},
> +	{0, 0x098E, 0x48B6},
> +	{0, 0x0990, 0xFFCA},
> +	{0, 0x098E, 0x48B8},
> +	{0, 0x0990, 0x017C},
> +	{0, 0x098E, 0x48BA},
> +	{0, 0x0990, 0xFFCC},
> +	{0, 0x098E, 0x48BC},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x098E, 0x48BE},
> +	{0, 0x0990, 0xFF1F},
> +	{0, 0x098E, 0x48C0},
> +	{0, 0x0990, 0x01E8},
> +	{0, 0x098E, 0x48C2},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0x48C4},
> +	{0, 0x0990, 0x0044},
> +	{0, 0x098E, 0x48C6},
> +	{0, 0x0990, 0x0079},
> +	{0, 0x098E, 0x48C8},
> +	{0, 0x0990, 0xFFAD},
> +	{0, 0x098E, 0x48CA},
> +	{0, 0x0990, 0xFFE2},
> +	{0, 0x098E, 0x48CC},
> +	{0, 0x0990, 0x0033},
> +	{0, 0x098E, 0x48CE},
> +	{0, 0x0990, 0x002A},
> +	{0, 0x098E, 0x48D0},
> +	{0, 0x0990, 0xFFAA},
> +	{0, 0x098E, 0x48D2},
> +	{0, 0x0990, 0x0017},
> +	{0, 0x098E, 0x48D4},
> +	{0, 0x0990, 0x004B},
> +	{0, 0x098E, 0x48D6},
> +	{0, 0x0990, 0xFFA5},
> +	{0, 0x098E, 0x48D8},
> +	{0, 0x0990, 0x0015},
> +	{0, 0x098E, 0x48DA},
> +	{0, 0x0990, 0xFFE2},
> +	{0, 0x35A2, 0x0014},
> +	{0, 0x098E, 0xC949},
> +	{0, 0x0990, 0x0024},
> +	{0, 0x35A4, 0x0596},
> +	{0, 0x098E, 0xC94A},
> +	{0, 0x0990, 0x0062},
> +	{0, 0x098E, 0xC948},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xC914},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xC915},
> +	{0, 0x0990, 0x00FF},
> +	{0, 0x098E, 0xE86F},
> +	{0, 0x0990, 0x0060},
> +	{0, 0x098E, 0xE870},
> +	{0, 0x0990, 0x003C},
> +	{0, 0x098E, 0xEC6F},
> +	{0, 0x0990, 0x0060},
> +	{0, 0x098E, 0xEC70},
> +	{0, 0x0990, 0x003C},
> +	{0, 0x098E, 0xE883},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xEC83},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xE885},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xE886},
> +	{0, 0x0990, 0x00D8},
> +	{0, 0x098E, 0xEC85},
> +	{0, 0x0990, 0x001E},
> +	{0, 0x098E, 0xEC86},
> +	{0, 0x0990, 0x00D8},
> +	{0, 0x098E, 0xE884},
> +	{0, 0x0990, 0x005C},
> +	{0, 0x098E, 0xEC84},
> +	{0, 0x0990, 0x005C},
> +	{0, 0x098E, 0x490A},
> +	{0, 0x0990, 0x0666},
> +	{0, 0x098E, 0x490C},
> +	{0, 0x0990, 0x0140},
> +	{0, 0x098E, 0x6857},
> +	{0, 0x0990, 0x0014},
> +	{0, 0x098E, 0x685C},
> +	{0, 0x0990, 0x0005},
> +	{0, 0x098E, 0x490E},
> +	{0, 0x0990, 0x00A4},
> +	{0, 0x098E, 0xB43D},
> +	{0, 0x0990, 0x0031},
> +	{0, 0x098E, 0xB43E},
> +	{0, 0x0990, 0x001B},
> +	{0, 0x098E, 0xB43F},
> +	{0, 0x0990, 0x0028},
> +	{0, 0x098E, 0xB440},
> +	{0, 0x0990, 0x0003},
> +	{0, 0x098E, 0xB441},
> +	{0, 0x0990, 0x00CD},
> +	{0, 0x098E, 0xB442},
> +	{0, 0x0990, 0x0064},
> +	{0, 0x098E, 0xB443},
> +	{0, 0x0990, 0x000F},
> +	{0, 0x098E, 0xB444},
> +	{0, 0x0990, 0x0007},
> +	{0, 0x098E, 0x300D},
> +	{0, 0x0990, 0x000F},
> +	{0, 0x098E, 0x3017},
> +	{0, 0x0990, 0x0F0F},
> +	{0, 0x098E, 0x8400},
> +	{0, 0x0990, 0x0006},
> +	{0, 0x098E, 0xE81F},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0x68A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x6CA0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x70A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x098E, 0x74A0},
> +	{0, 0x0990, 0x082E},
> +	{0, 0x3C52, 0x082E},
> +	{0, 0x098E, 0x488E},
> +	{0, 0x0990, 0x0020},
> +	{0, 0x098E, 0xECAC},
> +	{0, 0x0990, 0x0000}
> +};
> +
> +mt9t111_regs def_regs2[] = {
> +	{100, 0x0018, 0x0028},
> +	{0, 0x316C, 0x350F},
> +	{0, 0x098E, 0x6817},
> +	{0, 0x0990, 0x000C},
> +	{0, 0x0034, 0x0000}
> +};
> +
> +mt9t111_regs pll_regs1[] = {
> +	{0, 0x0014, 0x2425},
> +	{0, 0x0014, 0x2425},
> +	{0, 0x0014, 0x2145},
> +	{0, 0x0010, 0x0219},
> +	{0, 0x0012, 0x0090},
> +	{0, 0x002A, 0x79DD},
> +	{0, 0x0014, 0x2545},
> +	{0, 0x0014, 0x2547},
> +	{0, 0x0014, 0x3447},
> +	{0, 0x0014, 0x3047}
> +};
> +
> +mt9t111_regs pll_regs2[] = {
> +	{0, 0x0014, 0x3046},
> +	{0, 0x0022, 0x01E0},
> +	{0, 0x001E, 0x0707},
> +	{0, 0x3B84, 0x011D}
> +};
> +
> +mt9t111_regs bayer_pattern_regs[] = {
> +	{0, 0x098E, 0x6807},
> +	{0, 0x0990, 0x0100},
> +	{0, 0x098E, 0x6809},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xE88E},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0x6C07},
> +	{0, 0x0990, 0x0100},
> +	{0, 0x098E, 0x6C09},
> +	{0, 0x0990, 0x0000},
> +	{0, 0x098E, 0xEC8E},
> +	{0, 0x0990, 0x0000}
> +};
> +
> +#endif
> diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
> index 32114a3..aba49e2 100644
> --- a/drivers/media/video/mt9t112.c
> +++ b/drivers/media/video/mt9t112.c
> @@ -24,12 +24,16 @@
>  #include <linux/slab.h>
>  #include <linux/v4l2-mediabus.h>
>  #include <linux/videodev2.h>
> +#include <linux/regulator/consumer.h>
>  
>  #include <media/mt9t112.h>
> +#include <media/mt9t111.h>
>  #include <media/soc_camera.h>
>  #include <media/v4l2-chip-ident.h>
>  #include <media/v4l2-common.h>
>  
> +#include "mt9t111_reg.h"
> +
>  /* you can check PLL/clock info */
>  /* #define EXT_CLOCK 24000000 */
>  
> @@ -88,11 +92,15 @@ struct mt9t112_format {
>  struct mt9t112_priv {
>  	struct v4l2_subdev		 subdev;
>  	struct mt9t112_camera_info	*info;
> +	struct media_pad		pad;

I have also extended mt9t112 locally to work with the pad-level API. These 
patches have not been published yet, I could try to do that tomorrow. 
Maybe you could use that as a basis.

>  	struct i2c_client		*client;
>  	struct v4l2_rect		 frame;
>  	const struct mt9t112_format	*format;
> +	struct v4l2_mbus_framefmt	fmt;
>  	int				 model;
>  	u32				 flags;
> +	struct regulator		*omap3evm_1v8;
> +	struct regulator		*omap3evm_2v8;

you _certainly_ do not want anything board-specific in generic drivers. 
omap3evm has nothing to do here. Further, we shall not break soc-camera 
functionality. And soc-camera already handles regulators. We should 
discuss this with others and maybe move this somewhere to a more readily 
accessible location. Alternatively we could consider a way to call those 
functions from outside at least for the initial port to try things out.

>  /* for flags */
>  #define INIT_DONE	(1 << 0)
>  #define PCLK_RISING	(1 << 1)
> @@ -206,6 +214,33 @@ static int __mt9t112_reg_write(const struct i2c_client *client,
>  	return ret;
>  }
>  
> +static int mt9t111_write_regs(struct i2c_client *client,
> +				mt9t111_regs *reg_in, int cnt)

We don't want to mix namespaces. Functions and types, that are not 
strictly mt9t111-specific, should continue to use the mt9t112 namespace. 
But this we have to carefully consider, whether we need it at all - 
mt9t112 doesn't need any bulk register writing, and that is also the 
common case for Aptina sensors, AFAIK, we don't want to change it...

> +{
> +	int err = 0, i;
> +	mt9t111_regs *reg = reg_in;
> +
> +	for (i = 0; i < cnt; i++) {
> +		if (reg->delay_time == 0) {
> +			mt9t112_reg_write(err, client, reg->addr, reg->data);
> +		} else if (reg->addr != 0 || reg->data != 0) {
> +			mt9t112_reg_write(err, client, reg->addr, reg->data);
> +			mdelay(reg->delay_time);
> +		} else {
> +			mdelay(reg->delay_time);
> +		}
> +		if (err < 0) {
> +			dev_warn(&client->dev, "write reg error, addr = 0x%x,"
> +					"data = 0x%x\n",
> +					reg->addr, reg->data);
> +			return err;
> +		}
> +		reg++;
> +	}
> +
> +	return err;
> +}
> +
>  static int __mt9t112_reg_mask_set(const struct i2c_client *client,
>  				  u16  command,
>  				  u16  mask,
> @@ -733,6 +768,82 @@ static int mt9t112_init_camera(const struct i2c_client *client)
>  	return ret;
>  }
>  
> +static int mt9t111_configure(struct v4l2_subdev *subdev)
> +{
> +	int i, ret = 0;
> +	unsigned short value;
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +
> +	mt9t112_reg_write(ret, client, 0x001A, 0x001D);
> +	if (ret)
> +		goto out;
> +
> +	msleep(1);
> +
> +	mt9t112_reg_write(ret, client, 0x001A, 0x0018);
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, pll_regs1,
> +			sizeof(pll_regs1) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	for (i = 0; i < 100; i++) {
> +		mt9t112_reg_read(value, client, 0x0014);
> +		if ((value & 0x8000) != 0)
> +			break;
> +		mdelay(2);
> +	}
> +
> +	ret = mt9t111_write_regs(client, pll_regs2,
> +			sizeof(pll_regs2) / sizeof(mt9t111_regs));

I really would prefer to avoid all these...

> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, def_regs1,
> +			sizeof(def_regs1) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, patch_rev6,
> +			sizeof(patch_rev6) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	ret = mt9t111_write_regs(client, def_regs2,
> +			sizeof(def_regs2) / sizeof(mt9t111_regs));
> +	if (ret)
> +		goto out;
> +
> +	/* MCU_ADDRESS [SEQ_CMD] -- refresh mode */
> +	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +	if (ret)
> +		goto out;
> +	mt9t112_reg_write(ret, client, 0x0990, 0x0006);
> +	if (ret)
> +		goto out;
> +
> +	/* refresh command */
> +	mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +	if (ret)
> +		goto out;
> +	mt9t112_reg_write(ret, client, 0x0990, 0x0005);
> +	if (ret)
> +		goto out;
> +	for (i = 0; i < 100; i++) {
> +		mt9t112_reg_write(ret, client, 0x098E, 0x8400);
> +		if (ret)
> +			break;
> +		mt9t112_reg_read(value , client, 0x0990);
> +		if (value == 0)
> +			break;
> +		mdelay(5);
> +	}
> +out:
> +	return ret;
> +}
> +
>  /************************************************************************
>  			v4l2_subdev_core_ops
>  ************************************************************************/
> @@ -775,15 +886,72 @@ static int mt9t112_s_register(struct v4l2_subdev *sd,
>  }
>  #endif
>  
> +static int omap3evm_regulator_ctrl(struct mt9t112_priv *priv, u32 on)

As I said, we have to find a way to consolidate this with soc-camera PM.

> +{
> +	if (!(priv->omap3evm_1v8) || !(priv->omap3evm_2v8)) {
> +		printk(KERN_ERR "No regulator available\n");
> +		return -ENODEV;
> +	}
> +	if (on) {
> +		regulator_enable(priv->omap3evm_1v8);
> +		mdelay(1);
> +		regulator_enable(priv->omap3evm_2v8);
> +		mdelay(50);
> +	} else {
> +		if (regulator_is_enabled(priv->omap3evm_1v8))
> +			regulator_disable(priv->omap3evm_1v8);
> +		if (regulator_is_enabled(priv->omap3evm_2v8))
> +			regulator_disable(priv->omap3evm_2v8);
> +	}
> +	return 0;
> +}
> +
> +static int mt9t111_s_power(struct v4l2_subdev *subdev, int on)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +	struct mt9t111_platform_data  *pdata;
> +	int rval;
> +
> +	pdata = (struct mt9t111_platform_data *) icl;
> +	if (on) {
> +		rval = omap3evm_regulator_ctrl(priv, on);
> +		if (rval)
> +			goto out;
> +
> +		rval = pdata->s_power(subdev, 1);
> +		if (rval)
> +			goto out;
> +
> +		rval = mt9t111_configure(subdev);
> +		if (rval) {
> +			pdata->s_power(subdev, 0);
> +			goto out;
> +	}
> +
> +	} else {
> +		rval = pdata->s_power(subdev, 0);
> +		if (rval)
> +			goto out;
> +	}
> +
> +out:
> +	if (rval)
> +		v4l_err(client, "Unable to set target power state\n");
> +
> +	return rval;
> +}
> +
>  static struct v4l2_subdev_core_ops mt9t112_subdev_core_ops = {
>  	.g_chip_ident	= mt9t112_g_chip_ident,
> +	.s_power	= mt9t111_s_power,
>  #ifdef CONFIG_VIDEO_ADV_DEBUG
> -	.g_register	= mt9t112_g_register,
> -	.s_register	= mt9t112_s_register,
> +	.g_register     = mt9t112_g_register,
> +	.s_register     = mt9t112_s_register,
>  #endif
>  };

Don't do this.

>  
> -
>  /************************************************************************
>  			v4l2_subdev_video_ops
>  ************************************************************************/
> @@ -793,51 +961,56 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable)
>  	struct mt9t112_priv *priv = to_mt9t112(client);
>  	int ret = 0;
>  
> -	if (!enable) {
> -		/* FIXME
> -		 *
> -		 * If user selected large output size,
> -		 * and used it long time,
> -		 * mt9t112 camera will be very warm.
> -		 *
> -		 * But current driver can not stop mt9t112 camera.
> -		 * So, set small size here to solve this problem.
> -		 */
> -		mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
> +	if (priv->model == V4L2_IDENT_MT9T111) {
>  		return ret;
> -	}
>  
> -	if (!(priv->flags & INIT_DONE)) {
> -		u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
> +	} else {

After a "return" you don't need an "else," which would leave the rest of 
the function intact.

> +		if (!enable) {
> +			/* FIXME
> +			 *
> +			 * If user selected large output size,
> +			 * and used it long time,
> +			 * mt9t112 camera will be very warm.
> +			 *
> +			 * But current driver can not stop mt9t112 camera.
> +			 * So, set small size here to solve this problem.
> +			 */
> +			mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
> +			return ret;
> +		}
>  
> -		ECHECKER(ret, mt9t112_init_camera(client));
> +		if (!(priv->flags & INIT_DONE)) {
> +			u16 param = PCLK_RISING & priv->flags ? 0x0001 : 0x0000;
>  
> -		/* Invert PCLK (Data sampled on falling edge of pixclk) */
> -		mt9t112_reg_write(ret, client, 0x3C20, param);
> +			ECHECKER(ret, mt9t112_init_camera(client));
>  
> -		mdelay(5);
> +			/* Invert PCLK (Data sampled on falling edge of pixclk) */
> +			mt9t112_reg_write(ret, client, 0x3C20, param);
>  
> -		priv->flags |= INIT_DONE;
> -	}
> +			mdelay(5);
>  
> -	mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
> -	mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
> -	mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
> +			priv->flags |= INIT_DONE;
> +		}
>  
> -	mt9t112_set_a_frame_size(client,
> -				 priv->frame.width,
> -				 priv->frame.height);
> +		mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt);
> +		mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order);
> +		mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
>  
> -	ECHECKER(ret, mt9t112_auto_focus_trigger(client));
> +		mt9t112_set_a_frame_size(client,
> +					priv->frame.width,
> +					priv->frame.height);
>  
> -	dev_dbg(&client->dev, "format : %d\n", priv->format->code);
> -	dev_dbg(&client->dev, "size   : %d x %d\n",
> -		priv->frame.width,
> -		priv->frame.height);
> +		ECHECKER(ret, mt9t112_auto_focus_trigger(client));
>  
> -	CLOCK_INFO(client, EXT_CLOCK);
> +		dev_dbg(&client->dev, "format : %d\n", priv->format->code);
> +		dev_dbg(&client->dev, "size   : %d x %d\n",
> +			priv->frame.width,
> +			priv->frame.height);
>  
> -	return ret;
> +		CLOCK_INFO(client, EXT_CLOCK);
> +
> +		return ret;
> +	}
>  }
>  
>  static int mt9t112_set_params(struct mt9t112_priv *priv,
> @@ -1019,11 +1192,60 @@ static struct v4l2_subdev_video_ops mt9t112_subdev_video_ops = {
>  };
>  
>  /************************************************************************
> +		v4l2_subdev_pad_ops
> +************************************************************************/
> +static int mt9t111_get_pad_format(struct v4l2_subdev *subdev,
> +		struct v4l2_subdev_fh *fh,
> +		struct v4l2_subdev_format *fmt)
> +{
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +
> +	fmt->format = priv->fmt;
> +	return 0;
> +}
> +
> +static int mt9t111_set_pad_format(struct v4l2_subdev *subdev,
> +				struct v4l2_subdev_fh *fh,
> +				struct v4l2_subdev_format *fmt)
> +{
> +	int i;
> +	struct i2c_client *client = v4l2_get_subdevdata(subdev);
> +	struct mt9t112_priv *priv = to_mt9t112(client);
> +
> +	for (i = 0; i < ARRAY_SIZE(mt9t112_cfmts); i++) {
> +		if (fmt->format.code == mt9t112_cfmts[i].code)
> +			goto fmt_found;
> +	}
> +	if (i >= ARRAY_SIZE(mt9t112_cfmts))
> +		return -EINVAL;
> +
> +fmt_found:
> +	/*
> +	 * Only VGA resolution supported
> +	 */

We should re-use the driver functionality. BTW, I wasn't able to find an 
mt9t112 datasheet on the internet, but I did manage to find an mt9t111 
datasheet. Maybe you could find it too and use to get rid of all the 
register magic, and also to replace existing mt9t112 register addresses 
with symbolic names, at least where registers coincide.

> +	fmt->format.width = VGA_WIDTH;
> +	fmt->format.height = VGA_HEIGHT;
> +	fmt->format.field = V4L2_FIELD_NONE;
> +	fmt->format.colorspace = V4L2_COLORSPACE_JPEG;
> +
> +	priv->fmt = fmt->format;
> +
> +	return 0;
> +}
> +
> +static const struct v4l2_subdev_pad_ops mt9t111_pad_ops = {
> +	.get_fmt        = mt9t111_get_pad_format,
> +	.set_fmt        = mt9t111_set_pad_format,
> +};
> +
> +/************************************************************************
>  			i2c driver
>  ************************************************************************/
>  static struct v4l2_subdev_ops mt9t112_subdev_ops = {
>  	.core	= &mt9t112_subdev_core_ops,
>  	.video	= &mt9t112_subdev_video_ops,
> +	.pad    = &mt9t111_pad_ops,
>  };
>  
>  static int mt9t112_camera_probe(struct i2c_client *client)
> @@ -1089,6 +1311,32 @@ static int mt9t112_probe(struct i2c_client *client,
>  	/* Cannot fail: using the default supported pixel code */
>  	mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
>  
> +	if (priv->model == V4L2_IDENT_MT9T111) {
> +		priv->omap3evm_1v8 = regulator_get(NULL, "vio_1v8");
> +		if (IS_ERR(priv->omap3evm_1v8)) {
> +			printk(KERN_ERR "vio_1v8 regulator missing\n");
> +			ret =  PTR_ERR(priv->omap3evm_1v8);

Same - unify PM with soc-camera.

> +			goto err_1;
> +		}
> +		priv->omap3evm_2v8 = regulator_get(NULL, "cam_2v8");
> +		if (IS_ERR(priv->omap3evm_2v8)) {
> +			printk(KERN_ERR "cam_2v8 regulator missing\n");
> +			ret = PTR_ERR(priv->omap3evm_2v8);
> +			goto err_2;
> +		}
> +
> +		priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> +		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
> +		ret = media_entity_init(&priv->subdev.entity, 1, &priv->pad, 0);
> +		if (!ret)
> +			return 0;
> +		kfree(priv);
> +err_2:
> +		regulator_put(priv->omap3evm_2v8);
> +err_1:
> +		regulator_put(priv->omap3evm_1v8);
> +	}
> +
>  	return ret;
>  }
>  
> diff --git a/include/media/mt9t111.h b/include/media/mt9t111.h
> new file mode 100644
> index 0000000..372dc0d
> --- /dev/null
> +++ b/include/media/mt9t111.h
> @@ -0,0 +1,45 @@
> +/*
> + * include/media/mt9t111.h
> + *
> + * mt9t111 sensor driver
> + *
> + * Copyright (C) 2009 Leopard Imaging
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#ifndef	MT9T111_H
> +#define	MT9T111_H
> +
> +struct v4l2_subdev;
> +
> +/*
> + * Defines and Macros and globals
> + */
> +#define MT9T111_MODULE_NAME		"mt9t112"
> +
> +/*i2c adress for MT9T111*/
> +#define MT9T111_I2C_ADDR		(0x78 >> 1)
> +
> +#define MT9T111_CLK_MAX			(96000000) /* 96MHz */
> +#define MT9T111_CLK_MIN			(6000000)  /* 6Mhz */
> +
> +#define MT9T111_I2C_CONFIG		(1)
> +#define I2C_ONE_BYTE_TRANSFER		(1)
> +#define I2C_TWO_BYTE_TRANSFER		(2)
> +#define I2C_THREE_BYTE_TRANSFER		(3)
> +#define I2C_FOUR_BYTE_TRANSFER		(4)
> +#define I2C_TXRX_DATA_MASK		(0x00FF)
> +#define I2C_TXRX_DATA_MASK_UPPER	(0xFF00)
> +#define I2C_TXRX_DATA_SHIFT		(8)

I don't think you need parenthesis around simple numeric constants.

> +
> +struct mt9t111_platform_data {
> +	int (*s_power) (struct v4l2_subdev *subdev, u32 on);
> +	int (*set_xclk) (struct v4l2_subdev *subdev, u32 hz);
> +	int (*configure_interface) (struct v4l2_subdev *subdev, u32 pixclk);
> +};
> +
> +#endif	/* ifndef MT9T111 */
> +
> -- 
> 1.7.0.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file
  2011-09-27 13:40   ` Deepthy Ravi
@ 2011-09-29 16:37     ` Tony Lindgren
  -1 siblings, 0 replies; 25+ messages in thread
From: Tony Lindgren @ 2011-09-29 16:37 UTC (permalink / raw)
  To: Deepthy Ravi
  Cc: laurent.pinchart, mchehab, hvaibhav, linux-media, linux,
	linux-arm-kernel, kyungmin.park, hverkuil, m.szyprowski,
	g.liakhovetski, santosh.shilimkar, khilman, linux-kernel,
	linux-omap

Hi,

Few comments below.

* Deepthy Ravi <deepthy.ravi@ti.com> [110927 06:07]:
> +
> +#include <linux/io.h>
> +#include <linux/i2c.h>
> +#include <linux/delay.h>
> +#include <linux/gpio.h>
> +#include <linux/err.h>
> +#include <linux/platform_device.h>
> +#include <mach/gpio.h>

You can leave out mach/gpio.h as you already have linux/gpio.h
included.

> +static int __init omap3evm_cam_init(void)
> +{
> +	int ret;
> +
> +	ret = gpio_request_array(omap3evm_gpios,
> +			ARRAY_SIZE(omap3evm_gpios));
> +	if (ret < 0) {
> +		printk(KERN_ERR "Unable to get GPIO pins\n");
> +		return ret;
> +	}
> +
> +	omap3_init_camera(&omap3evm_isp_platform_data);
> +
> +	printk(KERN_INFO "omap3evm camera init done successfully...\n");
> +	return 0;
> +}
> +
> +static void __exit omap3evm_cam_exit(void)
> +{
> +	gpio_free_array(omap3evm_gpios,
> +			ARRAY_SIZE(omap3evm_gpios));
> +}
> +
> +module_init(omap3evm_cam_init);
> +module_exit(omap3evm_cam_exit);

Looks like most of this file should be under drivers/media.

For initializing the module you should pass some platform_data
(until we have DT doing it) so you know that the camera is
available on the booted board or not. Now the init tries to
wrongly initialize things on other boards too.


> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
>  				OMAP_PIN_OFF_NONE),
>  	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>  				OMAP_PIN_OFF_NONE),
> +	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +				OMAP_PIN_OFF_NONE),
>  #ifdef CONFIG_WL12XX_PLATFORM_DATA
>  	/* WLAN IRQ - GPIO 149 */
>  	OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
> @@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
>  	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>  				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
>  				OMAP_PIN_OFF_WAKEUPENABLE),
> +	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +				OMAP_PIN_OFF_NONE),
>  	/* AM/DM37x EVM: DSS data bus muxed with sys_boot */
>  	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
>  	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),

Is this safe to do on all boards, or only if you have the camera
board attached?

Regards,

Tony

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file
@ 2011-09-29 16:37     ` Tony Lindgren
  0 siblings, 0 replies; 25+ messages in thread
From: Tony Lindgren @ 2011-09-29 16:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Few comments below.

* Deepthy Ravi <deepthy.ravi@ti.com> [110927 06:07]:
> +
> +#include <linux/io.h>
> +#include <linux/i2c.h>
> +#include <linux/delay.h>
> +#include <linux/gpio.h>
> +#include <linux/err.h>
> +#include <linux/platform_device.h>
> +#include <mach/gpio.h>

You can leave out mach/gpio.h as you already have linux/gpio.h
included.

> +static int __init omap3evm_cam_init(void)
> +{
> +	int ret;
> +
> +	ret = gpio_request_array(omap3evm_gpios,
> +			ARRAY_SIZE(omap3evm_gpios));
> +	if (ret < 0) {
> +		printk(KERN_ERR "Unable to get GPIO pins\n");
> +		return ret;
> +	}
> +
> +	omap3_init_camera(&omap3evm_isp_platform_data);
> +
> +	printk(KERN_INFO "omap3evm camera init done successfully...\n");
> +	return 0;
> +}
> +
> +static void __exit omap3evm_cam_exit(void)
> +{
> +	gpio_free_array(omap3evm_gpios,
> +			ARRAY_SIZE(omap3evm_gpios));
> +}
> +
> +module_init(omap3evm_cam_init);
> +module_exit(omap3evm_cam_exit);

Looks like most of this file should be under drivers/media.

For initializing the module you should pass some platform_data
(until we have DT doing it) so you know that the camera is
available on the booted board or not. Now the init tries to
wrongly initialize things on other boards too.


> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -573,6 +573,8 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
>  				OMAP_PIN_OFF_NONE),
>  	OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>  				OMAP_PIN_OFF_NONE),
> +	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +				OMAP_PIN_OFF_NONE),
>  #ifdef CONFIG_WL12XX_PLATFORM_DATA
>  	/* WLAN IRQ - GPIO 149 */
>  	OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
> @@ -598,6 +600,8 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
>  	OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
>  				OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
>  				OMAP_PIN_OFF_WAKEUPENABLE),
> +	OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
> +				OMAP_PIN_OFF_NONE),
>  	/* AM/DM37x EVM: DSS data bus muxed with sys_boot */
>  	OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
>  	OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),

Is this safe to do on all boards, or only if you have the camera
board attached?

Regards,

Tony

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-09-29 16:37 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 13:40 [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor Deepthy Ravi
2011-09-27 13:40 ` Deepthy Ravi
2011-09-27 13:40 ` Deepthy Ravi
2011-09-27 13:40 ` [PATCH v2 1/5] omap3evm: Enable regulators for camera interface Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40 ` [PATCH v2 2/5] [media] v4l: Add support for mt9t111 sensor driver Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 23:20   ` Laurent Pinchart
2011-09-27 23:30   ` Guennadi Liakhovetski
2011-09-27 23:30     ` Guennadi Liakhovetski
2011-09-27 13:40 ` [PATCH v2 3/5] omap3evm: Add Camera board init/hookup file Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-29 16:37   ` Tony Lindgren
2011-09-29 16:37     ` Tony Lindgren
2011-09-27 13:40 ` [PATCH v2 4/5] ispccdc: Configure CCDC_SYN_MODE register Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40 ` [PATCH v2 5/5] omap2plus_defconfig: Enable omap3isp and MT9T111 sensor drivers Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:40   ` Deepthy Ravi
2011-09-27 13:51 ` [PATCH v2 0/5] OMAP3EVM: Add support for MT9T111 sensor Gary Thomas
2011-09-27 13:51   ` Gary Thomas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.