arm: tegra: enterprise: battery detection support for fuel-gauge
syed rafiuddin [Thu, 29 Sep 2011 05:14:45 +0000 (10:14 +0530)]
Adding battery present support to fuel-gauge driver
so as not to report battery charecterstics when
battery is not present

bug 873965

Reviewed-on: http://git-master/r/61831
(cherry picked from commit f7087f71f5ed04d5a6c88fa6c8296f85029e2efd)

Change-Id: I3cf95d530845388d189ef860ba4ee7d933dd3fd8
Reviewed-on: http://git-master/r/64091
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: Rdaf381deafc9f549522779d7e3baad21f3cd7834

arch/arm/mach-tegra/board-enterprise-power.c

index 15c236c..5013982 100644 (file)
@@ -240,6 +240,7 @@ static struct tps80031_charger_platform_data bcharger_pdata = {
 
 static struct tps80031_bg_platform_data battery_gauge_data = {
        .irq_base = ENT_TPS80031_IRQ_BASE,
+       .battery_present = 1,
 };
 
 #define TPS_RTC()                              \
@@ -490,6 +491,7 @@ int __init enterprise_regulator_init(void)
        if (get_power_supply_type() == POWER_SUPPLY_TYPE_MAINS) {
                bcharger_pdata.num_consumer_supplies = 0;
                bcharger_pdata.consumer_supplies = NULL;
+               battery_gauge_data.battery_present = 0;
        }
 
        i2c_register_board_info(4, enterprise_regulators, 1);