[ARM] tegra: stingray: Export charging GPIOs
authorGreg Meiste <w30289@motorola.com>
Wed, 7 Jul 2010 21:41:05 +0000 (16:41 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:16 +0000 (16:33 -0700)
The factory needs to be able to control the charging IC
during the device testing before the device is allowed
to ship.

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

index 6cf6cff4cc862fba1156157a56baeca2ffa3ac32..c4f78c5a2a1af828d754dcc77964b2d651e2affc 100644 (file)
@@ -565,15 +565,33 @@ static void __init tegra_stingray_init(void)
 
        /* Enable charging */
        tegra_gpio_enable(TEGRA_GPIO_PV5);
-       tegra_gpio_enable(TEGRA_GPIO_PV6);
+       gpio_request(TEGRA_GPIO_PV5, "chg_stat1");
+       gpio_export(TEGRA_GPIO_PV5, false);
        if (stingray_revision() <= STINGRAY_REVISION_P0) {
                bq24617_device.resource = bq24617_resources_m1_p0;
 
+               tegra_gpio_enable(TEGRA_GPIO_PV6);
+               gpio_request(TEGRA_GPIO_PV6, "chg_stat2");
+               gpio_export(TEGRA_GPIO_PV6, false);
+
                tegra_gpio_enable(TEGRA_GPIO_PJ0);
                gpio_request(TEGRA_GPIO_PJ0, "chg_disable");
                gpio_direction_output(TEGRA_GPIO_PJ0, 0);
-       } else
+               gpio_export(TEGRA_GPIO_PJ0, false);
+       } else {
+               tegra_gpio_enable(TEGRA_GPIO_PV6);
+               gpio_request(TEGRA_GPIO_PV6, "chg_detect");
+               gpio_export(TEGRA_GPIO_PV6, false);
+
                tegra_gpio_enable(TEGRA_GPIO_PD1);
+               gpio_request(TEGRA_GPIO_PD1, "chg_stat2");
+               gpio_export(TEGRA_GPIO_PD1, false);
+
+               tegra_gpio_enable(TEGRA_GPIO_PI4);
+               gpio_request(TEGRA_GPIO_PI4, "chg_disable");
+               gpio_direction_output(TEGRA_GPIO_PI4, 0);
+               gpio_export(TEGRA_GPIO_PI4, false);
+       }
 
        stingray_pinmux_init();