diff options
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 78 |
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 | |||
775 | struct ak881x_pdata ak881x_pdata = { | ||
776 | .flags = AK881X_IF_MODE_SLAVE, | ||
777 | }; | ||
778 | |||
779 | static struct i2c_board_info ak8813 = { | ||
780 | I2C_BOARD_INFO("ak8813", 0x20), | ||
781 | .platform_data = &ak881x_pdata, | ||
782 | }; | ||
783 | |||
784 | struct 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 | |||
792 | static 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 | |||
804 | static 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 | |||
772 | static struct platform_device *ecovec_devices[] __initdata = { | 817 | static 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 | } |