[ARM] tegra: ventana: enable battery charging at boot up
Varun Wadekar [Thu, 9 Dec 2010 09:13:36 +0000 (14:13 +0530)]
Bug 749251

Original-Change-Id: I95db2d0327f4425de40e64b4ea70c0c76f908ab9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/12465
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R93eae47b9e270c19d4cc1adf164330ceb114b0c5

arch/arm/mach-tegra/board-ventana-power.c
arch/arm/mach-tegra/board-ventana.c
arch/arm/mach-tegra/board-ventana.h

index d43a832..2e3d1fd 100644 (file)
 #define PMC_CTRL               0x0
 #define PMC_CTRL_INTR_LOW      (1 << 17)
 
+#define ventana_ac_ok  TEGRA_GPIO_PV3
+
+int __init ventana_charge_init(void)
+{
+       gpio_request(ventana_ac_ok, "ac_ok");
+       gpio_direction_input(ventana_ac_ok);
+       tegra_gpio_enable(ventana_ac_ok);
+       return 0;
+}
+
 static struct regulator_consumer_supply tps658621_sm0_supply[] = {
        REGULATOR_SUPPLY("vdd_core", NULL),
 };
index e622ef0..45d06d5 100644 (file)
@@ -374,6 +374,7 @@ static void __init tegra_ventana_init(void)
        platform_add_devices(ventana_devices, ARRAY_SIZE(ventana_devices));
        ventana_sdhci_init();
        ventana_i2c_init();
+       ventana_charge_init();
        ventana_regulator_init();
        ventana_touch_init();
        ventana_keys_init();
index 28f3a02..26799c8 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef _MACH_TEGRA_BOARD_VENTANA_H
 #define _MACH_TEGRA_BOARD_VENTANA_H
 
+int ventana_charge_init(void);
 int ventana_regulator_init(void);
 int ventana_sdhci_init(void);
 int ventana_pinmux_init(void);