diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-01-17 08:49:45 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-01-23 06:33:05 -0500 |
commit | d80108fc69484c20c3b85d7cdc948e191e843fa4 (patch) | |
tree | 61b07ee01abf8fd66ee29f7b6e008f22496e53a1 /drivers/power | |
parent | 3edebfcdb31e6203abe0994c1e785833d928e8b4 (diff) |
ab8500-chargalg: Update battery health on safety timer exp
When the charging safety timer elapses, the battery health is
shown as "Good". This is misleading and also makes it difficult
to distinguish issues relating to discharging despite the fact
that the charger is still connected.
When in actual fact a safety timer elapse is an indication of a
fault in the battery. Here we make this clearer by reporting
POWER_SUPPLY_HEALTH_UNSPEC_FAILURE instead.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/abx500_chargalg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 830b2dd7ac6d..2463fa01d63f 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c | |||
@@ -1628,6 +1628,9 @@ static int abx500_chargalg_get_property(struct power_supply *psy, | |||
1628 | val->intval = POWER_SUPPLY_HEALTH_COLD; | 1628 | val->intval = POWER_SUPPLY_HEALTH_COLD; |
1629 | else | 1629 | else |
1630 | val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; | 1630 | val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; |
1631 | } else if (di->charge_state == STATE_SAFETY_TIMER_EXPIRED || | ||
1632 | di->charge_state == STATE_SAFETY_TIMER_EXPIRED_INIT) { | ||
1633 | val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; | ||
1631 | } else { | 1634 | } else { |
1632 | val->intval = POWER_SUPPLY_HEALTH_GOOD; | 1635 | val->intval = POWER_SUPPLY_HEALTH_GOOD; |
1633 | } | 1636 | } |