[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap-psp-2.6.32 / beagleboard-xmc / 0006-omap3-beaglexm-fix-power-on-of-DVI.patch
1 From 7ad849e3d54d897614a74ad225392bd243e07d2e Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@beagleboard.org>
3 Date: Wed, 12 Jan 2011 00:23:29 +0000
4 Subject: [PATCH 06/10] omap3: beaglexm: fix power on of DVI
6 TFP410 DVI chip is used to provide display out.
7 This chip is controlled by 2 lines:
8 LDO which supplies the power is controlled over gpio + 2
9 and the enable of the chip itself is done over gpio + 1
10 NOTE: the LDO is necessary for LED, serial blocks as well.
12 gpio + 1 was used to sense USB overcurrent in vanilla beagle.
14 Without this fix, the display would not function as the LDO
15 remains shut down.
17 [nm@ti.com: split up, added descriptive changelogs]
18 Signed-off-by: Nishanth Menon <nm@ti.com>
19 Signed-off-by: Koen Kooi <koen@beagleboard.org>
20 Signed-off-by: Tony Lindgren <tony@atomide.com>
21 ---
22 arch/arm/mach-omap2/board-omap3beagle.c | 40 +++++++++++++++++++++++++++++++
23 1 files changed, 40 insertions(+), 0 deletions(-)
25 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
26 index 939de5a..9880c5c 100644
27 --- a/arch/arm/mach-omap2/board-omap3beagle.c
28 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
29 @@ -444,6 +444,8 @@ static struct gpio_led gpio_leds[];
30 static int beagle_twl_gpio_setup(struct device *dev,
31 unsigned gpio, unsigned ngpio)
32 {
33 + int r;
34 +
35 if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
36 mmc[0].gpio_wp = -EINVAL;
37 } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
38 @@ -465,6 +467,17 @@ static int beagle_twl_gpio_setup(struct device *dev,
39 * power switch and overcurrent detect
40 */
42 + if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
43 + r = gpio_request(gpio + 1, "EHCI_nOC");
44 + if (!r) {
45 + r = gpio_direction_input(gpio + 1);
46 + if (r)
47 + gpio_free(gpio + 1);
48 + }
49 + if (r)
50 + pr_err("%s: unable to configure EHCI_nOC\n", __func__);
51 + }
52 +
53 if (cpu_is_omap3630()) {
54 /* Power on DVI, Serial and PWR led */
55 gpio_request(gpio + 1, "nDVI_PWR_EN");
56 @@ -506,6 +519,33 @@ static int beagle_twl_gpio_setup(struct device *dev,
57 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
58 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
60 + /*
61 + * gpio + 1 on Xm controls the TFP410's enable line (active low)
62 + * gpio + 2 control varies depending on the board rev as follows:
63 + * P7/P8 revisions(prototype): Camera EN
64 + * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
65 + */
66 + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
67 + r = gpio_request(gpio + 1, "nDVI_PWR_EN");
68 + if (!r) {
69 + r = gpio_direction_output(gpio + 1, 0);
70 + if (r)
71 + gpio_free(gpio + 1);
72 + }
73 + if (r)
74 + pr_err("%s: unable to configure nDVI_PWR_EN\n",
75 + __func__);
76 + r = gpio_request(gpio + 2, "DVI_LDO_EN");
77 + if (!r) {
78 + r = gpio_direction_output(gpio + 2, 1);
79 + if (r)
80 + gpio_free(gpio + 2);
81 + }
82 + if (r)
83 + pr_err("%s: unable to configure DVI_LDO_EN\n",
84 + __func__);
85 + }
86 +
87 return 0;
88 }
90 --
91 1.6.6.1