aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-12-15 00:37:16 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-12-15 08:02:46 -0500
commit207efd07e8c7b4da1f6f9940c40e20b8afc9195c (patch)
tree1aafdce0d8f5b24882e0e28dd7e043dbe00eda0e /arch/sh
parent1ce4da7a502ea637748bc55460fc43eb2acc4f01 (diff)
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 cfd958c613d4..d4ac32b63572 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -28,6 +28,7 @@
28#include <linux/mfd/sh_mobile_sdhi.h> 28#include <linux/mfd/sh_mobile_sdhi.h>
29#include <video/sh_mobile_lcdc.h> 29#include <video/sh_mobile_lcdc.h>
30#include <media/sh_mobile_ceu.h> 30#include <media/sh_mobile_ceu.h>
31#include <media/tw9910.h>
31#include <asm/heartbeat.h> 32#include <asm/heartbeat.h>
32#include <asm/sh_eth.h> 33#include <asm/sh_eth.h>
33#include <asm/clock.h> 34#include <asm/clock.h>
@@ -565,6 +566,50 @@ static struct platform_device msiof0_device = {
565 566
566#endif 567#endif
567 568
569/* I2C Video */
570static struct i2c_board_info i2c_camera[] = {
571 {
572 I2C_BOARD_INFO("tw9910", 0x45),
573 },
574};
575
576/* tw9910 */
577static int tw9910_power(struct device *dev, int mode)
578{
579 int val = mode ? 0 : 1;
580
581 gpio_set_value(GPIO_PTU2, val);
582 if (mode)
583 mdelay(100);
584
585 return 0;
586}
587
588static struct tw9910_video_info tw9910_info = {
589 .buswidth = SOCAM_DATAWIDTH_8,
590 .mpout = TW9910_MPO_FIELD,
591};
592
593static struct soc_camera_link tw9910_link = {
594 .i2c_adapter_id = 0,
595 .bus_id = 1,
596 .power = tw9910_power,
597 .board_info = &i2c_camera[0],
598 .module_name = "tw9910",
599 .priv = &tw9910_info,
600};
601
602
603static struct platform_device camera_devices[] = {
604 {
605 .name = "soc-camera-pdrv",
606 .id = 0,
607 .dev = {
608 .platform_data = &tw9910_link,
609 },
610 },
611};
612
568static struct platform_device *ecovec_devices[] __initdata = { 613static struct platform_device *ecovec_devices[] __initdata = {
569 &heartbeat_device, 614 &heartbeat_device,
570 &nor_flash_device, 615 &nor_flash_device,
@@ -581,6 +626,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
581#else 626#else
582 &msiof0_device, 627 &msiof0_device,
583#endif 628#endif
629 &camera_devices[0],
584}; 630};
585 631
586#define EEPROM_ADDR 0x50 632#define EEPROM_ADDR 0x50
@@ -893,6 +939,10 @@ static int __init arch_setup(void)
893 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); 939 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
894#endif 940#endif
895 941
942 /* enable Video */
943 gpio_request(GPIO_PTU2, NULL);
944 gpio_direction_output(GPIO_PTU2, 1);
945
896 /* enable I2C device */ 946 /* enable I2C device */
897 i2c_register_board_info(1, i2c1_devices, 947 i2c_register_board_info(1, i2c1_devices,
898 ARRAY_SIZE(i2c1_devices)); 948 ARRAY_SIZE(i2c1_devices));