board-omap3pandora.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * board-omap3pandora.c (Pandora Handheld Console)
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. *
  18. */
  19. #include <linux/init.h>
  20. #include <linux/kernel.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/spi/spi.h>
  23. #include <linux/regulator/machine.h>
  24. #include <linux/i2c/twl.h>
  25. #include <linux/wl12xx.h>
  26. #include <linux/mtd/partitions.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/leds.h>
  29. #include <linux/input.h>
  30. #include <linux/input/matrix_keypad.h>
  31. #include <linux/gpio.h>
  32. #include <linux/gpio_keys.h>
  33. #include <linux/mmc/host.h>
  34. #include <linux/mmc/card.h>
  35. #include <linux/regulator/fixed.h>
  36. #include <asm/mach-types.h>
  37. #include <asm/mach/arch.h>
  38. #include <asm/mach/map.h>
  39. #include <plat/board.h>
  40. #include <plat/common.h>
  41. #include <mach/hardware.h>
  42. #include <plat/mcspi.h>
  43. #include <plat/usb.h>
  44. #include <video/omapdss.h>
  45. #include <plat/nand.h>
  46. #include "mux.h"
  47. #include "sdram-micron-mt46h32m32lf-6.h"
  48. #include "hsmmc.h"
  49. #include "common-board-devices.h"
  50. #define PANDORA_WIFI_IRQ_GPIO 21
  51. #define PANDORA_WIFI_NRESET_GPIO 23
  52. #define OMAP3_PANDORA_TS_GPIO 94
  53. static struct mtd_partition omap3pandora_nand_partitions[] = {
  54. {
  55. .name = "xloader",
  56. .offset = 0,
  57. .size = 4 * NAND_BLOCK_SIZE,
  58. .mask_flags = MTD_WRITEABLE
  59. }, {
  60. .name = "uboot",
  61. .offset = MTDPART_OFS_APPEND,
  62. .size = 15 * NAND_BLOCK_SIZE,
  63. }, {
  64. .name = "uboot-env",
  65. .offset = MTDPART_OFS_APPEND,
  66. .size = 1 * NAND_BLOCK_SIZE,
  67. }, {
  68. .name = "boot",
  69. .offset = MTDPART_OFS_APPEND,
  70. .size = 80 * NAND_BLOCK_SIZE,
  71. }, {
  72. .name = "rootfs",
  73. .offset = MTDPART_OFS_APPEND,
  74. .size = MTDPART_SIZ_FULL,
  75. },
  76. };
  77. static struct omap_nand_platform_data pandora_nand_data = {
  78. .cs = 0,
  79. .devsize = 1, /* '0' for 8-bit, '1' for 16-bit device */
  80. .parts = omap3pandora_nand_partitions,
  81. .nr_parts = ARRAY_SIZE(omap3pandora_nand_partitions),
  82. };
  83. static struct gpio_led pandora_gpio_leds[] = {
  84. {
  85. .name = "pandora::sd1",
  86. .default_trigger = "mmc0",
  87. .gpio = 128,
  88. }, {
  89. .name = "pandora::sd2",
  90. .default_trigger = "mmc1",
  91. .gpio = 129,
  92. }, {
  93. .name = "pandora::bluetooth",
  94. .gpio = 158,
  95. }, {
  96. .name = "pandora::wifi",
  97. .gpio = 159,
  98. },
  99. };
  100. static struct gpio_led_platform_data pandora_gpio_led_data = {
  101. .leds = pandora_gpio_leds,
  102. .num_leds = ARRAY_SIZE(pandora_gpio_leds),
  103. };
  104. static struct platform_device pandora_leds_gpio = {
  105. .name = "leds-gpio",
  106. .id = -1,
  107. .dev = {
  108. .platform_data = &pandora_gpio_led_data,
  109. },
  110. };
  111. #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \
  112. { \
  113. .gpio = gpio_num, \
  114. .type = ev_type, \
  115. .code = ev_code, \
  116. .active_low = act_low, \
  117. .debounce_interval = 4, \
  118. .desc = "btn " descr, \
  119. }
  120. #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \
  121. GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description)
  122. static struct gpio_keys_button pandora_gpio_keys[] = {
  123. GPIO_BUTTON_LOW(110, KEY_UP, "up"),
  124. GPIO_BUTTON_LOW(103, KEY_DOWN, "down"),
  125. GPIO_BUTTON_LOW(96, KEY_LEFT, "left"),
  126. GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"),
  127. GPIO_BUTTON_LOW(109, KEY_PAGEUP, "game 1"),
  128. GPIO_BUTTON_LOW(111, KEY_END, "game 2"),
  129. GPIO_BUTTON_LOW(106, KEY_PAGEDOWN, "game 3"),
  130. GPIO_BUTTON_LOW(101, KEY_HOME, "game 4"),
  131. GPIO_BUTTON_LOW(102, KEY_RIGHTSHIFT, "l"),
  132. GPIO_BUTTON_LOW(97, KEY_KPPLUS, "l2"),
  133. GPIO_BUTTON_LOW(105, KEY_RIGHTCTRL, "r"),
  134. GPIO_BUTTON_LOW(107, KEY_KPMINUS, "r2"),
  135. GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"),
  136. GPIO_BUTTON_LOW(99, KEY_MENU, "menu"),
  137. GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"),
  138. GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),
  139. GPIO_BUTTON(108, EV_SW, SW_LID, 1, "lid"),
  140. };
  141. static struct gpio_keys_platform_data pandora_gpio_key_info = {
  142. .buttons = pandora_gpio_keys,
  143. .nbuttons = ARRAY_SIZE(pandora_gpio_keys),
  144. };
  145. static struct platform_device pandora_keys_gpio = {
  146. .name = "gpio-keys",
  147. .id = -1,
  148. .dev = {
  149. .platform_data = &pandora_gpio_key_info,
  150. },
  151. };
  152. static const uint32_t board_keymap[] = {
  153. /* row, col, code */
  154. KEY(0, 0, KEY_9),
  155. KEY(0, 1, KEY_8),
  156. KEY(0, 2, KEY_I),
  157. KEY(0, 3, KEY_J),
  158. KEY(0, 4, KEY_N),
  159. KEY(0, 5, KEY_M),
  160. KEY(1, 0, KEY_0),
  161. KEY(1, 1, KEY_7),
  162. KEY(1, 2, KEY_U),
  163. KEY(1, 3, KEY_H),
  164. KEY(1, 4, KEY_B),
  165. KEY(1, 5, KEY_SPACE),
  166. KEY(2, 0, KEY_BACKSPACE),
  167. KEY(2, 1, KEY_6),
  168. KEY(2, 2, KEY_Y),
  169. KEY(2, 3, KEY_G),
  170. KEY(2, 4, KEY_V),
  171. KEY(2, 5, KEY_FN),
  172. KEY(3, 0, KEY_O),
  173. KEY(3, 1, KEY_5),
  174. KEY(3, 2, KEY_T),
  175. KEY(3, 3, KEY_F),
  176. KEY(3, 4, KEY_C),
  177. KEY(4, 0, KEY_P),
  178. KEY(4, 1, KEY_4),
  179. KEY(4, 2, KEY_R),
  180. KEY(4, 3, KEY_D),
  181. KEY(4, 4, KEY_X),
  182. KEY(5, 0, KEY_K),
  183. KEY(5, 1, KEY_3),
  184. KEY(5, 2, KEY_E),
  185. KEY(5, 3, KEY_S),
  186. KEY(5, 4, KEY_Z),
  187. KEY(6, 0, KEY_L),
  188. KEY(6, 1, KEY_2),
  189. KEY(6, 2, KEY_W),
  190. KEY(6, 3, KEY_A),
  191. KEY(6, 4, KEY_DOT),
  192. KEY(7, 0, KEY_ENTER),
  193. KEY(7, 1, KEY_1),
  194. KEY(7, 2, KEY_Q),
  195. KEY(7, 3, KEY_LEFTSHIFT),
  196. KEY(7, 4, KEY_COMMA),
  197. };
  198. static struct matrix_keymap_data board_map_data = {
  199. .keymap = board_keymap,
  200. .keymap_size = ARRAY_SIZE(board_keymap),
  201. };
  202. static struct twl4030_keypad_data pandora_kp_data = {
  203. .keymap_data = &board_map_data,
  204. .rows = 8,
  205. .cols = 6,
  206. .rep = 1,
  207. };
  208. static struct omap_dss_device pandora_lcd_device = {
  209. .name = "lcd",
  210. .driver_name = "tpo_td043mtea1_panel",
  211. .type = OMAP_DISPLAY_TYPE_DPI,
  212. .phy.dpi.data_lines = 24,
  213. .reset_gpio = 157,
  214. };
  215. static struct omap_dss_device pandora_tv_device = {
  216. .name = "tv",
  217. .driver_name = "venc",
  218. .type = OMAP_DISPLAY_TYPE_VENC,
  219. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  220. };
  221. static struct omap_dss_device *pandora_dss_devices[] = {
  222. &pandora_lcd_device,
  223. &pandora_tv_device,
  224. };
  225. static struct omap_dss_board_info pandora_dss_data = {
  226. .num_devices = ARRAY_SIZE(pandora_dss_devices),
  227. .devices = pandora_dss_devices,
  228. .default_device = &pandora_lcd_device,
  229. };
  230. static void pandora_wl1251_init_card(struct mmc_card *card)
  231. {
  232. /*
  233. * We have TI wl1251 attached to MMC3. Pass this information to
  234. * SDIO core because it can't be probed by normal methods.
  235. */
  236. card->quirks |= MMC_QUIRK_NONSTD_SDIO;
  237. card->cccr.wide_bus = 1;
  238. card->cis.vendor = 0x104c;
  239. card->cis.device = 0x9066;
  240. card->cis.blksize = 512;
  241. card->cis.max_dtr = 20000000;
  242. }
  243. static struct omap2_hsmmc_info omap3pandora_mmc[] = {
  244. {
  245. .mmc = 1,
  246. .caps = MMC_CAP_4_BIT_DATA,
  247. .gpio_cd = -EINVAL,
  248. .gpio_wp = 126,
  249. .ext_clock = 0,
  250. },
  251. {
  252. .mmc = 2,
  253. .caps = MMC_CAP_4_BIT_DATA,
  254. .gpio_cd = -EINVAL,
  255. .gpio_wp = 127,
  256. .ext_clock = 1,
  257. .transceiver = true,
  258. },
  259. {
  260. .mmc = 3,
  261. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
  262. .gpio_cd = -EINVAL,
  263. .gpio_wp = -EINVAL,
  264. .init_card = pandora_wl1251_init_card,
  265. },
  266. {} /* Terminator */
  267. };
  268. static int omap3pandora_twl_gpio_setup(struct device *dev,
  269. unsigned gpio, unsigned ngpio)
  270. {
  271. int ret, gpio_32khz;
  272. /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
  273. omap3pandora_mmc[0].gpio_cd = gpio + 0;
  274. omap3pandora_mmc[1].gpio_cd = gpio + 1;
  275. omap2_hsmmc_init(omap3pandora_mmc);
  276. /* gpio + 13 drives 32kHz buffer for wifi module */
  277. gpio_32khz = gpio + 13;
  278. ret = gpio_request_one(gpio_32khz, GPIOF_OUT_INIT_HIGH, "wifi 32kHz");
  279. if (ret < 0) {
  280. pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret);
  281. return -ENODEV;
  282. }
  283. return 0;
  284. }
  285. static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
  286. .gpio_base = OMAP_MAX_GPIO_LINES,
  287. .irq_base = TWL4030_GPIO_IRQ_BASE,
  288. .irq_end = TWL4030_GPIO_IRQ_END,
  289. .setup = omap3pandora_twl_gpio_setup,
  290. };
  291. static struct regulator_consumer_supply pandora_vmmc1_supply =
  292. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
  293. static struct regulator_consumer_supply pandora_vmmc2_supply =
  294. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
  295. static struct regulator_consumer_supply pandora_vmmc3_supply =
  296. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2");
  297. static struct regulator_consumer_supply pandora_vdda_dac_supply =
  298. REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
  299. static struct regulator_consumer_supply pandora_vdds_supplies[] = {
  300. REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
  301. REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
  302. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
  303. };
  304. static struct regulator_consumer_supply pandora_vcc_lcd_supply =
  305. REGULATOR_SUPPLY("vcc", "display0");
  306. static struct regulator_consumer_supply pandora_usb_phy_supply =
  307. REGULATOR_SUPPLY("hsusb0", "ehci-omap.0");
  308. /* ads7846 on SPI and 2 nub controllers on I2C */
  309. static struct regulator_consumer_supply pandora_vaux4_supplies[] = {
  310. REGULATOR_SUPPLY("vcc", "spi1.0"),
  311. REGULATOR_SUPPLY("vcc", "3-0066"),
  312. REGULATOR_SUPPLY("vcc", "3-0067"),
  313. };
  314. static struct regulator_consumer_supply pandora_adac_supply =
  315. REGULATOR_SUPPLY("vcc", "soc-audio");
  316. /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  317. static struct regulator_init_data pandora_vmmc1 = {
  318. .constraints = {
  319. .min_uV = 1850000,
  320. .max_uV = 3150000,
  321. .valid_modes_mask = REGULATOR_MODE_NORMAL
  322. | REGULATOR_MODE_STANDBY,
  323. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  324. | REGULATOR_CHANGE_MODE
  325. | REGULATOR_CHANGE_STATUS,
  326. },
  327. .num_consumer_supplies = 1,
  328. .consumer_supplies = &pandora_vmmc1_supply,
  329. };
  330. /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */
  331. static struct regulator_init_data pandora_vmmc2 = {
  332. .constraints = {
  333. .min_uV = 1850000,
  334. .max_uV = 3150000,
  335. .valid_modes_mask = REGULATOR_MODE_NORMAL
  336. | REGULATOR_MODE_STANDBY,
  337. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  338. | REGULATOR_CHANGE_MODE
  339. | REGULATOR_CHANGE_STATUS,
  340. },
  341. .num_consumer_supplies = 1,
  342. .consumer_supplies = &pandora_vmmc2_supply,
  343. };
  344. /* VDAC for DSS driving S-Video */
  345. static struct regulator_init_data pandora_vdac = {
  346. .constraints = {
  347. .min_uV = 1800000,
  348. .max_uV = 1800000,
  349. .apply_uV = true,
  350. .valid_modes_mask = REGULATOR_MODE_NORMAL
  351. | REGULATOR_MODE_STANDBY,
  352. .valid_ops_mask = REGULATOR_CHANGE_MODE
  353. | REGULATOR_CHANGE_STATUS,
  354. },
  355. .num_consumer_supplies = 1,
  356. .consumer_supplies = &pandora_vdda_dac_supply,
  357. };
  358. /* VPLL2 for digital video outputs */
  359. static struct regulator_init_data pandora_vpll2 = {
  360. .constraints = {
  361. .min_uV = 1800000,
  362. .max_uV = 1800000,
  363. .apply_uV = true,
  364. .valid_modes_mask = REGULATOR_MODE_NORMAL
  365. | REGULATOR_MODE_STANDBY,
  366. .valid_ops_mask = REGULATOR_CHANGE_MODE
  367. | REGULATOR_CHANGE_STATUS,
  368. },
  369. .num_consumer_supplies = ARRAY_SIZE(pandora_vdds_supplies),
  370. .consumer_supplies = pandora_vdds_supplies,
  371. };
  372. /* VAUX1 for LCD */
  373. static struct regulator_init_data pandora_vaux1 = {
  374. .constraints = {
  375. .min_uV = 3000000,
  376. .max_uV = 3000000,
  377. .apply_uV = true,
  378. .valid_modes_mask = REGULATOR_MODE_NORMAL
  379. | REGULATOR_MODE_STANDBY,
  380. .valid_ops_mask = REGULATOR_CHANGE_MODE
  381. | REGULATOR_CHANGE_STATUS,
  382. },
  383. .num_consumer_supplies = 1,
  384. .consumer_supplies = &pandora_vcc_lcd_supply,
  385. };
  386. /* VAUX2 for USB host PHY */
  387. static struct regulator_init_data pandora_vaux2 = {
  388. .constraints = {
  389. .min_uV = 1800000,
  390. .max_uV = 1800000,
  391. .apply_uV = true,
  392. .valid_modes_mask = REGULATOR_MODE_NORMAL
  393. | REGULATOR_MODE_STANDBY,
  394. .valid_ops_mask = REGULATOR_CHANGE_MODE
  395. | REGULATOR_CHANGE_STATUS,
  396. },
  397. .num_consumer_supplies = 1,
  398. .consumer_supplies = &pandora_usb_phy_supply,
  399. };
  400. /* VAUX4 for ads7846 and nubs */
  401. static struct regulator_init_data pandora_vaux4 = {
  402. .constraints = {
  403. .min_uV = 2800000,
  404. .max_uV = 2800000,
  405. .apply_uV = true,
  406. .valid_modes_mask = REGULATOR_MODE_NORMAL
  407. | REGULATOR_MODE_STANDBY,
  408. .valid_ops_mask = REGULATOR_CHANGE_MODE
  409. | REGULATOR_CHANGE_STATUS,
  410. },
  411. .num_consumer_supplies = ARRAY_SIZE(pandora_vaux4_supplies),
  412. .consumer_supplies = pandora_vaux4_supplies,
  413. };
  414. /* VSIM for audio DAC */
  415. static struct regulator_init_data pandora_vsim = {
  416. .constraints = {
  417. .min_uV = 2800000,
  418. .max_uV = 2800000,
  419. .apply_uV = true,
  420. .valid_modes_mask = REGULATOR_MODE_NORMAL
  421. | REGULATOR_MODE_STANDBY,
  422. .valid_ops_mask = REGULATOR_CHANGE_MODE
  423. | REGULATOR_CHANGE_STATUS,
  424. },
  425. .num_consumer_supplies = 1,
  426. .consumer_supplies = &pandora_adac_supply,
  427. };
  428. /* Fixed regulator internal to Wifi module */
  429. static struct regulator_init_data pandora_vmmc3 = {
  430. .constraints = {
  431. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  432. },
  433. .num_consumer_supplies = 1,
  434. .consumer_supplies = &pandora_vmmc3_supply,
  435. };
  436. static struct fixed_voltage_config pandora_vwlan = {
  437. .supply_name = "vwlan",
  438. .microvolts = 1800000, /* 1.8V */
  439. .gpio = PANDORA_WIFI_NRESET_GPIO,
  440. .startup_delay = 50000, /* 50ms */
  441. .enable_high = 1,
  442. .enabled_at_boot = 0,
  443. .init_data = &pandora_vmmc3,
  444. };
  445. static struct platform_device pandora_vwlan_device = {
  446. .name = "reg-fixed-voltage",
  447. .id = 1,
  448. .dev = {
  449. .platform_data = &pandora_vwlan,
  450. },
  451. };
  452. static struct twl4030_usb_data omap3pandora_usb_data = {
  453. .usb_mode = T2_USB_MODE_ULPI,
  454. };
  455. static struct twl4030_codec_audio_data omap3pandora_audio_data;
  456. static struct twl4030_codec_data omap3pandora_codec_data = {
  457. .audio_mclk = 26000000,
  458. .audio = &omap3pandora_audio_data,
  459. };
  460. static struct twl4030_bci_platform_data pandora_bci_data;
  461. static struct twl4030_platform_data omap3pandora_twldata = {
  462. .irq_base = TWL4030_IRQ_BASE,
  463. .irq_end = TWL4030_IRQ_END,
  464. .gpio = &omap3pandora_gpio_data,
  465. .usb = &omap3pandora_usb_data,
  466. .codec = &omap3pandora_codec_data,
  467. .vmmc1 = &pandora_vmmc1,
  468. .vmmc2 = &pandora_vmmc2,
  469. .vdac = &pandora_vdac,
  470. .vpll2 = &pandora_vpll2,
  471. .vaux1 = &pandora_vaux1,
  472. .vaux2 = &pandora_vaux2,
  473. .vaux4 = &pandora_vaux4,
  474. .vsim = &pandora_vsim,
  475. .keypad = &pandora_kp_data,
  476. .bci = &pandora_bci_data,
  477. };
  478. static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = {
  479. {
  480. I2C_BOARD_INFO("bq27500", 0x55),
  481. .flags = I2C_CLIENT_WAKE,
  482. },
  483. };
  484. static int __init omap3pandora_i2c_init(void)
  485. {
  486. omap3_pmic_init("tps65950", &omap3pandora_twldata);
  487. /* i2c2 pins are not connected */
  488. omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo,
  489. ARRAY_SIZE(omap3pandora_i2c3_boardinfo));
  490. return 0;
  491. }
  492. static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
  493. {
  494. .modalias = "tpo_td043mtea1_panel_spi",
  495. .bus_num = 1,
  496. .chip_select = 1,
  497. .max_speed_hz = 375000,
  498. .platform_data = &pandora_lcd_device,
  499. }
  500. };
  501. static void __init omap3pandora_init_early(void)
  502. {
  503. omap2_init_common_infrastructure();
  504. omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
  505. mt46h32m32lf6_sdrc_params);
  506. }
  507. static void __init pandora_wl1251_init(void)
  508. {
  509. struct wl12xx_platform_data pandora_wl1251_pdata;
  510. int ret;
  511. memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
  512. ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
  513. if (ret < 0)
  514. goto fail;
  515. pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
  516. if (pandora_wl1251_pdata.irq < 0)
  517. goto fail_irq;
  518. pandora_wl1251_pdata.use_eeprom = true;
  519. ret = wl12xx_set_platform_data(&pandora_wl1251_pdata);
  520. if (ret < 0)
  521. goto fail_irq;
  522. return;
  523. fail_irq:
  524. gpio_free(PANDORA_WIFI_IRQ_GPIO);
  525. fail:
  526. printk(KERN_ERR "wl1251 board initialisation failed\n");
  527. }
  528. static struct platform_device *omap3pandora_devices[] __initdata = {
  529. &pandora_leds_gpio,
  530. &pandora_keys_gpio,
  531. &pandora_vwlan_device,
  532. };
  533. static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
  534. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  535. .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
  536. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
  537. .phy_reset = true,
  538. .reset_gpio_port[0] = 16,
  539. .reset_gpio_port[1] = -EINVAL,
  540. .reset_gpio_port[2] = -EINVAL
  541. };
  542. #ifdef CONFIG_OMAP_MUX
  543. static struct omap_board_mux board_mux[] __initdata = {
  544. { .reg_offset = OMAP_MUX_TERMINATOR },
  545. };
  546. #endif
  547. static void __init omap3pandora_init(void)
  548. {
  549. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  550. omap3pandora_i2c_init();
  551. pandora_wl1251_init();
  552. platform_add_devices(omap3pandora_devices,
  553. ARRAY_SIZE(omap3pandora_devices));
  554. omap_display_init(&pandora_dss_data);
  555. omap_serial_init();
  556. spi_register_board_info(omap3pandora_spi_board_info,
  557. ARRAY_SIZE(omap3pandora_spi_board_info));
  558. omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
  559. usbhs_init(&usbhs_bdata);
  560. usb_musb_init(NULL);
  561. gpmc_nand_init(&pandora_nand_data);
  562. /* Ensure SDRC pins are mux'd for self-refresh */
  563. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  564. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  565. }
  566. MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
  567. .boot_params = 0x80000100,
  568. .reserve = omap_reserve,
  569. .map_io = omap3_map_io,
  570. .init_early = omap3pandora_init_early,
  571. .init_irq = omap3_init_irq,
  572. .init_machine = omap3pandora_init,
  573. .timer = &omap3_timer,
  574. MACHINE_END