diff options
author | Koen Kooi <koen@beagleboard.org> | 2011-01-11 19:23:29 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-01-11 20:01:30 -0500 |
commit | 1bd9ef198498e3e00c9d78a1566338f7ea2e4bb5 (patch) | |
tree | aec0f2576a4402fdb31a276363ef899a83b4dce9 /arch | |
parent | 0f7e2aaa03ea3f2393d3446c686036ce51298d3e (diff) |
omap3: beaglexm: fix power on of DVI
TFP410 DVI chip is used to provide display out.
This chip is controlled by 2 lines:
LDO which supplies the power is controlled over gpio + 2
and the enable of the chip itself is done over gpio + 1
NOTE: the LDO is necessary for LED, serial blocks as well.
gpio + 1 was used to sense USB overcurrent in vanilla beagle.
Without this fix, the display would not function as the LDO
remains shut down.
[nm@ti.com: split up, added descriptive changelogs]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Koen Kooi <koen@beagleboard.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 42 |
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[]; | |||
273 | static int beagle_twl_gpio_setup(struct device *dev, | 273 | static 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 | ||