board-4430sdp.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. /*
  2. * Board support file for OMAP4430 SDP.
  3. *
  4. * Copyright (C) 2009 Texas Instruments
  5. *
  6. * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
  7. *
  8. * Based on mach-omap2/board-3430sdp.c
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/io.h>
  18. #include <linux/gpio.h>
  19. #include <linux/usb/otg.h>
  20. #include <linux/spi/spi.h>
  21. #include <linux/i2c/twl.h>
  22. #include <linux/gpio_keys.h>
  23. #include <linux/regulator/machine.h>
  24. #include <linux/leds.h>
  25. #include <linux/leds_pwm.h>
  26. #include <mach/hardware.h>
  27. #include <mach/omap4-common.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #include <asm/mach/map.h>
  31. #include <plat/board.h>
  32. #include <plat/common.h>
  33. #include <plat/usb.h>
  34. #include <plat/mmc.h>
  35. #include <plat/omap4-keypad.h>
  36. #include <video/omapdss.h>
  37. #include "mux.h"
  38. #include "hsmmc.h"
  39. #include "timer-gp.h"
  40. #include "control.h"
  41. #include "common-board-devices.h"
  42. #define ETH_KS8851_IRQ 34
  43. #define ETH_KS8851_POWER_ON 48
  44. #define ETH_KS8851_QUART 138
  45. #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
  46. #define OMAP4_SFH7741_ENABLE_GPIO 188
  47. #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
  48. #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
  49. static const int sdp4430_keymap[] = {
  50. KEY(0, 0, KEY_E),
  51. KEY(0, 1, KEY_R),
  52. KEY(0, 2, KEY_T),
  53. KEY(0, 3, KEY_HOME),
  54. KEY(0, 4, KEY_F5),
  55. KEY(0, 5, KEY_UNKNOWN),
  56. KEY(0, 6, KEY_I),
  57. KEY(0, 7, KEY_LEFTSHIFT),
  58. KEY(1, 0, KEY_D),
  59. KEY(1, 1, KEY_F),
  60. KEY(1, 2, KEY_G),
  61. KEY(1, 3, KEY_SEND),
  62. KEY(1, 4, KEY_F6),
  63. KEY(1, 5, KEY_UNKNOWN),
  64. KEY(1, 6, KEY_K),
  65. KEY(1, 7, KEY_ENTER),
  66. KEY(2, 0, KEY_X),
  67. KEY(2, 1, KEY_C),
  68. KEY(2, 2, KEY_V),
  69. KEY(2, 3, KEY_END),
  70. KEY(2, 4, KEY_F7),
  71. KEY(2, 5, KEY_UNKNOWN),
  72. KEY(2, 6, KEY_DOT),
  73. KEY(2, 7, KEY_CAPSLOCK),
  74. KEY(3, 0, KEY_Z),
  75. KEY(3, 1, KEY_KPPLUS),
  76. KEY(3, 2, KEY_B),
  77. KEY(3, 3, KEY_F1),
  78. KEY(3, 4, KEY_F8),
  79. KEY(3, 5, KEY_UNKNOWN),
  80. KEY(3, 6, KEY_O),
  81. KEY(3, 7, KEY_SPACE),
  82. KEY(4, 0, KEY_W),
  83. KEY(4, 1, KEY_Y),
  84. KEY(4, 2, KEY_U),
  85. KEY(4, 3, KEY_F2),
  86. KEY(4, 4, KEY_VOLUMEUP),
  87. KEY(4, 5, KEY_UNKNOWN),
  88. KEY(4, 6, KEY_L),
  89. KEY(4, 7, KEY_LEFT),
  90. KEY(5, 0, KEY_S),
  91. KEY(5, 1, KEY_H),
  92. KEY(5, 2, KEY_J),
  93. KEY(5, 3, KEY_F3),
  94. KEY(5, 4, KEY_F9),
  95. KEY(5, 5, KEY_VOLUMEDOWN),
  96. KEY(5, 6, KEY_M),
  97. KEY(5, 7, KEY_RIGHT),
  98. KEY(6, 0, KEY_Q),
  99. KEY(6, 1, KEY_A),
  100. KEY(6, 2, KEY_N),
  101. KEY(6, 3, KEY_BACK),
  102. KEY(6, 4, KEY_BACKSPACE),
  103. KEY(6, 5, KEY_UNKNOWN),
  104. KEY(6, 6, KEY_P),
  105. KEY(6, 7, KEY_UP),
  106. KEY(7, 0, KEY_PROG1),
  107. KEY(7, 1, KEY_PROG2),
  108. KEY(7, 2, KEY_PROG3),
  109. KEY(7, 3, KEY_PROG4),
  110. KEY(7, 4, KEY_F4),
  111. KEY(7, 5, KEY_UNKNOWN),
  112. KEY(7, 6, KEY_OK),
  113. KEY(7, 7, KEY_DOWN),
  114. };
  115. static struct matrix_keymap_data sdp4430_keymap_data = {
  116. .keymap = sdp4430_keymap,
  117. .keymap_size = ARRAY_SIZE(sdp4430_keymap),
  118. };
  119. static struct omap4_keypad_platform_data sdp4430_keypad_data = {
  120. .keymap_data = &sdp4430_keymap_data,
  121. .rows = 8,
  122. .cols = 8,
  123. };
  124. static struct gpio_led sdp4430_gpio_leds[] = {
  125. {
  126. .name = "omap4:green:debug0",
  127. .gpio = 61,
  128. },
  129. {
  130. .name = "omap4:green:debug1",
  131. .gpio = 30,
  132. },
  133. {
  134. .name = "omap4:green:debug2",
  135. .gpio = 7,
  136. },
  137. {
  138. .name = "omap4:green:debug3",
  139. .gpio = 8,
  140. },
  141. {
  142. .name = "omap4:green:debug4",
  143. .gpio = 50,
  144. },
  145. {
  146. .name = "omap4:blue:user",
  147. .gpio = 169,
  148. },
  149. {
  150. .name = "omap4:red:user",
  151. .gpio = 170,
  152. },
  153. {
  154. .name = "omap4:green:user",
  155. .gpio = 139,
  156. },
  157. };
  158. static struct gpio_keys_button sdp4430_gpio_keys[] = {
  159. {
  160. .desc = "Proximity Sensor",
  161. .type = EV_SW,
  162. .code = SW_FRONT_PROXIMITY,
  163. .gpio = OMAP4_SFH7741_SENSOR_OUTPUT_GPIO,
  164. .active_low = 0,
  165. }
  166. };
  167. static struct gpio_led_platform_data sdp4430_led_data = {
  168. .leds = sdp4430_gpio_leds,
  169. .num_leds = ARRAY_SIZE(sdp4430_gpio_leds),
  170. };
  171. static struct led_pwm sdp4430_pwm_leds[] = {
  172. {
  173. .name = "omap4:green:chrg",
  174. .pwm_id = 1,
  175. .max_brightness = 255,
  176. .pwm_period_ns = 7812500,
  177. },
  178. };
  179. static struct led_pwm_platform_data sdp4430_pwm_data = {
  180. .num_leds = ARRAY_SIZE(sdp4430_pwm_leds),
  181. .leds = sdp4430_pwm_leds,
  182. };
  183. static struct platform_device sdp4430_leds_pwm = {
  184. .name = "leds_pwm",
  185. .id = -1,
  186. .dev = {
  187. .platform_data = &sdp4430_pwm_data,
  188. },
  189. };
  190. static int omap_prox_activate(struct device *dev)
  191. {
  192. gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 1);
  193. return 0;
  194. }
  195. static void omap_prox_deactivate(struct device *dev)
  196. {
  197. gpio_set_value(OMAP4_SFH7741_ENABLE_GPIO , 0);
  198. }
  199. static struct gpio_keys_platform_data sdp4430_gpio_keys_data = {
  200. .buttons = sdp4430_gpio_keys,
  201. .nbuttons = ARRAY_SIZE(sdp4430_gpio_keys),
  202. .enable = omap_prox_activate,
  203. .disable = omap_prox_deactivate,
  204. };
  205. static struct platform_device sdp4430_gpio_keys_device = {
  206. .name = "gpio-keys",
  207. .id = -1,
  208. .dev = {
  209. .platform_data = &sdp4430_gpio_keys_data,
  210. },
  211. };
  212. static struct platform_device sdp4430_leds_gpio = {
  213. .name = "leds-gpio",
  214. .id = -1,
  215. .dev = {
  216. .platform_data = &sdp4430_led_data,
  217. },
  218. };
  219. static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
  220. {
  221. .modalias = "ks8851",
  222. .bus_num = 1,
  223. .chip_select = 0,
  224. .max_speed_hz = 24000000,
  225. .irq = ETH_KS8851_IRQ,
  226. },
  227. };
  228. static struct gpio sdp4430_eth_gpios[] __initdata = {
  229. { ETH_KS8851_POWER_ON, GPIOF_OUT_INIT_HIGH, "eth_power" },
  230. { ETH_KS8851_QUART, GPIOF_OUT_INIT_HIGH, "quart" },
  231. { ETH_KS8851_IRQ, GPIOF_IN, "eth_irq" },
  232. };
  233. static int __init omap_ethernet_init(void)
  234. {
  235. int status;
  236. /* Request of GPIO lines */
  237. status = gpio_request_array(sdp4430_eth_gpios,
  238. ARRAY_SIZE(sdp4430_eth_gpios));
  239. if (status)
  240. pr_err("Cannot request ETH GPIOs\n");
  241. return status;
  242. }
  243. static struct platform_device sdp4430_lcd_device = {
  244. .name = "sdp4430_lcd",
  245. .id = -1,
  246. };
  247. static struct platform_device *sdp4430_devices[] __initdata = {
  248. &sdp4430_lcd_device,
  249. &sdp4430_gpio_keys_device,
  250. &sdp4430_leds_gpio,
  251. &sdp4430_leds_pwm,
  252. };
  253. static struct omap_lcd_config sdp4430_lcd_config __initdata = {
  254. .ctrl_name = "internal",
  255. };
  256. static struct omap_board_config_kernel sdp4430_config[] __initdata = {
  257. { OMAP_TAG_LCD, &sdp4430_lcd_config },
  258. };
  259. static void __init omap_4430sdp_init_early(void)
  260. {
  261. omap2_init_common_infrastructure();
  262. omap2_init_common_devices(NULL, NULL);
  263. #ifdef CONFIG_OMAP_32K_TIMER
  264. omap2_gp_clockevent_set_gptimer(1);
  265. #endif
  266. }
  267. static struct omap_musb_board_data musb_board_data = {
  268. .interface_type = MUSB_INTERFACE_UTMI,
  269. .mode = MUSB_OTG,
  270. .power = 100,
  271. };
  272. static struct twl4030_usb_data omap4_usbphy_data = {
  273. .phy_init = omap4430_phy_init,
  274. .phy_exit = omap4430_phy_exit,
  275. .phy_power = omap4430_phy_power,
  276. .phy_set_clock = omap4430_phy_set_clk,
  277. .phy_suspend = omap4430_phy_suspend,
  278. };
  279. static struct omap2_hsmmc_info mmc[] = {
  280. {
  281. .mmc = 2,
  282. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
  283. .gpio_cd = -EINVAL,
  284. .gpio_wp = -EINVAL,
  285. .nonremovable = true,
  286. .ocr_mask = MMC_VDD_29_30,
  287. .no_off_init = true,
  288. },
  289. {
  290. .mmc = 1,
  291. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
  292. .gpio_wp = -EINVAL,
  293. },
  294. {} /* Terminator */
  295. };
  296. static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
  297. {
  298. .supply = "vmmc",
  299. .dev_name = "omap_hsmmc.1",
  300. },
  301. };
  302. static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
  303. {
  304. .supply = "vmmc",
  305. .dev_name = "omap_hsmmc.0",
  306. },
  307. };
  308. static int omap4_twl6030_hsmmc_late_init(struct device *dev)
  309. {
  310. int ret = 0;
  311. struct platform_device *pdev = container_of(dev,
  312. struct platform_device, dev);
  313. struct omap_mmc_platform_data *pdata = dev->platform_data;
  314. /* Setting MMC1 Card detect Irq */
  315. if (pdev->id == 0) {
  316. ret = twl6030_mmc_card_detect_config();
  317. if (ret)
  318. pr_err("Failed configuring MMC1 card detect\n");
  319. pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
  320. MMCDETECT_INTR_OFFSET;
  321. pdata->slots[0].card_detect = twl6030_mmc_card_detect;
  322. }
  323. return ret;
  324. }
  325. static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
  326. {
  327. struct omap_mmc_platform_data *pdata;
  328. /* dev can be null if CONFIG_MMC_OMAP_HS is not set */
  329. if (!dev) {
  330. pr_err("Failed %s\n", __func__);
  331. return;
  332. }
  333. pdata = dev->platform_data;
  334. pdata->init = omap4_twl6030_hsmmc_late_init;
  335. }
  336. static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
  337. {
  338. struct omap2_hsmmc_info *c;
  339. omap2_hsmmc_init(controllers);
  340. for (c = controllers; c->mmc; c++)
  341. omap4_twl6030_hsmmc_set_late_init(c->dev);
  342. return 0;
  343. }
  344. static struct regulator_init_data sdp4430_vaux1 = {
  345. .constraints = {
  346. .min_uV = 1000000,
  347. .max_uV = 3000000,
  348. .apply_uV = true,
  349. .valid_modes_mask = REGULATOR_MODE_NORMAL
  350. | REGULATOR_MODE_STANDBY,
  351. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  352. | REGULATOR_CHANGE_MODE
  353. | REGULATOR_CHANGE_STATUS,
  354. },
  355. .num_consumer_supplies = 1,
  356. .consumer_supplies = sdp4430_vaux_supply,
  357. };
  358. static struct regulator_init_data sdp4430_vaux2 = {
  359. .constraints = {
  360. .min_uV = 1200000,
  361. .max_uV = 2800000,
  362. .apply_uV = true,
  363. .valid_modes_mask = REGULATOR_MODE_NORMAL
  364. | REGULATOR_MODE_STANDBY,
  365. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  366. | REGULATOR_CHANGE_MODE
  367. | REGULATOR_CHANGE_STATUS,
  368. },
  369. };
  370. static struct regulator_init_data sdp4430_vaux3 = {
  371. .constraints = {
  372. .min_uV = 1000000,
  373. .max_uV = 3000000,
  374. .apply_uV = true,
  375. .valid_modes_mask = REGULATOR_MODE_NORMAL
  376. | REGULATOR_MODE_STANDBY,
  377. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  378. | REGULATOR_CHANGE_MODE
  379. | REGULATOR_CHANGE_STATUS,
  380. },
  381. };
  382. /* VMMC1 for MMC1 card */
  383. static struct regulator_init_data sdp4430_vmmc = {
  384. .constraints = {
  385. .min_uV = 1200000,
  386. .max_uV = 3000000,
  387. .apply_uV = true,
  388. .valid_modes_mask = REGULATOR_MODE_NORMAL
  389. | REGULATOR_MODE_STANDBY,
  390. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  391. | REGULATOR_CHANGE_MODE
  392. | REGULATOR_CHANGE_STATUS,
  393. },
  394. .num_consumer_supplies = 1,
  395. .consumer_supplies = sdp4430_vmmc_supply,
  396. };
  397. static struct regulator_init_data sdp4430_vpp = {
  398. .constraints = {
  399. .min_uV = 1800000,
  400. .max_uV = 2500000,
  401. .apply_uV = true,
  402. .valid_modes_mask = REGULATOR_MODE_NORMAL
  403. | REGULATOR_MODE_STANDBY,
  404. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  405. | REGULATOR_CHANGE_MODE
  406. | REGULATOR_CHANGE_STATUS,
  407. },
  408. };
  409. static struct regulator_init_data sdp4430_vusim = {
  410. .constraints = {
  411. .min_uV = 1200000,
  412. .max_uV = 2900000,
  413. .apply_uV = true,
  414. .valid_modes_mask = REGULATOR_MODE_NORMAL
  415. | REGULATOR_MODE_STANDBY,
  416. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  417. | REGULATOR_CHANGE_MODE
  418. | REGULATOR_CHANGE_STATUS,
  419. },
  420. };
  421. static struct regulator_init_data sdp4430_vana = {
  422. .constraints = {
  423. .min_uV = 2100000,
  424. .max_uV = 2100000,
  425. .valid_modes_mask = REGULATOR_MODE_NORMAL
  426. | REGULATOR_MODE_STANDBY,
  427. .valid_ops_mask = REGULATOR_CHANGE_MODE
  428. | REGULATOR_CHANGE_STATUS,
  429. },
  430. };
  431. static struct regulator_init_data sdp4430_vcxio = {
  432. .constraints = {
  433. .min_uV = 1800000,
  434. .max_uV = 1800000,
  435. .valid_modes_mask = REGULATOR_MODE_NORMAL
  436. | REGULATOR_MODE_STANDBY,
  437. .valid_ops_mask = REGULATOR_CHANGE_MODE
  438. | REGULATOR_CHANGE_STATUS,
  439. },
  440. };
  441. static struct regulator_init_data sdp4430_vdac = {
  442. .constraints = {
  443. .min_uV = 1800000,
  444. .max_uV = 1800000,
  445. .valid_modes_mask = REGULATOR_MODE_NORMAL
  446. | REGULATOR_MODE_STANDBY,
  447. .valid_ops_mask = REGULATOR_CHANGE_MODE
  448. | REGULATOR_CHANGE_STATUS,
  449. },
  450. };
  451. static struct regulator_init_data sdp4430_vusb = {
  452. .constraints = {
  453. .min_uV = 3300000,
  454. .max_uV = 3300000,
  455. .apply_uV = true,
  456. .valid_modes_mask = REGULATOR_MODE_NORMAL
  457. | REGULATOR_MODE_STANDBY,
  458. .valid_ops_mask = REGULATOR_CHANGE_MODE
  459. | REGULATOR_CHANGE_STATUS,
  460. },
  461. };
  462. static struct regulator_init_data sdp4430_clk32kg = {
  463. .constraints = {
  464. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  465. },
  466. };
  467. static struct twl4030_platform_data sdp4430_twldata = {
  468. .irq_base = TWL6030_IRQ_BASE,
  469. .irq_end = TWL6030_IRQ_END,
  470. /* Regulators */
  471. .vmmc = &sdp4430_vmmc,
  472. .vpp = &sdp4430_vpp,
  473. .vusim = &sdp4430_vusim,
  474. .vana = &sdp4430_vana,
  475. .vcxio = &sdp4430_vcxio,
  476. .vdac = &sdp4430_vdac,
  477. .vusb = &sdp4430_vusb,
  478. .vaux1 = &sdp4430_vaux1,
  479. .vaux2 = &sdp4430_vaux2,
  480. .vaux3 = &sdp4430_vaux3,
  481. .clk32kg = &sdp4430_clk32kg,
  482. .usb = &omap4_usbphy_data
  483. };
  484. static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
  485. {
  486. I2C_BOARD_INFO("tmp105", 0x48),
  487. },
  488. {
  489. I2C_BOARD_INFO("bh1780", 0x29),
  490. },
  491. };
  492. static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
  493. {
  494. I2C_BOARD_INFO("hmc5843", 0x1e),
  495. },
  496. };
  497. static int __init omap4_i2c_init(void)
  498. {
  499. omap4_pmic_init("twl6030", &sdp4430_twldata);
  500. omap_register_i2c_bus(2, 400, NULL, 0);
  501. omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
  502. ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
  503. omap_register_i2c_bus(4, 400, sdp4430_i2c_4_boardinfo,
  504. ARRAY_SIZE(sdp4430_i2c_4_boardinfo));
  505. return 0;
  506. }
  507. static void __init omap_sfh7741prox_init(void)
  508. {
  509. int error;
  510. error = gpio_request_one(OMAP4_SFH7741_ENABLE_GPIO,
  511. GPIOF_OUT_INIT_LOW, "sfh7741");
  512. if (error < 0)
  513. pr_err("%s:failed to request GPIO %d, error %d\n",
  514. __func__, OMAP4_SFH7741_ENABLE_GPIO, error);
  515. }
  516. static void sdp4430_hdmi_mux_init(void)
  517. {
  518. /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
  519. omap_mux_init_signal("hdmi_hpd",
  520. OMAP_PIN_INPUT_PULLUP);
  521. omap_mux_init_signal("hdmi_cec",
  522. OMAP_PIN_INPUT_PULLUP);
  523. /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
  524. omap_mux_init_signal("hdmi_ddc_scl",
  525. OMAP_PIN_INPUT_PULLUP);
  526. omap_mux_init_signal("hdmi_ddc_sda",
  527. OMAP_PIN_INPUT_PULLUP);
  528. }
  529. static struct gpio sdp4430_hdmi_gpios[] = {
  530. { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
  531. { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
  532. };
  533. static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
  534. {
  535. int status;
  536. status = gpio_request_array(sdp4430_hdmi_gpios,
  537. ARRAY_SIZE(sdp4430_hdmi_gpios));
  538. if (status)
  539. pr_err("%s: Cannot request HDMI GPIOs\n", __func__);
  540. return status;
  541. }
  542. static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
  543. {
  544. gpio_free(HDMI_GPIO_LS_OE);
  545. gpio_free(HDMI_GPIO_HPD);
  546. }
  547. static struct omap_dss_device sdp4430_hdmi_device = {
  548. .name = "hdmi",
  549. .driver_name = "hdmi_panel",
  550. .type = OMAP_DISPLAY_TYPE_HDMI,
  551. .clocks = {
  552. .dispc = {
  553. .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
  554. },
  555. .hdmi = {
  556. .regn = 15,
  557. .regm2 = 1,
  558. },
  559. },
  560. .platform_enable = sdp4430_panel_enable_hdmi,
  561. .platform_disable = sdp4430_panel_disable_hdmi,
  562. .channel = OMAP_DSS_CHANNEL_DIGIT,
  563. };
  564. static struct omap_dss_device *sdp4430_dss_devices[] = {
  565. &sdp4430_hdmi_device,
  566. };
  567. static struct omap_dss_board_info sdp4430_dss_data = {
  568. .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
  569. .devices = sdp4430_dss_devices,
  570. .default_device = &sdp4430_hdmi_device,
  571. };
  572. void omap_4430sdp_display_init(void)
  573. {
  574. sdp4430_hdmi_mux_init();
  575. omap_display_init(&sdp4430_dss_data);
  576. }
  577. #ifdef CONFIG_OMAP_MUX
  578. static struct omap_board_mux board_mux[] __initdata = {
  579. OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
  580. { .reg_offset = OMAP_MUX_TERMINATOR },
  581. };
  582. static struct omap_device_pad serial2_pads[] __initdata = {
  583. OMAP_MUX_STATIC("uart2_cts.uart2_cts",
  584. OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
  585. OMAP_MUX_STATIC("uart2_rts.uart2_rts",
  586. OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
  587. OMAP_MUX_STATIC("uart2_rx.uart2_rx",
  588. OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
  589. OMAP_MUX_STATIC("uart2_tx.uart2_tx",
  590. OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
  591. };
  592. static struct omap_device_pad serial3_pads[] __initdata = {
  593. OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
  594. OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
  595. OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
  596. OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
  597. OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
  598. OMAP_PIN_INPUT | OMAP_MUX_MODE0),
  599. OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
  600. OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
  601. };
  602. static struct omap_device_pad serial4_pads[] __initdata = {
  603. OMAP_MUX_STATIC("uart4_rx.uart4_rx",
  604. OMAP_PIN_INPUT | OMAP_MUX_MODE0),
  605. OMAP_MUX_STATIC("uart4_tx.uart4_tx",
  606. OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
  607. };
  608. static struct omap_board_data serial2_data __initdata = {
  609. .id = 1,
  610. .pads = serial2_pads,
  611. .pads_cnt = ARRAY_SIZE(serial2_pads),
  612. };
  613. static struct omap_board_data serial3_data __initdata = {
  614. .id = 2,
  615. .pads = serial3_pads,
  616. .pads_cnt = ARRAY_SIZE(serial3_pads),
  617. };
  618. static struct omap_board_data serial4_data __initdata = {
  619. .id = 3,
  620. .pads = serial4_pads,
  621. .pads_cnt = ARRAY_SIZE(serial4_pads),
  622. };
  623. static inline void board_serial_init(void)
  624. {
  625. struct omap_board_data bdata;
  626. bdata.flags = 0;
  627. bdata.pads = NULL;
  628. bdata.pads_cnt = 0;
  629. bdata.id = 0;
  630. /* pass dummy data for UART1 */
  631. omap_serial_init_port(&bdata);
  632. omap_serial_init_port(&serial2_data);
  633. omap_serial_init_port(&serial3_data);
  634. omap_serial_init_port(&serial4_data);
  635. }
  636. #else
  637. #define board_mux NULL
  638. static inline void board_serial_init(void)
  639. {
  640. omap_serial_init();
  641. }
  642. #endif
  643. static void __init omap_4430sdp_init(void)
  644. {
  645. int status;
  646. int package = OMAP_PACKAGE_CBS;
  647. if (omap_rev() == OMAP4430_REV_ES1_0)
  648. package = OMAP_PACKAGE_CBL;
  649. omap4_mux_init(board_mux, NULL, package);
  650. omap_board_config = sdp4430_config;
  651. omap_board_config_size = ARRAY_SIZE(sdp4430_config);
  652. omap4_i2c_init();
  653. omap_sfh7741prox_init();
  654. platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
  655. board_serial_init();
  656. omap4_twl6030_hsmmc_init(mmc);
  657. usb_musb_init(&musb_board_data);
  658. status = omap_ethernet_init();
  659. if (status) {
  660. pr_err("Ethernet initialization failed: %d\n", status);
  661. } else {
  662. sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ);
  663. spi_register_board_info(sdp4430_spi_board_info,
  664. ARRAY_SIZE(sdp4430_spi_board_info));
  665. }
  666. status = omap4_keyboard_init(&sdp4430_keypad_data);
  667. if (status)
  668. pr_err("Keypad initialization failed: %d\n", status);
  669. omap_4430sdp_display_init();
  670. }
  671. static void __init omap_4430sdp_map_io(void)
  672. {
  673. omap2_set_globals_443x();
  674. omap44xx_map_common_io();
  675. }
  676. MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
  677. /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
  678. .boot_params = 0x80000100,
  679. .reserve = omap_reserve,
  680. .map_io = omap_4430sdp_map_io,
  681. .init_early = omap_4430sdp_init_early,
  682. .init_irq = gic_init_irq,
  683. .init_machine = omap_4430sdp_init,
  684. .timer = &omap_timer,
  685. MACHINE_END