aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-ecovec24/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c87
1 files changed, 85 insertions, 2 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 62123885a6fa..49714258732e 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mfd/sh_mobile_sdhi.h>
14#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
15#include <linux/gpio.h> 16#include <linux/gpio.h>
16#include <linux/interrupt.h> 17#include <linux/interrupt.h>
@@ -442,7 +443,9 @@ static void sdhi0_set_pwr(struct platform_device *pdev, int state)
442} 443}
443 444
444static struct sh_mobile_sdhi_info sdhi0_info = { 445static struct sh_mobile_sdhi_info sdhi0_info = {
445 .set_pwr = sdhi0_set_pwr, 446 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
447 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
448 .set_pwr = sdhi0_set_pwr,
446}; 449};
447 450
448static struct resource sdhi0_resources[] = { 451static struct resource sdhi0_resources[] = {
@@ -478,7 +481,9 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
478} 481}
479 482
480static struct sh_mobile_sdhi_info sdhi1_info = { 483static struct sh_mobile_sdhi_info sdhi1_info = {
481 .set_pwr = sdhi1_set_pwr, 484 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
485 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
486 .set_pwr = sdhi1_set_pwr,
482}; 487};
483 488
484static struct resource sdhi1_resources[] = { 489static struct resource sdhi1_resources[] = {
@@ -769,6 +774,51 @@ static struct platform_device irda_device = {
769 .resource = irda_resources, 774 .resource = irda_resources,
770}; 775};
771 776
777#include <media/ak881x.h>
778#include <media/sh_vou.h>
779
780struct ak881x_pdata ak881x_pdata = {
781 .flags = AK881X_IF_MODE_SLAVE,
782};
783
784static struct i2c_board_info ak8813 = {
785 I2C_BOARD_INFO("ak8813", 0x20),
786 .platform_data = &ak881x_pdata,
787};
788
789struct sh_vou_pdata sh_vou_pdata = {
790 .bus_fmt = SH_VOU_BUS_8BIT,
791 .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
792 .board_info = &ak8813,
793 .i2c_adap = 0,
794 .module_name = "ak881x",
795};
796
797static struct resource sh_vou_resources[] = {
798 [0] = {
799 .start = 0xfe960000,
800 .end = 0xfe962043,
801 .flags = IORESOURCE_MEM,
802 },
803 [1] = {
804 .start = 55,
805 .flags = IORESOURCE_IRQ,
806 },
807};
808
809static struct platform_device vou_device = {
810 .name = "sh-vou",
811 .id = -1,
812 .num_resources = ARRAY_SIZE(sh_vou_resources),
813 .resource = sh_vou_resources,
814 .dev = {
815 .platform_data = &sh_vou_pdata,
816 },
817 .archdata = {
818 .hwblk_id = HWBLK_VOU,
819 },
820};
821
772static struct platform_device *ecovec_devices[] __initdata = { 822static struct platform_device *ecovec_devices[] __initdata = {
773 &heartbeat_device, 823 &heartbeat_device,
774 &nor_flash_device, 824 &nor_flash_device,
@@ -790,6 +840,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
790 &camera_devices[2], 840 &camera_devices[2],
791 &fsi_device, 841 &fsi_device,
792 &irda_device, 842 &irda_device,
843 &vou_device,
793}; 844};
794 845
795#ifdef CONFIG_I2C 846#ifdef CONFIG_I2C
@@ -1179,6 +1230,38 @@ static int __init arch_setup(void)
1179 i2c_register_board_info(1, i2c1_devices, 1230 i2c_register_board_info(1, i2c1_devices,
1180 ARRAY_SIZE(i2c1_devices)); 1231 ARRAY_SIZE(i2c1_devices));
1181 1232
1233 /* VOU */
1234 gpio_request(GPIO_FN_DV_D15, NULL);
1235 gpio_request(GPIO_FN_DV_D14, NULL);
1236 gpio_request(GPIO_FN_DV_D13, NULL);
1237 gpio_request(GPIO_FN_DV_D12, NULL);
1238 gpio_request(GPIO_FN_DV_D11, NULL);
1239 gpio_request(GPIO_FN_DV_D10, NULL);
1240 gpio_request(GPIO_FN_DV_D9, NULL);
1241 gpio_request(GPIO_FN_DV_D8, NULL);
1242 gpio_request(GPIO_FN_DV_CLKI, NULL);
1243 gpio_request(GPIO_FN_DV_CLK, NULL);
1244 gpio_request(GPIO_FN_DV_VSYNC, NULL);
1245 gpio_request(GPIO_FN_DV_HSYNC, NULL);
1246
1247 /* AK8813 power / reset sequence */
1248 gpio_request(GPIO_PTG4, NULL);
1249 gpio_request(GPIO_PTU3, NULL);
1250 /* Reset */
1251 gpio_direction_output(GPIO_PTG4, 0);
1252 /* Power down */
1253 gpio_direction_output(GPIO_PTU3, 1);
1254
1255 udelay(10);
1256
1257 /* Power up, reset */
1258 gpio_set_value(GPIO_PTU3, 0);
1259
1260 udelay(10);
1261
1262 /* Remove reset */
1263 gpio_set_value(GPIO_PTG4, 1);
1264
1182 return platform_add_devices(ecovec_devices, 1265 return platform_add_devices(ecovec_devices,
1183 ARRAY_SIZE(ecovec_devices)); 1266 ARRAY_SIZE(ecovec_devices));
1184} 1267}