12 #include <linux/device.h>
26 #include <linux/i2c.h>
31 #include <linux/input.h>
35 #include <linux/videodev2.h>
44 #include <asm/clock.h>
45 #include <asm/suspend.h>
74 static unsigned char led_pos[] = { 0, 1, 2, 3 };
81 static struct resource heartbeat_resource = {
83 .end = 0xA405012E - 1,
91 .platform_data = &heartbeat_data,
94 .resource = &heartbeat_resource,
100 .name =
"boot loader",
102 .size = (5 * 1024 * 1024),
113 .parts = nor_flash_partitions,
117 static struct resource nor_flash_resources[] = {
127 .name =
"physmap-flash",
128 .resource = nor_flash_resources,
129 .num_resources =
ARRAY_SIZE(nor_flash_resources),
131 .platform_data = &nor_flash_data,
136 #define SH_ETH_ADDR (0xA4600000)
137 static struct resource sh_eth_resources[] = {
154 .ether_link_active_low = 1
161 .platform_data = &sh_eth_plat,
163 .num_resources =
ARRAY_SIZE(sh_eth_resources),
164 .resource = sh_eth_resources,
168 static void usb0_port_power(
int port,
int power)
175 .port_power = usb0_port_power,
178 static struct resource usb0_host_resources[] = {
181 .end = 0xa4d80124 - 1,
192 .name =
"r8a66597_hcd",
196 .coherent_dma_mask = 0xffffffff,
197 .platform_data = &usb0_host_data,
199 .num_resources =
ARRAY_SIZE(usb0_host_resources),
200 .resource = usb0_host_resources,
204 static void usb1_port_power(
int port,
int power)
211 .port_power = usb1_port_power,
214 static struct resource usb1_common_resources[] = {
217 .end = 0xa4d90124 - 1,
232 .coherent_dma_mask = 0xffffffff,
233 .platform_data = &usb1_common_data,
235 .num_resources =
ARRAY_SIZE(usb1_common_resources),
236 .resource = usb1_common_resources,
255 .platform_callback = {
256 .get_id = usbhs_get_id,
257 .phy_reset = usbhs_phy_reset,
261 .detection_delay = 5,
269 static struct resource usbhs_resources[] = {
272 .end = 0xa4d90124 - 1,
283 .name =
"renesas_usbhs",
287 .coherent_dma_mask = 0xffffffff,
288 .platform_data = &usbhs_info,
291 .resource = usbhs_resources,
325 static int ecovec24_set_brightness(
int brightness)
332 static int ecovec24_get_brightness(
void)
339 .interface_type =
RGB18,
347 .name =
"sh_mobile_lcdc_bl",
349 .set_brightness = ecovec24_set_brightness,
350 .get_brightness = ecovec24_get_brightness,
355 static struct resource lcdc_resources[] = {
369 .name =
"sh_mobile_lcdc_fb",
371 .resource = lcdc_resources,
373 .platform_data = &lcdc_info,
382 static struct resource ceu0_resources[] = {
399 .name =
"sh_mobile_ceu",
402 .resource = ceu0_resources,
404 .platform_data = &sh_mobile_ceu0_info,
413 static struct resource ceu1_resources[] = {
430 .name =
"sh_mobile_ceu",
433 .resource = ceu1_resources,
435 .platform_data = &sh_mobile_ceu1_info,
462 .keycodes = {
KEY_1, 0, 0, 0, 0,
467 KEY_6, 0, 0, 0, 0, },
470 static struct resource keysc_resources[] = {
487 .resource = keysc_resources,
489 .platform_data = &keysc_info,
494 #define IRQ0 evt2irq(0x600)
496 static int ts_get_pendown_state(
void)
511 static int ts_init(
void)
520 .get_pendown_state = ts_get_pendown_state,
521 .init_platform_hw = ts_init,
527 .platform_data = &tsc2007_info,
543 .num_consumer_supplies =
ARRAY_SIZE(cn12_power_consumers),
544 .consumer_supplies = cn12_power_consumers,
548 .supply_name =
"CN12 SD/MMC Vdd",
549 .microvolts = 3300000,
552 .init_data = &cn12_power_init_data,
556 .name =
"reg-fixed-voltage",
559 .platform_data = &cn12_power_info,
563 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
575 .num_consumer_supplies =
ARRAY_SIZE(sdhi0_power_consumers),
576 .consumer_supplies = sdhi0_power_consumers,
581 .microvolts = 3300000,
584 .init_data = &sdhi0_power_init_data,
588 .
name =
"reg-fixed-voltage",
591 .platform_data = &sdhi0_power_info,
597 static int power_gpio = -
EINVAL;
599 if (power_gpio < 0) {
622 .set_pwr = sdhi0_set_pwr,
625 .get_cd = sdhi0_get_cd,
628 static struct resource sdhi0_resources[] = {
642 .
name =
"sh_mobile_sdhi",
644 .resource = sdhi0_resources,
647 .platform_data = &sdhi0_info,
653 static int power_gpio = -
EINVAL;
655 if (power_gpio < 0) {
670 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
682 .set_pwr = cn12_set_pwr,
683 .get_cd = sdhi1_get_cd,
686 static struct resource sdhi1_resources[] = {
700 .
name =
"sh_mobile_sdhi",
702 .resource = sdhi1_resources,
705 .platform_data = &sdhi1_info,
713 static int mmc_spi_get_ro(
struct device *
dev)
718 static int mmc_spi_get_cd(
struct device *
dev)
729 .get_ro = mmc_spi_get_ro,
730 .get_cd = mmc_spi_get_cd,
733 .setpower = mmc_spi_setpower,
738 .modalias =
"mmc_spi",
739 .platform_data = &mmc_spi_info,
740 .max_speed_hz = 5000000,
751 static struct resource msiof0_resources[] = {
765 .name =
"spi_sh_msiof",
768 .platform_data = &msiof0_data,
770 .num_resources =
ARRAY_SIZE(msiof0_resources),
771 .resource = msiof0_resources,
794 int val = mode ? 0 : 1;
811 .power = tw9910_power,
812 .board_info = &i2c_camera[0],
813 .priv = &tw9910_info,
817 static int mt9t112_power1(
struct device *dev,
int mode)
828 .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 },
833 .power = mt9t112_power1,
835 .board_info = &i2c_camera[1],
836 .priv = &mt9t112_info1,
839 static int mt9t112_power2(
struct device *dev,
int mode)
850 .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 },
855 .power = mt9t112_power2,
857 .board_info = &i2c_camera[2],
858 .priv = &mt9t112_info2,
863 .name =
"soc-camera-pdrv",
866 .platform_data = &tw9910_link,
870 .name =
"soc-camera-pdrv",
873 .platform_data = &mt9t112_link1,
877 .name =
"soc-camera-pdrv",
880 .platform_data = &mt9t112_link2,
892 static struct resource fsi_resources[] = {
909 .resource = fsi_resources,
911 .platform_data = &fsi_info,
923 .card =
"FSIB-DA7210",
924 .cpu_dai =
"fsib-dai",
925 .codec =
"da7210.0-001a",
926 .platform =
"sh_fsi.0",
927 .codec_dai =
"da7210-hifi",
928 .init = &fsi_da7210_init_info,
932 .name =
"asoc-simple-card",
934 .platform_data = &fsi_da7210_info,
940 static struct resource irda_resources[] = {
956 .resource = irda_resources,
968 .platform_data = &ak881x_pdata,
974 .board_info = &ak8813,
978 static struct resource sh_vou_resources[] = {
993 .num_resources =
ARRAY_SIZE(sh_vou_resources),
994 .resource = sh_vou_resources,
996 .platform_data = &sh_vou_pdata,
1000 #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1004 cn12_set_pwr(pdev, 0);
1007 static struct resource sh_mmcif_resources[] = {
1010 .start = 0xA4CA0000,
1028 .down_pwr = mmcif_down_pwr,
1040 .platform_data = &sh_mmcif_plat,
1042 .num_resources =
ARRAY_SIZE(sh_mmcif_resources),
1043 .resource = sh_mmcif_resources,
1052 &usb1_common_device,
1059 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1062 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1075 #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1081 #define EEPROM_ADDR 0x50
1088 msg[0].addr = EEPROM_ADDR;
1093 msg[1].addr = EEPROM_ADDR;
1113 pr_err(
"can not get I2C 1\n");
1118 for (i = 0; i <
sizeof(pd->
mac_addr); i++) {
1119 pd->
mac_addr[
i] = mac_read(a, 0x10 + i);
1128 pr_err(
"unable to read sh_eth MAC address\n");
1132 #define PORT_HIZA 0xA4050158
1133 #define IODRIVEA 0xA405018A
1140 static int __init arch_setup(
void)
1143 bool cn12_enabled =
false;
1148 &ecovec24_sdram_enter_start,
1149 &ecovec24_sdram_enter_end,
1150 &ecovec24_sdram_leave_start,
1151 &ecovec24_sdram_leave_end);
1204 usb1_common_device.
name =
"r8a66597_udc";
1207 usb1_common_device.
name =
"r8a66597_hcd";
1258 lcdc_info.
ch[0].clock_divider = 1;
1259 lcdc_info.
ch[0].lcd_modes = ecovec_dvi_modes;
1260 lcdc_info.
ch[0].num_modes =
ARRAY_SIZE(ecovec_dvi_modes);
1267 lcdc_info.
ch[0].clock_divider = 2;
1268 lcdc_info.
ch[0].lcd_modes = ecovec_lcd_modes;
1269 lcdc_info.
ch[0].num_modes =
ARRAY_SIZE(ecovec_lcd_modes);
1349 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1374 #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1387 cn12_enabled =
true;
1388 #elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1402 cn12_enabled =
true;
1475 #if defined(CONFIG_VIDEO_SH_VOU) || defined(CONFIG_VIDEO_SH_VOU_MODULE)
1514 static int __init devices_setup(
void)
1516 sh_eth_init(&sh_eth_plat);
1522 .mv_name =
"R0P7724 (EcoVec)",