21 #include <linux/input.h>
23 #include <linux/i2c.h>
27 #include <linux/videodev2.h>
33 #include <asm/suspend.h>
34 #include <asm/clock.h>
35 #include <asm/machvec.h>
45 .size = (4 * 1024 * 1024),
57 .parts = kfr2r09_nor_flash_partitions,
58 .nr_parts =
ARRAY_SIZE(kfr2r09_nor_flash_partitions),
61 static struct resource kfr2r09_nor_flash_resources[] = {
71 .name =
"physmap-flash",
72 .resource = kfr2r09_nor_flash_resources,
73 .num_resources =
ARRAY_SIZE(kfr2r09_nor_flash_resources),
75 .platform_data = &kfr2r09_nor_flash_data,
79 static struct resource kfr2r09_nand_flash_resources[] = {
89 .name =
"onenand-flash",
90 .resource = kfr2r09_nand_flash_resources,
91 .num_resources =
ARRAY_SIZE(kfr2r09_nand_flash_resources),
108 static struct resource kfr2r09_sh_keysc_resources[] = {
124 .num_resources =
ARRAY_SIZE(kfr2r09_sh_keysc_resources),
125 .resource = kfr2r09_sh_keysc_resources,
127 .platform_data = &kfr2r09_sh_keysc_info,
131 static const struct fb_videomode kfr2r09_lcdc_modes[] = {
133 .name =
"TX07D34VM0AAA",
151 .interface_type =
SYS18,
154 .lcd_modes = kfr2r09_lcdc_modes,
165 .ldmt2r = 0x07010904,
166 .ldmt3r = 0x14012914,
168 .deferred_io_msec = 1000,
173 static struct resource kfr2r09_sh_lcdc_resources[] = {
187 .name =
"sh_mobile_lcdc_fb",
188 .num_resources =
ARRAY_SIZE(kfr2r09_sh_lcdc_resources),
189 .resource = kfr2r09_sh_lcdc_resources,
191 .platform_data = &kfr2r09_sh_lcdc_info,
199 static struct resource kfr2r09_usb0_gadget_resources[] = {
213 .name =
"r8a66597_udc",
217 .coherent_dma_mask = 0xffffffff,
218 .platform_data = &kfr2r09_usb0_gadget_data,
220 .num_resources =
ARRAY_SIZE(kfr2r09_usb0_gadget_resources),
221 .resource = kfr2r09_usb0_gadget_resources,
228 static struct resource kfr2r09_ceu_resources[] = {
246 .name =
"sh_mobile_ceu",
248 .num_resources =
ARRAY_SIZE(kfr2r09_ceu_resources),
249 .resource = kfr2r09_ceu_resources,
251 .platform_data = &sh_mobile_ceu_info,
259 static struct clk *camera_clk;
262 #define CEU_MCLK_FREQ 25000000
264 #define DRVCRB 0xA405018C
273 if (IS_ERR(camera_clk))
274 return PTR_ERR(camera_clk);
332 .power = camera_power,
333 .board_info = &kfr2r09_i2c_camera,
335 .priv = &rj54n1_priv,
339 .name =
"soc-camera-pdrv",
342 .platform_data = &rj54n1_link,
353 static struct resource kfr2r09_sh_sdhi0_resources[] = {
374 .name =
"sh_mobile_sdhi",
375 .num_resources =
ARRAY_SIZE(kfr2r09_sh_sdhi0_resources),
376 .resource = kfr2r09_sh_sdhi0_resources,
378 .platform_data = &sh7724_sdhi0_data,
383 &kfr2r09_nor_flash_device,
384 &kfr2r09_nand_flash_device,
385 &kfr2r09_sh_keysc_device,
386 &kfr2r09_sh_lcdc_device,
389 &kfr2r09_sh_sdhi0_device,
392 #define BSC_CS0BCR 0xfec10004
393 #define BSC_CS0WCR 0xfec10024
394 #define BSC_CS4BCR 0xfec10010
395 #define BSC_CS4WCR 0xfec10030
396 #define PORT_MSELCRB 0xa4050182
399 static int kfr2r09_usb0_gadget_i2c_setup(
void)
403 unsigned char buf[2];
429 buf[1] = buf[0] | (1 << 1);
442 static int kfr2r09_serial_i2c_setup(
void)
446 unsigned char buf[2];
472 buf[1] = buf[0] | (1 << 6);
485 static int kfr2r09_usb0_gadget_i2c_setup(
void)
490 static int kfr2r09_serial_i2c_setup(
void)
496 static int kfr2r09_usb0_gadget_setup(
void)
506 if (kfr2r09_usb0_gadget_i2c_setup() != 0)
525 static int __init kfr2r09_devices_setup(
void)
530 &kfr2r09_sdram_enter_start,
531 &kfr2r09_sdram_enter_end,
532 &kfr2r09_sdram_leave_start,
533 &kfr2r09_sdram_leave_end);
536 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
541 kfr2r09_serial_i2c_setup();
598 if (kfr2r09_usb0_gadget_setup() == 0)
633 static int kfr2r09_mode_pins(
void)
647 .mv_name =
"kfr2r09",
648 .mv_mode_pins = kfr2r09_mode_pins,