[PATCH 20/24] ab8500-fg: Use correct battery charge full design

Lee Jones lee.jones at linaro.org
Mon Jan 21 07:03:56 EST 2013


From: Rajkumar Kasirajan <rajkumar.kasirajan at stericsson.com>

If battery is not identified while fg probe, mah_max_design gets
initialized with unknown battery's charge full design. Reinitialize
mah_max_design if battery is identified after fg probe.

Signed-off-by: Lee Jones <lee.jones at linaro.org>
Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan at stericsson.com>
Reviewed-by: Vijaya Kumar K-1 <vijay.kilari at stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper at stericsson.com>
Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud at stericsson.com>
Reviewed-by: Arun MURTHY <arun.murthy at stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent at stericsson.com>
Tested-by: Rupesh KUMAR <rupesh.kumar at stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg at stericsson.com>
---
 drivers/power/ab8500_fg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 1a78116..0780b60 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2090,7 +2090,8 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
 		case POWER_SUPPLY_PROP_TECHNOLOGY:
 			switch (ext->type) {
 			case POWER_SUPPLY_TYPE_BATTERY:
-				if (!di->flags.batt_id_received) {
+				if (!di->flags.batt_id_received &&
+				    di->bm->batt_id != BATTERY_UNKNOWN) {
 					const struct abx500_battery_type *b;
 
 					b = &(di->bm->bat_type[di->bm->batt_id]);
-- 
1.7.9.5




More information about the linux-arm-kernel mailing list