setup.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /*
  2. * Renesas System Solutions Asia Pte. Ltd - Migo-R
  3. *
  4. * Copyright (C) 2008 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/input.h>
  14. #include <linux/mtd/physmap.h>
  15. #include <linux/mtd/nand.h>
  16. #include <linux/i2c.h>
  17. #include <linux/smc91x.h>
  18. #include <linux/delay.h>
  19. #include <linux/clk.h>
  20. #include <linux/gpio.h>
  21. #include <media/soc_camera_platform.h>
  22. #include <media/sh_mobile_ceu.h>
  23. #include <video/sh_mobile_lcdc.h>
  24. #include <asm/clock.h>
  25. #include <asm/machvec.h>
  26. #include <asm/io.h>
  27. #include <asm/sh_keysc.h>
  28. #include <mach/migor.h>
  29. #include <cpu/sh7722.h>
  30. /* Address IRQ Size Bus Description
  31. * 0x00000000 64MB 16 NOR Flash (SP29PL256N)
  32. * 0x0c000000 64MB 64 SDRAM (2xK4M563233G)
  33. * 0x10000000 IRQ0 16 Ethernet (SMC91C111)
  34. * 0x14000000 IRQ4 16 USB 2.0 Host Controller (M66596)
  35. * 0x18000000 8GB 8 NAND Flash (K9K8G08U0A)
  36. */
  37. static struct smc91x_platdata smc91x_info = {
  38. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  39. };
  40. static struct resource smc91x_eth_resources[] = {
  41. [0] = {
  42. .name = "SMC91C111" ,
  43. .start = 0x10000300,
  44. .end = 0x1000030f,
  45. .flags = IORESOURCE_MEM,
  46. },
  47. [1] = {
  48. .start = 32, /* IRQ0 */
  49. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  50. },
  51. };
  52. static struct platform_device smc91x_eth_device = {
  53. .name = "smc91x",
  54. .num_resources = ARRAY_SIZE(smc91x_eth_resources),
  55. .resource = smc91x_eth_resources,
  56. .dev = {
  57. .platform_data = &smc91x_info,
  58. },
  59. };
  60. static struct sh_keysc_info sh_keysc_info = {
  61. .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
  62. .scan_timing = 3,
  63. .delay = 5,
  64. .keycodes = {
  65. 0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
  66. 0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
  67. 0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
  68. 0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
  69. 0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
  70. },
  71. };
  72. static struct resource sh_keysc_resources[] = {
  73. [0] = {
  74. .start = 0x044b0000,
  75. .end = 0x044b000f,
  76. .flags = IORESOURCE_MEM,
  77. },
  78. [1] = {
  79. .start = 79,
  80. .flags = IORESOURCE_IRQ,
  81. },
  82. };
  83. static struct platform_device sh_keysc_device = {
  84. .name = "sh_keysc",
  85. .id = 0, /* "keysc0" clock */
  86. .num_resources = ARRAY_SIZE(sh_keysc_resources),
  87. .resource = sh_keysc_resources,
  88. .dev = {
  89. .platform_data = &sh_keysc_info,
  90. },
  91. };
  92. static struct mtd_partition migor_nor_flash_partitions[] =
  93. {
  94. {
  95. .name = "uboot",
  96. .offset = 0,
  97. .size = (1 * 1024 * 1024),
  98. .mask_flags = MTD_WRITEABLE, /* Read-only */
  99. },
  100. {
  101. .name = "rootfs",
  102. .offset = MTDPART_OFS_APPEND,
  103. .size = (15 * 1024 * 1024),
  104. },
  105. {
  106. .name = "other",
  107. .offset = MTDPART_OFS_APPEND,
  108. .size = MTDPART_SIZ_FULL,
  109. },
  110. };
  111. static struct physmap_flash_data migor_nor_flash_data = {
  112. .width = 2,
  113. .parts = migor_nor_flash_partitions,
  114. .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions),
  115. };
  116. static struct resource migor_nor_flash_resources[] = {
  117. [0] = {
  118. .name = "NOR Flash",
  119. .start = 0x00000000,
  120. .end = 0x03ffffff,
  121. .flags = IORESOURCE_MEM,
  122. }
  123. };
  124. static struct platform_device migor_nor_flash_device = {
  125. .name = "physmap-flash",
  126. .resource = migor_nor_flash_resources,
  127. .num_resources = ARRAY_SIZE(migor_nor_flash_resources),
  128. .dev = {
  129. .platform_data = &migor_nor_flash_data,
  130. },
  131. };
  132. static struct mtd_partition migor_nand_flash_partitions[] = {
  133. {
  134. .name = "nanddata1",
  135. .offset = 0x0,
  136. .size = 512 * 1024 * 1024,
  137. },
  138. {
  139. .name = "nanddata2",
  140. .offset = MTDPART_OFS_APPEND,
  141. .size = 512 * 1024 * 1024,
  142. },
  143. };
  144. static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
  145. unsigned int ctrl)
  146. {
  147. struct nand_chip *chip = mtd->priv;
  148. if (cmd == NAND_CMD_NONE)
  149. return;
  150. if (ctrl & NAND_CLE)
  151. writeb(cmd, chip->IO_ADDR_W + 0x00400000);
  152. else if (ctrl & NAND_ALE)
  153. writeb(cmd, chip->IO_ADDR_W + 0x00800000);
  154. else
  155. writeb(cmd, chip->IO_ADDR_W);
  156. }
  157. static int migor_nand_flash_ready(struct mtd_info *mtd)
  158. {
  159. return gpio_get_value(GPIO_PTA1); /* NAND_RBn */
  160. }
  161. struct platform_nand_data migor_nand_flash_data = {
  162. .chip = {
  163. .nr_chips = 1,
  164. .partitions = migor_nand_flash_partitions,
  165. .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
  166. .chip_delay = 20,
  167. .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
  168. },
  169. .ctrl = {
  170. .dev_ready = migor_nand_flash_ready,
  171. .cmd_ctrl = migor_nand_flash_cmd_ctl,
  172. },
  173. };
  174. static struct resource migor_nand_flash_resources[] = {
  175. [0] = {
  176. .name = "NAND Flash",
  177. .start = 0x18000000,
  178. .end = 0x18ffffff,
  179. .flags = IORESOURCE_MEM,
  180. },
  181. };
  182. static struct platform_device migor_nand_flash_device = {
  183. .name = "gen_nand",
  184. .resource = migor_nand_flash_resources,
  185. .num_resources = ARRAY_SIZE(migor_nand_flash_resources),
  186. .dev = {
  187. .platform_data = &migor_nand_flash_data,
  188. }
  189. };
  190. static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
  191. #ifdef CONFIG_SH_MIGOR_RTA_WVGA
  192. .clock_source = LCDC_CLK_BUS,
  193. .ch[0] = {
  194. .chan = LCDC_CHAN_MAINLCD,
  195. .bpp = 16,
  196. .interface_type = RGB16,
  197. .clock_divider = 2,
  198. .lcd_cfg = {
  199. .name = "LB070WV1",
  200. .xres = 800,
  201. .yres = 480,
  202. .left_margin = 64,
  203. .right_margin = 16,
  204. .hsync_len = 120,
  205. .upper_margin = 1,
  206. .lower_margin = 17,
  207. .vsync_len = 2,
  208. .sync = 0,
  209. },
  210. .lcd_size_cfg = { /* 7.0 inch */
  211. .width = 152,
  212. .height = 91,
  213. },
  214. }
  215. #endif
  216. #ifdef CONFIG_SH_MIGOR_QVGA
  217. .clock_source = LCDC_CLK_PERIPHERAL,
  218. .ch[0] = {
  219. .chan = LCDC_CHAN_MAINLCD,
  220. .bpp = 16,
  221. .interface_type = SYS16A,
  222. .clock_divider = 10,
  223. .lcd_cfg = {
  224. .name = "PH240320T",
  225. .xres = 320,
  226. .yres = 240,
  227. .left_margin = 0,
  228. .right_margin = 16,
  229. .hsync_len = 8,
  230. .upper_margin = 1,
  231. .lower_margin = 17,
  232. .vsync_len = 2,
  233. .sync = FB_SYNC_HOR_HIGH_ACT,
  234. },
  235. .lcd_size_cfg = { /* 2.4 inch */
  236. .width = 49,
  237. .height = 37,
  238. },
  239. .board_cfg = {
  240. .setup_sys = migor_lcd_qvga_setup,
  241. },
  242. .sys_bus_cfg = {
  243. .ldmt2r = 0x06000a09,
  244. .ldmt3r = 0x180e3418,
  245. /* set 1s delay to encourage fsync() */
  246. .deferred_io_msec = 1000,
  247. },
  248. }
  249. #endif
  250. };
  251. static struct resource migor_lcdc_resources[] = {
  252. [0] = {
  253. .name = "LCDC",
  254. .start = 0xfe940000, /* P4-only space */
  255. .end = 0xfe941fff,
  256. .flags = IORESOURCE_MEM,
  257. },
  258. [1] = {
  259. .start = 28,
  260. .flags = IORESOURCE_IRQ,
  261. },
  262. };
  263. static struct platform_device migor_lcdc_device = {
  264. .name = "sh_mobile_lcdc_fb",
  265. .num_resources = ARRAY_SIZE(migor_lcdc_resources),
  266. .resource = migor_lcdc_resources,
  267. .dev = {
  268. .platform_data = &sh_mobile_lcdc_info,
  269. },
  270. };
  271. static struct clk *camera_clk;
  272. static void camera_power_on(void)
  273. {
  274. /* Use 10 MHz VIO_CKO instead of 24 MHz to work
  275. * around signal quality issues on Panel Board V2.1.
  276. */
  277. camera_clk = clk_get(NULL, "video_clk");
  278. clk_set_rate(camera_clk, 10000000);
  279. clk_enable(camera_clk); /* start VIO_CKO */
  280. /* use VIO_RST to take camera out of reset */
  281. mdelay(10);
  282. gpio_set_value(GPIO_PTT3, 0);
  283. mdelay(10);
  284. gpio_set_value(GPIO_PTT3, 1);
  285. mdelay(10); /* wait to let chip come out of reset */
  286. }
  287. static void camera_power_off(void)
  288. {
  289. clk_disable(camera_clk); /* stop VIO_CKO */
  290. clk_put(camera_clk);
  291. gpio_set_value(GPIO_PTT3, 0);
  292. }
  293. static void camera_power(int mode)
  294. {
  295. if (mode)
  296. camera_power_on();
  297. else
  298. camera_power_off();
  299. }
  300. #ifdef CONFIG_I2C
  301. static unsigned char camera_ov772x_magic[] =
  302. {
  303. 0x09, 0x01, 0x0c, 0x20, 0x0d, 0x41, 0x0e, 0x01,
  304. 0x12, 0x00, 0x13, 0x8F, 0x14, 0x4A, 0x15, 0x00,
  305. 0x16, 0x00, 0x17, 0x23, 0x18, 0xa0, 0x19, 0x07,
  306. 0x1a, 0xf0, 0x1b, 0x40, 0x1f, 0x00, 0x20, 0x10,
  307. 0x22, 0xff, 0x23, 0x01, 0x28, 0x00, 0x29, 0xa0,
  308. 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0xf0, 0x2d, 0x00,
  309. 0x2e, 0x00, 0x30, 0x80, 0x31, 0x60, 0x32, 0x00,
  310. 0x33, 0x00, 0x34, 0x00, 0x3d, 0x80, 0x3e, 0xe2,
  311. 0x3f, 0x1f, 0x42, 0x80, 0x43, 0x80, 0x44, 0x80,
  312. 0x45, 0x80, 0x46, 0x00, 0x47, 0x00, 0x48, 0x00,
  313. 0x49, 0x50, 0x4a, 0x30, 0x4b, 0x50, 0x4c, 0x50,
  314. 0x4d, 0x00, 0x4e, 0xef, 0x4f, 0x10, 0x50, 0x60,
  315. 0x51, 0x00, 0x52, 0x00, 0x53, 0x24, 0x54, 0x7a,
  316. 0x55, 0xfc, 0x62, 0xff, 0x63, 0xf0, 0x64, 0x1f,
  317. 0x65, 0x00, 0x66, 0x10, 0x67, 0x00, 0x68, 0x00,
  318. 0x69, 0x5c, 0x6a, 0x11, 0x6b, 0xa2, 0x6c, 0x01,
  319. 0x6d, 0x50, 0x6e, 0x80, 0x6f, 0x80, 0x70, 0x0f,
  320. 0x71, 0x00, 0x72, 0x00, 0x73, 0x0f, 0x74, 0x0f,
  321. 0x75, 0xff, 0x78, 0x10, 0x79, 0x70, 0x7a, 0x70,
  322. 0x7b, 0xf0, 0x7c, 0xf0, 0x7d, 0xf0, 0x7e, 0x0e,
  323. 0x7f, 0x1a, 0x80, 0x31, 0x81, 0x5a, 0x82, 0x69,
  324. 0x83, 0x75, 0x84, 0x7e, 0x85, 0x88, 0x86, 0x8f,
  325. 0x87, 0x96, 0x88, 0xa3, 0x89, 0xaf, 0x8a, 0xc4,
  326. 0x8b, 0xd7, 0x8c, 0xe8, 0x8d, 0x20, 0x8e, 0x00,
  327. 0x8f, 0x00, 0x90, 0x08, 0x91, 0x10, 0x92, 0x1f,
  328. 0x93, 0x01, 0x94, 0x2c, 0x95, 0x24, 0x96, 0x08,
  329. 0x97, 0x14, 0x98, 0x24, 0x99, 0x38, 0x9a, 0x9e,
  330. 0x9b, 0x00, 0x9c, 0x40, 0x9e, 0x11, 0x9f, 0x02,
  331. 0xa0, 0x00, 0xa1, 0x40, 0xa2, 0x40, 0xa3, 0x06,
  332. 0xa4, 0x00, 0xa6, 0x00, 0xa7, 0x40, 0xa8, 0x40,
  333. 0xa9, 0x80, 0xaa, 0x80, 0xab, 0x06, 0xac, 0xff,
  334. 0x12, 0x06, 0x64, 0x3f, 0x12, 0x46, 0x17, 0x3f,
  335. 0x18, 0x50, 0x19, 0x03, 0x1a, 0x78, 0x29, 0x50,
  336. 0x2c, 0x78,
  337. };
  338. static int ov772x_set_capture(struct soc_camera_platform_info *info,
  339. int enable)
  340. {
  341. struct i2c_adapter *a = i2c_get_adapter(0);
  342. struct i2c_msg msg;
  343. int ret = 0;
  344. int i;
  345. if (!enable)
  346. return 0; /* camera_power_off() is enough */
  347. for (i = 0; i < ARRAY_SIZE(camera_ov772x_magic); i += 2) {
  348. u_int8_t buf[8];
  349. msg.addr = 0x21;
  350. msg.buf = buf;
  351. msg.len = 2;
  352. msg.flags = 0;
  353. buf[0] = camera_ov772x_magic[i];
  354. buf[1] = camera_ov772x_magic[i + 1];
  355. ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
  356. }
  357. return ret;
  358. }
  359. static struct soc_camera_platform_info ov772x_info = {
  360. .iface = 0,
  361. .format_name = "RGB565",
  362. .format_depth = 16,
  363. .format = {
  364. .pixelformat = V4L2_PIX_FMT_RGB565,
  365. .colorspace = V4L2_COLORSPACE_SRGB,
  366. .width = 320,
  367. .height = 240,
  368. },
  369. .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
  370. SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
  371. .power = camera_power,
  372. .set_capture = ov772x_set_capture,
  373. };
  374. static struct platform_device migor_camera_device = {
  375. .name = "soc_camera_platform",
  376. .dev = {
  377. .platform_data = &ov772x_info,
  378. },
  379. };
  380. #endif /* CONFIG_I2C */
  381. static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
  382. .flags = SOCAM_MASTER | SOCAM_DATAWIDTH_8 | SOCAM_PCLK_SAMPLE_RISING \
  383. | SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH,
  384. };
  385. static struct resource migor_ceu_resources[] = {
  386. [0] = {
  387. .name = "CEU",
  388. .start = 0xfe910000,
  389. .end = 0xfe91009f,
  390. .flags = IORESOURCE_MEM,
  391. },
  392. [1] = {
  393. .start = 52,
  394. .flags = IORESOURCE_IRQ,
  395. },
  396. [2] = {
  397. /* place holder for contiguous memory */
  398. },
  399. };
  400. static struct platform_device migor_ceu_device = {
  401. .name = "sh_mobile_ceu",
  402. .id = 0, /* "ceu0" clock */
  403. .num_resources = ARRAY_SIZE(migor_ceu_resources),
  404. .resource = migor_ceu_resources,
  405. .dev = {
  406. .platform_data = &sh_mobile_ceu_info,
  407. },
  408. };
  409. static struct platform_device *migor_devices[] __initdata = {
  410. &smc91x_eth_device,
  411. &sh_keysc_device,
  412. &migor_lcdc_device,
  413. &migor_ceu_device,
  414. #ifdef CONFIG_I2C
  415. &migor_camera_device,
  416. #endif
  417. &migor_nor_flash_device,
  418. &migor_nand_flash_device,
  419. };
  420. static struct i2c_board_info migor_i2c_devices[] = {
  421. {
  422. I2C_BOARD_INFO("rs5c372b", 0x32),
  423. },
  424. {
  425. I2C_BOARD_INFO("migor_ts", 0x51),
  426. .irq = 38, /* IRQ6 */
  427. },
  428. };
  429. static int __init migor_devices_setup(void)
  430. {
  431. /* Lit D11 LED */
  432. gpio_request(GPIO_PTJ7, NULL);
  433. gpio_direction_output(GPIO_PTJ7, 1);
  434. gpio_export(GPIO_PTJ7, 0);
  435. /* Lit D12 LED */
  436. gpio_request(GPIO_PTJ5, NULL);
  437. gpio_direction_output(GPIO_PTJ5, 1);
  438. gpio_export(GPIO_PTJ5, 0);
  439. /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */
  440. gpio_request(GPIO_FN_IRQ0, NULL);
  441. ctrl_outl(0x00003400, BSC_CS4BCR);
  442. ctrl_outl(0x00110080, BSC_CS4WCR);
  443. /* KEYSC */
  444. gpio_request(GPIO_FN_KEYOUT0, NULL);
  445. gpio_request(GPIO_FN_KEYOUT1, NULL);
  446. gpio_request(GPIO_FN_KEYOUT2, NULL);
  447. gpio_request(GPIO_FN_KEYOUT3, NULL);
  448. gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
  449. gpio_request(GPIO_FN_KEYIN1, NULL);
  450. gpio_request(GPIO_FN_KEYIN2, NULL);
  451. gpio_request(GPIO_FN_KEYIN3, NULL);
  452. gpio_request(GPIO_FN_KEYIN4, NULL);
  453. gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
  454. /* NAND Flash */
  455. gpio_request(GPIO_FN_CS6A_CE2B, NULL);
  456. ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x0600) | 0x0200, BSC_CS6ABCR);
  457. gpio_request(GPIO_PTA1, NULL);
  458. gpio_direction_input(GPIO_PTA1);
  459. /* Touch Panel */
  460. gpio_request(GPIO_FN_IRQ6, NULL);
  461. /* LCD Panel */
  462. #ifdef CONFIG_SH_MIGOR_QVGA /* LCDC - QVGA - Enable SYS Interface signals */
  463. gpio_request(GPIO_FN_LCDD17, NULL);
  464. gpio_request(GPIO_FN_LCDD16, NULL);
  465. gpio_request(GPIO_FN_LCDD15, NULL);
  466. gpio_request(GPIO_FN_LCDD14, NULL);
  467. gpio_request(GPIO_FN_LCDD13, NULL);
  468. gpio_request(GPIO_FN_LCDD12, NULL);
  469. gpio_request(GPIO_FN_LCDD11, NULL);
  470. gpio_request(GPIO_FN_LCDD10, NULL);
  471. gpio_request(GPIO_FN_LCDD8, NULL);
  472. gpio_request(GPIO_FN_LCDD7, NULL);
  473. gpio_request(GPIO_FN_LCDD6, NULL);
  474. gpio_request(GPIO_FN_LCDD5, NULL);
  475. gpio_request(GPIO_FN_LCDD4, NULL);
  476. gpio_request(GPIO_FN_LCDD3, NULL);
  477. gpio_request(GPIO_FN_LCDD2, NULL);
  478. gpio_request(GPIO_FN_LCDD1, NULL);
  479. gpio_request(GPIO_FN_LCDRS, NULL);
  480. gpio_request(GPIO_FN_LCDCS, NULL);
  481. gpio_request(GPIO_FN_LCDRD, NULL);
  482. gpio_request(GPIO_FN_LCDWR, NULL);
  483. gpio_request(GPIO_PTH2, NULL); /* LCD_DON */
  484. gpio_direction_output(GPIO_PTH2, 1);
  485. #endif
  486. #ifdef CONFIG_SH_MIGOR_RTA_WVGA /* LCDC - WVGA - Enable RGB Interface signals */
  487. gpio_request(GPIO_FN_LCDD15, NULL);
  488. gpio_request(GPIO_FN_LCDD14, NULL);
  489. gpio_request(GPIO_FN_LCDD13, NULL);
  490. gpio_request(GPIO_FN_LCDD12, NULL);
  491. gpio_request(GPIO_FN_LCDD11, NULL);
  492. gpio_request(GPIO_FN_LCDD10, NULL);
  493. gpio_request(GPIO_FN_LCDD9, NULL);
  494. gpio_request(GPIO_FN_LCDD8, NULL);
  495. gpio_request(GPIO_FN_LCDD7, NULL);
  496. gpio_request(GPIO_FN_LCDD6, NULL);
  497. gpio_request(GPIO_FN_LCDD5, NULL);
  498. gpio_request(GPIO_FN_LCDD4, NULL);
  499. gpio_request(GPIO_FN_LCDD3, NULL);
  500. gpio_request(GPIO_FN_LCDD2, NULL);
  501. gpio_request(GPIO_FN_LCDD1, NULL);
  502. gpio_request(GPIO_FN_LCDD0, NULL);
  503. gpio_request(GPIO_FN_LCDLCLK, NULL);
  504. gpio_request(GPIO_FN_LCDDCK, NULL);
  505. gpio_request(GPIO_FN_LCDVEPWC, NULL);
  506. gpio_request(GPIO_FN_LCDVCPWC, NULL);
  507. gpio_request(GPIO_FN_LCDVSYN, NULL);
  508. gpio_request(GPIO_FN_LCDHSYN, NULL);
  509. gpio_request(GPIO_FN_LCDDISP, NULL);
  510. gpio_request(GPIO_FN_LCDDON, NULL);
  511. #endif
  512. /* CEU */
  513. gpio_request(GPIO_FN_VIO_CLK2, NULL);
  514. gpio_request(GPIO_FN_VIO_VD2, NULL);
  515. gpio_request(GPIO_FN_VIO_HD2, NULL);
  516. gpio_request(GPIO_FN_VIO_FLD, NULL);
  517. gpio_request(GPIO_FN_VIO_CKO, NULL);
  518. gpio_request(GPIO_FN_VIO_D15, NULL);
  519. gpio_request(GPIO_FN_VIO_D14, NULL);
  520. gpio_request(GPIO_FN_VIO_D13, NULL);
  521. gpio_request(GPIO_FN_VIO_D12, NULL);
  522. gpio_request(GPIO_FN_VIO_D11, NULL);
  523. gpio_request(GPIO_FN_VIO_D10, NULL);
  524. gpio_request(GPIO_FN_VIO_D9, NULL);
  525. gpio_request(GPIO_FN_VIO_D8, NULL);
  526. gpio_request(GPIO_PTT3, NULL); /* VIO_RST */
  527. gpio_direction_output(GPIO_PTT3, 0);
  528. gpio_request(GPIO_PTT2, NULL); /* TV_IN_EN */
  529. gpio_direction_output(GPIO_PTT2, 1);
  530. gpio_request(GPIO_PTT0, NULL); /* CAM_EN */
  531. #ifdef CONFIG_SH_MIGOR_RTA_WVGA
  532. gpio_direction_output(GPIO_PTT0, 0);
  533. #else
  534. gpio_direction_output(GPIO_PTT0, 1);
  535. #endif
  536. ctrl_outw(ctrl_inw(PORT_MSELCRB) | 0x2000, PORT_MSELCRB); /* D15->D8 */
  537. platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);
  538. i2c_register_board_info(0, migor_i2c_devices,
  539. ARRAY_SIZE(migor_i2c_devices));
  540. return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
  541. }
  542. __initcall(migor_devices_setup);