aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-ecovec24/setup.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-04-21 04:45:25 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-22 03:42:15 -0400
commitaee5ab0bbd224b618408cacfcc656699feec4230 (patch)
treebd63516b5cd28080c854f397a1a17af346c5fdec /arch/sh/boards/mach-ecovec24/setup.c
parentd8252d6272682096835b4e1ef714cb1b593aa7fb (diff)
sh: add Video Output Unit and AK8813 video encoder support on ecovec
Ecovec uses the AK8813 video envoder similarly to the ms7724se platform with the only difference, that on ecovec GPIOs are used for resetting and powering up and down the chip. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 62123885a6fa..7bca78118039 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -769,6 +769,51 @@ static struct platform_device irda_device = {
769 .resource = irda_resources, 769 .resource = irda_resources,
770}; 770};
771 771
772#include <media/ak881x.h>
773#include <media/sh_vou.h>
774
775struct ak881x_pdata ak881x_pdata = {
776 .flags = AK881X_IF_MODE_SLAVE,
777};
778
779static struct i2c_board_info ak8813 = {
780 I2C_BOARD_INFO("ak8813", 0x20),
781 .platform_data = &ak881x_pdata,
782};
783
784struct sh_vou_pdata sh_vou_pdata = {
785 .bus_fmt = SH_VOU_BUS_8BIT,
786 .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
787 .board_info = &ak8813,
788 .i2c_adap = 0,
789 .module_name = "ak881x",
790};
791
792static struct resource sh_vou_resources[] = {
793 [0] = {
794 .start = 0xfe960000,
795 .end = 0xfe962043,
796 .flags = IORESOURCE_MEM,
797 },
798 [1] = {
799 .start = 55,
800 .flags = IORESOURCE_IRQ,
801 },
802};
803
804static struct platform_device vou_device = {
805 .name = "sh-vou",
806 .id = -1,
807 .num_resources = ARRAY_SIZE(sh_vou_resources),
808 .resource = sh_vou_resources,
809 .dev = {
810 .platform_data = &sh_vou_pdata,
811 },
812 .archdata = {
813 .hwblk_id = HWBLK_VOU,
814 },
815};
816
772static struct platform_device *ecovec_devices[] __initdata = { 817static struct platform_device *ecovec_devices[] __initdata = {
773 &heartbeat_device, 818 &heartbeat_device,
774 &nor_flash_device, 819 &nor_flash_device,
@@ -790,6 +835,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
790 &camera_devices[2], 835 &camera_devices[2],
791 &fsi_device, 836 &fsi_device,
792 &irda_device, 837 &irda_device,
838 &vou_device,
793}; 839};
794 840
795#ifdef CONFIG_I2C 841#ifdef CONFIG_I2C
@@ -1179,6 +1225,38 @@ static int __init arch_setup(void)
1179 i2c_register_board_info(1, i2c1_devices, 1225 i2c_register_board_info(1, i2c1_devices,
1180 ARRAY_SIZE(i2c1_devices)); 1226 ARRAY_SIZE(i2c1_devices));
1181 1227
1228 /* VOU */
1229 gpio_request(GPIO_FN_DV_D15, NULL);
1230 gpio_request(GPIO_FN_DV_D14, NULL);
1231 gpio_request(GPIO_FN_DV_D13, NULL);
1232 gpio_request(GPIO_FN_DV_D12, NULL);
1233 gpio_request(GPIO_FN_DV_D11, NULL);
1234 gpio_request(GPIO_FN_DV_D10, NULL);
1235 gpio_request(GPIO_FN_DV_D9, NULL);
1236 gpio_request(GPIO_FN_DV_D8, NULL);
1237 gpio_request(GPIO_FN_DV_CLKI, NULL);
1238 gpio_request(GPIO_FN_DV_CLK, NULL);
1239 gpio_request(GPIO_FN_DV_VSYNC, NULL);
1240 gpio_request(GPIO_FN_DV_HSYNC, NULL);
1241
1242 /* AK8813 power / reset sequence */
1243 gpio_request(GPIO_PTG4, NULL);
1244 gpio_request(GPIO_PTU3, NULL);
1245 /* Reset */
1246 gpio_direction_output(GPIO_PTG4, 0);
1247 /* Power down */
1248 gpio_direction_output(GPIO_PTU3, 1);
1249
1250 udelay(10);
1251
1252 /* Power up, reset */
1253 gpio_set_value(GPIO_PTU3, 0);
1254
1255 udelay(10);
1256
1257 /* Remove reset */
1258 gpio_set_value(GPIO_PTG4, 1);
1259
1182 return platform_add_devices(ecovec_devices, 1260 return platform_add_devices(ecovec_devices,
1183 ARRAY_SIZE(ecovec_devices)); 1261 ARRAY_SIZE(ecovec_devices));
1184} 1262}