summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-12-15 05:37:16 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-12-15 22:02:46 +0900
commit207efd07e8c7b4da1f6f9940c40e20b8afc9195c (patch)
tree1aafdce0d8f5b24882e0e28dd7e043dbe00eda0e /arch/sh
parent1ce4da7a502ea637748bc55460fc43eb2acc4f01 (diff)
downloadop-kernel-dev-207efd07e8c7b4da1f6f9940c40e20b8afc9195c.zip
op-kernel-dev-207efd07e8c7b4da1f6f9940c40e20b8afc9195c.tar.gz
sh: mach-ecovec24: Add tw9910 support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index cfd958c..d4ac32b 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -28,6 +28,7 @@
#include <linux/mfd/sh_mobile_sdhi.h>
#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
+#include <media/tw9910.h>
#include <asm/heartbeat.h>
#include <asm/sh_eth.h>
#include <asm/clock.h>
@@ -565,6 +566,50 @@ static struct platform_device msiof0_device = {
#endif
+/* I2C Video */
+static struct i2c_board_info i2c_camera[] = {
+ {
+ I2C_BOARD_INFO("tw9910", 0x45),
+ },
+};
+
+/* tw9910 */
+static int tw9910_power(struct device *dev, int mode)
+{
+ int val = mode ? 0 : 1;
+
+ gpio_set_value(GPIO_PTU2, val);
+ if (mode)
+ mdelay(100);
+
+ return 0;
+}
+
+static struct tw9910_video_info tw9910_info = {
+ .buswidth = SOCAM_DATAWIDTH_8,
+ .mpout = TW9910_MPO_FIELD,
+};
+
+static struct soc_camera_link tw9910_link = {
+ .i2c_adapter_id = 0,
+ .bus_id = 1,
+ .power = tw9910_power,
+ .board_info = &i2c_camera[0],
+ .module_name = "tw9910",
+ .priv = &tw9910_info,
+};
+
+
+static struct platform_device camera_devices[] = {
+ {
+ .name = "soc-camera-pdrv",
+ .id = 0,
+ .dev = {
+ .platform_data = &tw9910_link,
+ },
+ },
+};
+
static struct platform_device *ecovec_devices[] __initdata = {
&heartbeat_device,
&nor_flash_device,
@@ -581,6 +626,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
#else
&msiof0_device,
#endif
+ &camera_devices[0],
};
#define EEPROM_ADDR 0x50
@@ -893,6 +939,10 @@ static int __init arch_setup(void)
spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
#endif
+ /* enable Video */
+ gpio_request(GPIO_PTU2, NULL);
+ gpio_direction_output(GPIO_PTU2, 1);
+
/* enable I2C device */
i2c_register_board_info(1, i2c1_devices,
ARRAY_SIZE(i2c1_devices));
OpenPOWER on IntegriCloud