board-overo.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. /*
  2. * board-overo.c (Gumstix Overo)
  3. *
  4. * Initial code: Steve Sakoman <steve@sakoman.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #include <linux/clk.h>
  22. #include <linux/delay.h>
  23. #include <linux/err.h>
  24. #include <linux/init.h>
  25. #include <linux/io.h>
  26. #include <linux/kernel.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/i2c/twl.h>
  29. #include <linux/regulator/machine.h>
  30. #include <linux/regulator/fixed.h>
  31. #include <linux/spi/spi.h>
  32. #include <linux/mtd/mtd.h>
  33. #include <linux/mtd/nand.h>
  34. #include <linux/mtd/partitions.h>
  35. #include <linux/mmc/host.h>
  36. #include <asm/mach-types.h>
  37. #include <asm/mach/arch.h>
  38. #include <asm/mach/flash.h>
  39. #include <asm/mach/map.h>
  40. #include <plat/board.h>
  41. #include <plat/common.h>
  42. #include <plat/display.h>
  43. #include <plat/panel-generic-dpi.h>
  44. #include <mach/gpio.h>
  45. #include <plat/gpmc.h>
  46. #include <mach/hardware.h>
  47. #include <plat/nand.h>
  48. #include <plat/mcspi.h>
  49. #include <plat/mux.h>
  50. #include <plat/usb.h>
  51. #include "mux.h"
  52. #include "sdram-micron-mt46h32m32lf-6.h"
  53. #include "hsmmc.h"
  54. #include "common-board-devices.h"
  55. #define OVERO_GPIO_BT_XGATE 15
  56. #define OVERO_GPIO_W2W_NRESET 16
  57. #define OVERO_GPIO_PENDOWN 114
  58. #define OVERO_GPIO_BT_NRESET 164
  59. #define OVERO_GPIO_USBH_CPEN 168
  60. #define OVERO_GPIO_USBH_NRESET 183
  61. #define NAND_BLOCK_SIZE SZ_128K
  62. #define OVERO_SMSC911X_CS 5
  63. #define OVERO_SMSC911X_GPIO 176
  64. #define OVERO_SMSC911X2_CS 4
  65. #define OVERO_SMSC911X2_GPIO 65
  66. #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
  67. defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
  68. /* fixed regulator for ads7846 */
  69. static struct regulator_consumer_supply ads7846_supply =
  70. REGULATOR_SUPPLY("vcc", "spi1.0");
  71. static struct regulator_init_data vads7846_regulator = {
  72. .constraints = {
  73. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  74. },
  75. .num_consumer_supplies = 1,
  76. .consumer_supplies = &ads7846_supply,
  77. };
  78. static struct fixed_voltage_config vads7846 = {
  79. .supply_name = "vads7846",
  80. .microvolts = 3300000, /* 3.3V */
  81. .gpio = -EINVAL,
  82. .startup_delay = 0,
  83. .init_data = &vads7846_regulator,
  84. };
  85. static struct platform_device vads7846_device = {
  86. .name = "reg-fixed-voltage",
  87. .id = 1,
  88. .dev = {
  89. .platform_data = &vads7846,
  90. },
  91. };
  92. static void __init overo_ads7846_init(void)
  93. {
  94. omap_ads7846_init(1, OVERO_GPIO_PENDOWN, 0, NULL);
  95. platform_device_register(&vads7846_device);
  96. }
  97. #else
  98. static inline void __init overo_ads7846_init(void) { return; }
  99. #endif
  100. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  101. #include <linux/smsc911x.h>
  102. #include <plat/gpmc-smsc911x.h>
  103. static struct omap_smsc911x_platform_data smsc911x_cfg = {
  104. .id = 0,
  105. .cs = OVERO_SMSC911X_CS,
  106. .gpio_irq = OVERO_SMSC911X_GPIO,
  107. .gpio_reset = -EINVAL,
  108. .flags = SMSC911X_USE_32BIT,
  109. };
  110. static struct omap_smsc911x_platform_data smsc911x2_cfg = {
  111. .id = 1,
  112. .cs = OVERO_SMSC911X2_CS,
  113. .gpio_irq = OVERO_SMSC911X2_GPIO,
  114. .gpio_reset = -EINVAL,
  115. .flags = SMSC911X_USE_32BIT,
  116. };
  117. static void __init overo_init_smsc911x(void)
  118. {
  119. gpmc_smsc911x_init(&smsc911x_cfg);
  120. gpmc_smsc911x_init(&smsc911x2_cfg);
  121. }
  122. #else
  123. static inline void __init overo_init_smsc911x(void) { return; }
  124. #endif
  125. /* DSS */
  126. static int lcd_enabled;
  127. static int dvi_enabled;
  128. #define OVERO_GPIO_LCD_EN 144
  129. #define OVERO_GPIO_LCD_BL 145
  130. static void __init overo_display_init(void)
  131. {
  132. if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
  133. (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
  134. gpio_export(OVERO_GPIO_LCD_EN, 0);
  135. else
  136. printk(KERN_ERR "could not obtain gpio for "
  137. "OVERO_GPIO_LCD_EN\n");
  138. if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
  139. (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
  140. gpio_export(OVERO_GPIO_LCD_BL, 0);
  141. else
  142. printk(KERN_ERR "could not obtain gpio for "
  143. "OVERO_GPIO_LCD_BL\n");
  144. }
  145. static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
  146. {
  147. if (lcd_enabled) {
  148. printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
  149. return -EINVAL;
  150. }
  151. dvi_enabled = 1;
  152. return 0;
  153. }
  154. static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
  155. {
  156. dvi_enabled = 0;
  157. }
  158. static struct panel_generic_dpi_data dvi_panel = {
  159. .name = "generic",
  160. .platform_enable = overo_panel_enable_dvi,
  161. .platform_disable = overo_panel_disable_dvi,
  162. };
  163. static struct omap_dss_device overo_dvi_device = {
  164. .name = "dvi",
  165. .type = OMAP_DISPLAY_TYPE_DPI,
  166. .driver_name = "generic_dpi_panel",
  167. .data = &dvi_panel,
  168. .phy.dpi.data_lines = 24,
  169. };
  170. static struct omap_dss_device overo_tv_device = {
  171. .name = "tv",
  172. .driver_name = "venc",
  173. .type = OMAP_DISPLAY_TYPE_VENC,
  174. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  175. };
  176. static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
  177. {
  178. if (dvi_enabled) {
  179. printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
  180. return -EINVAL;
  181. }
  182. gpio_set_value(OVERO_GPIO_LCD_EN, 1);
  183. gpio_set_value(OVERO_GPIO_LCD_BL, 1);
  184. lcd_enabled = 1;
  185. return 0;
  186. }
  187. static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
  188. {
  189. gpio_set_value(OVERO_GPIO_LCD_EN, 0);
  190. gpio_set_value(OVERO_GPIO_LCD_BL, 0);
  191. lcd_enabled = 0;
  192. }
  193. static struct panel_generic_dpi_data lcd43_panel = {
  194. .name = "samsung_lte430wq_f0c",
  195. .platform_enable = overo_panel_enable_lcd,
  196. .platform_disable = overo_panel_disable_lcd,
  197. };
  198. static struct omap_dss_device overo_lcd43_device = {
  199. .name = "lcd43",
  200. .type = OMAP_DISPLAY_TYPE_DPI,
  201. .driver_name = "generic_dpi_panel",
  202. .data = &lcd43_panel,
  203. .phy.dpi.data_lines = 24,
  204. };
  205. #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
  206. defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
  207. static struct omap_dss_device overo_lcd35_device = {
  208. .type = OMAP_DISPLAY_TYPE_DPI,
  209. .name = "lcd35",
  210. .driver_name = "lgphilips_lb035q02_panel",
  211. .phy.dpi.data_lines = 24,
  212. .platform_enable = overo_panel_enable_lcd,
  213. .platform_disable = overo_panel_disable_lcd,
  214. };
  215. #endif
  216. static struct omap_dss_device *overo_dss_devices[] = {
  217. &overo_dvi_device,
  218. &overo_tv_device,
  219. #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
  220. defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
  221. &overo_lcd35_device,
  222. #endif
  223. &overo_lcd43_device,
  224. };
  225. static struct omap_dss_board_info overo_dss_data = {
  226. .num_devices = ARRAY_SIZE(overo_dss_devices),
  227. .devices = overo_dss_devices,
  228. .default_device = &overo_dvi_device,
  229. };
  230. static struct regulator_consumer_supply overo_vdda_dac_supply =
  231. REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
  232. static struct regulator_consumer_supply overo_vdds_dsi_supply[] = {
  233. REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
  234. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
  235. };
  236. static struct mtd_partition overo_nand_partitions[] = {
  237. {
  238. .name = "xloader",
  239. .offset = 0, /* Offset = 0x00000 */
  240. .size = 4 * NAND_BLOCK_SIZE,
  241. .mask_flags = MTD_WRITEABLE
  242. },
  243. {
  244. .name = "uboot",
  245. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  246. .size = 14 * NAND_BLOCK_SIZE,
  247. },
  248. {
  249. .name = "uboot environment",
  250. .offset = MTDPART_OFS_APPEND, /* Offset = 0x240000 */
  251. .size = 2 * NAND_BLOCK_SIZE,
  252. },
  253. {
  254. .name = "linux",
  255. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  256. .size = 32 * NAND_BLOCK_SIZE,
  257. },
  258. {
  259. .name = "rootfs",
  260. .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
  261. .size = MTDPART_SIZ_FULL,
  262. },
  263. };
  264. static struct omap2_hsmmc_info mmc[] = {
  265. {
  266. .mmc = 1,
  267. .caps = MMC_CAP_4_BIT_DATA,
  268. .gpio_cd = -EINVAL,
  269. .gpio_wp = -EINVAL,
  270. },
  271. {
  272. .mmc = 2,
  273. .caps = MMC_CAP_4_BIT_DATA,
  274. .gpio_cd = -EINVAL,
  275. .gpio_wp = -EINVAL,
  276. .transceiver = true,
  277. .ocr_mask = 0x00100000, /* 3.3V */
  278. },
  279. {} /* Terminator */
  280. };
  281. static struct regulator_consumer_supply overo_vmmc1_supply = {
  282. .supply = "vmmc",
  283. };
  284. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  285. #include <linux/leds.h>
  286. static struct gpio_led gpio_leds[] = {
  287. {
  288. .name = "overo:red:gpio21",
  289. .default_trigger = "heartbeat",
  290. .gpio = 21,
  291. .active_low = true,
  292. },
  293. {
  294. .name = "overo:blue:gpio22",
  295. .default_trigger = "none",
  296. .gpio = 22,
  297. .active_low = true,
  298. },
  299. {
  300. .name = "overo:blue:COM",
  301. .default_trigger = "mmc0",
  302. .gpio = -EINVAL, /* gets replaced */
  303. .active_low = true,
  304. },
  305. };
  306. static struct gpio_led_platform_data gpio_leds_pdata = {
  307. .leds = gpio_leds,
  308. .num_leds = ARRAY_SIZE(gpio_leds),
  309. };
  310. static struct platform_device gpio_leds_device = {
  311. .name = "leds-gpio",
  312. .id = -1,
  313. .dev = {
  314. .platform_data = &gpio_leds_pdata,
  315. },
  316. };
  317. static void __init overo_init_led(void)
  318. {
  319. platform_device_register(&gpio_leds_device);
  320. }
  321. #else
  322. static inline void __init overo_init_led(void) { return; }
  323. #endif
  324. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  325. #include <linux/input.h>
  326. #include <linux/gpio_keys.h>
  327. static struct gpio_keys_button gpio_buttons[] = {
  328. {
  329. .code = BTN_0,
  330. .gpio = 23,
  331. .desc = "button0",
  332. .wakeup = 1,
  333. },
  334. {
  335. .code = BTN_1,
  336. .gpio = 14,
  337. .desc = "button1",
  338. .wakeup = 1,
  339. },
  340. };
  341. static struct gpio_keys_platform_data gpio_keys_pdata = {
  342. .buttons = gpio_buttons,
  343. .nbuttons = ARRAY_SIZE(gpio_buttons),
  344. };
  345. static struct platform_device gpio_keys_device = {
  346. .name = "gpio-keys",
  347. .id = -1,
  348. .dev = {
  349. .platform_data = &gpio_keys_pdata,
  350. },
  351. };
  352. static void __init overo_init_keys(void)
  353. {
  354. platform_device_register(&gpio_keys_device);
  355. }
  356. #else
  357. static inline void __init overo_init_keys(void) { return; }
  358. #endif
  359. static int overo_twl_gpio_setup(struct device *dev,
  360. unsigned gpio, unsigned ngpio)
  361. {
  362. omap2_hsmmc_init(mmc);
  363. overo_vmmc1_supply.dev = mmc[0].dev;
  364. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  365. /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
  366. gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
  367. #endif
  368. return 0;
  369. }
  370. static struct twl4030_gpio_platform_data overo_gpio_data = {
  371. .gpio_base = OMAP_MAX_GPIO_LINES,
  372. .irq_base = TWL4030_GPIO_IRQ_BASE,
  373. .irq_end = TWL4030_GPIO_IRQ_END,
  374. .use_leds = true,
  375. .setup = overo_twl_gpio_setup,
  376. };
  377. static struct twl4030_usb_data overo_usb_data = {
  378. .usb_mode = T2_USB_MODE_ULPI,
  379. };
  380. static struct regulator_init_data overo_vmmc1 = {
  381. .constraints = {
  382. .min_uV = 1850000,
  383. .max_uV = 3150000,
  384. .valid_modes_mask = REGULATOR_MODE_NORMAL
  385. | REGULATOR_MODE_STANDBY,
  386. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  387. | REGULATOR_CHANGE_MODE
  388. | REGULATOR_CHANGE_STATUS,
  389. },
  390. .num_consumer_supplies = 1,
  391. .consumer_supplies = &overo_vmmc1_supply,
  392. };
  393. /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
  394. static struct regulator_init_data overo_vdac = {
  395. .constraints = {
  396. .min_uV = 1800000,
  397. .max_uV = 1800000,
  398. .valid_modes_mask = REGULATOR_MODE_NORMAL
  399. | REGULATOR_MODE_STANDBY,
  400. .valid_ops_mask = REGULATOR_CHANGE_MODE
  401. | REGULATOR_CHANGE_STATUS,
  402. },
  403. .num_consumer_supplies = 1,
  404. .consumer_supplies = &overo_vdda_dac_supply,
  405. };
  406. /* VPLL2 for digital video outputs */
  407. static struct regulator_init_data overo_vpll2 = {
  408. .constraints = {
  409. .name = "VDVI",
  410. .min_uV = 1800000,
  411. .max_uV = 1800000,
  412. .valid_modes_mask = REGULATOR_MODE_NORMAL
  413. | REGULATOR_MODE_STANDBY,
  414. .valid_ops_mask = REGULATOR_CHANGE_MODE
  415. | REGULATOR_CHANGE_STATUS,
  416. },
  417. .num_consumer_supplies = ARRAY_SIZE(overo_vdds_dsi_supply),
  418. .consumer_supplies = overo_vdds_dsi_supply,
  419. };
  420. static struct twl4030_codec_audio_data overo_audio_data;
  421. static struct twl4030_codec_data overo_codec_data = {
  422. .audio_mclk = 26000000,
  423. .audio = &overo_audio_data,
  424. };
  425. static struct twl4030_platform_data overo_twldata = {
  426. .irq_base = TWL4030_IRQ_BASE,
  427. .irq_end = TWL4030_IRQ_END,
  428. .gpio = &overo_gpio_data,
  429. .usb = &overo_usb_data,
  430. .codec = &overo_codec_data,
  431. .vmmc1 = &overo_vmmc1,
  432. .vdac = &overo_vdac,
  433. .vpll2 = &overo_vpll2,
  434. };
  435. static int __init overo_i2c_init(void)
  436. {
  437. omap3_pmic_init("tps65950", &overo_twldata);
  438. /* i2c2 pins are used for gpio */
  439. omap_register_i2c_bus(3, 400, NULL, 0);
  440. return 0;
  441. }
  442. static struct spi_board_info overo_spi_board_info[] __initdata = {
  443. #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
  444. defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
  445. {
  446. .modalias = "lgphilips_lb035q02_panel-spi",
  447. .bus_num = 1,
  448. .chip_select = 1,
  449. .max_speed_hz = 500000,
  450. .mode = SPI_MODE_3,
  451. },
  452. #endif
  453. };
  454. static int __init overo_spi_init(void)
  455. {
  456. overo_ads7846_init();
  457. spi_register_board_info(overo_spi_board_info,
  458. ARRAY_SIZE(overo_spi_board_info));
  459. return 0;
  460. }
  461. static void __init overo_init_early(void)
  462. {
  463. omap2_init_common_infrastructure();
  464. omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
  465. mt46h32m32lf6_sdrc_params);
  466. }
  467. static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
  468. .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
  469. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  470. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
  471. .phy_reset = true,
  472. .reset_gpio_port[0] = -EINVAL,
  473. .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
  474. .reset_gpio_port[2] = -EINVAL
  475. };
  476. #ifdef CONFIG_OMAP_MUX
  477. static struct omap_board_mux board_mux[] __initdata = {
  478. { .reg_offset = OMAP_MUX_TERMINATOR },
  479. };
  480. #endif
  481. static struct omap_musb_board_data musb_board_data = {
  482. .interface_type = MUSB_INTERFACE_ULPI,
  483. .mode = MUSB_OTG,
  484. .power = 100,
  485. };
  486. static void __init overo_init(void)
  487. {
  488. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  489. overo_i2c_init();
  490. omap_display_init(&overo_dss_data);
  491. omap_serial_init();
  492. omap_nand_flash_init(0, overo_nand_partitions,
  493. ARRAY_SIZE(overo_nand_partitions));
  494. usb_musb_init(&musb_board_data);
  495. usbhs_init(&usbhs_bdata);
  496. overo_spi_init();
  497. overo_ads7846_init();
  498. overo_init_smsc911x();
  499. overo_display_init();
  500. overo_init_led();
  501. overo_init_keys();
  502. /* Ensure SDRC pins are mux'd for self-refresh */
  503. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  504. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  505. if ((gpio_request(OVERO_GPIO_W2W_NRESET,
  506. "OVERO_GPIO_W2W_NRESET") == 0) &&
  507. (gpio_direction_output(OVERO_GPIO_W2W_NRESET, 1) == 0)) {
  508. gpio_export(OVERO_GPIO_W2W_NRESET, 0);
  509. gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
  510. udelay(10);
  511. gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
  512. } else {
  513. printk(KERN_ERR "could not obtain gpio for "
  514. "OVERO_GPIO_W2W_NRESET\n");
  515. }
  516. if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) &&
  517. (gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0))
  518. gpio_export(OVERO_GPIO_BT_XGATE, 0);
  519. else
  520. printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n");
  521. if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) &&
  522. (gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) {
  523. gpio_export(OVERO_GPIO_BT_NRESET, 0);
  524. gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
  525. mdelay(6);
  526. gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
  527. } else {
  528. printk(KERN_ERR "could not obtain gpio for "
  529. "OVERO_GPIO_BT_NRESET\n");
  530. }
  531. if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) &&
  532. (gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0))
  533. gpio_export(OVERO_GPIO_USBH_CPEN, 0);
  534. else
  535. printk(KERN_ERR "could not obtain gpio for "
  536. "OVERO_GPIO_USBH_CPEN\n");
  537. }
  538. MACHINE_START(OVERO, "Gumstix Overo")
  539. .boot_params = 0x80000100,
  540. .reserve = omap_reserve,
  541. .map_io = omap3_map_io,
  542. .init_early = overo_init_early,
  543. .init_irq = omap_init_irq,
  544. .init_machine = overo_init,
  545. .timer = &omap_timer,
  546. MACHINE_END