arm: laguna: Register charger only when battery connected
Darbha Sriharsha [Fri, 29 Nov 2013 07:05:35 +0000 (12:05 +0530)]
Register bq24715 battery charger driver only when a battery
is connected to the platform (When it is specified through
ODM data that battery has been connected).

Bug 1271064

Change-Id: I0d6fc482c3e4d6f4512c3a06575f9525a197b906
Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com>
Reviewed-on: http://git-master/r/336900
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

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

index 971e177..b550479 100644 (file)
@@ -834,8 +834,9 @@ int __init laguna_regulator_init(void)
 #endif
        laguna_as3722_regulator_init();
 
-       i2c_register_board_info(1, bq2471x_boardinfo,
-               ARRAY_SIZE(bq2471x_boardinfo));
+       if (get_power_supply_type() == POWER_SUPPLY_TYPE_BATTERY)
+               i2c_register_board_info(1, bq2471x_boardinfo,
+                       ARRAY_SIZE(bq2471x_boardinfo));
 
        return 0;
 }