aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap3beagle.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3beagle.c')
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 673deb9189fe..2ed804073f35 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -273,6 +273,8 @@ static struct gpio_led gpio_leds[];
273static int beagle_twl_gpio_setup(struct device *dev, 273static int beagle_twl_gpio_setup(struct device *dev,
274 unsigned gpio, unsigned ngpio) 274 unsigned gpio, unsigned ngpio)
275{ 275{
276 int r;
277
276 if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) { 278 if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
277 mmc[0].gpio_wp = -EINVAL; 279 mmc[0].gpio_wp = -EINVAL;
278 } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) || 280 } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
@@ -293,9 +295,16 @@ static int beagle_twl_gpio_setup(struct device *dev,
293 /* REVISIT: need ehci-omap hooks for external VBUS 295 /* REVISIT: need ehci-omap hooks for external VBUS
294 * power switch and overcurrent detect 296 * power switch and overcurrent detect
295 */ 297 */
296 298 if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
297 gpio_request(gpio + 1, "EHCI_nOC"); 299 r = gpio_request(gpio + 1, "EHCI_nOC");
298 gpio_direction_input(gpio + 1); 300 if (!r) {
301 r = gpio_direction_input(gpio + 1);
302 if (r)
303 gpio_free(gpio + 1);
304 }
305 if (r)
306 pr_err("%s: unable to configure EHCI_nOC\n", __func__);
307 }
299 308
300 /* 309 /*
301 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active 310 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
@@ -316,6 +325,33 @@ static int beagle_twl_gpio_setup(struct device *dev,
316 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ 325 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
317 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 326 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
318 327
328 /*
329 * gpio + 1 on Xm controls the TFP410's enable line (active low)
330 * gpio + 2 control varies depending on the board rev as follows:
331 * P7/P8 revisions(prototype): Camera EN
332 * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
333 */
334 if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
335 r = gpio_request(gpio + 1, "nDVI_PWR_EN");
336 if (!r) {
337 r = gpio_direction_output(gpio + 1, 0);
338 if (r)
339 gpio_free(gpio + 1);
340 }
341 if (r)
342 pr_err("%s: unable to configure nDVI_PWR_EN\n",
343 __func__);
344 r = gpio_request(gpio + 2, "DVI_LDO_EN");
345 if (!r) {
346 r = gpio_direction_output(gpio + 2, 1);
347 if (r)
348 gpio_free(gpio + 2);
349 }
350 if (r)
351 pr_err("%s: unable to configure DVI_LDO_EN\n",
352 __func__);
353 }
354
319 return 0; 355 return 0;
320} 356}
321 357