[ARM] tegra: stingray: Configure Charge LED
authorGreg Meiste <w30289@motorola.com>
Thu, 5 Aug 2010 15:38:12 +0000 (10:38 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:31 +0000 (16:33 -0700)
Configure GPIO_PZ5 to control the charge LED.  For now, charge LEDs
are enabled when device is powered up.  GPIO is also exported to
enable factory testing.

Change-Id: I6bf7345cc795d57c1312c2c14ab1c74863a421ce
Signed-off-by: Greg Meiste <w30289@motorola.com>
arch/arm/mach-tegra/board-stingray.c

index 949238cc4135e7b47056d615edde965610f3d825..4312cbbcd0ad7b3ec6d7132e356440011a92328f 100644 (file)
@@ -861,6 +861,17 @@ static void __init tegra_stingray_init(void)
                gpio_export(TEGRA_GPIO_PI4, false);
        }
 
+       /* Enable charge LEDs */
+       if (stingray_revision() >= STINGRAY_REVISION_P0) {
+               /* Set the SYS_CLK_REQ override bit to allow PZ5 to be used
+                  as a GPIO. */
+               writel(0, IO_TO_VIRT(TEGRA_PMC_BASE + 0x01C));
+               tegra_gpio_enable(TEGRA_GPIO_PZ5);
+               gpio_request(TEGRA_GPIO_PZ5, "chg_led_disable");
+               gpio_direction_output(TEGRA_GPIO_PZ5, 0);
+               gpio_export(TEGRA_GPIO_PZ5, false);
+       }
+
        stingray_pinmux_init();
 
        tegra_clk_init_from_table(stingray_clk_init_table);