summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakan Berg <hakan.berg@stericsson.com>2012-04-25 09:44:39 +0200
committerMathieu J. Poirier <mathieu.poirier@linaro.org>2012-09-18 07:54:46 -0600
commit021b51deb56336d75f81b20fecf877c24d55b855 (patch)
tree4f71f1c04cde9f6c8d731b9007f57fa4021344c4
parenta7973ae214c2e79b0d41cda701450dae1f71201d (diff)
ab8500-chargalg: update battery health on safety timer exp
When the charging safety timer is elapsed the battery health is shown as "Good". This is misleading and also hard to distingiush problems reported on "phone discharges although charger is attached". When safety timer elapses that is an indication of a fault in the battery of some kind. Hence report as POWER_SUPPLY_HEALTH_UNSPEC_FAILURE. Signed-off-by: Hakan Berg <hakan.berg@stericsson.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arun MURTHY <arun.murthy@stericsson.com> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
-rw-r--r--drivers/power/abx500_chargalg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index 4db0ef01e4c9..1df238f2bd47 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -1711,6 +1711,10 @@ static int abx500_chargalg_get_property(struct power_supply *psy,
val->intval = POWER_SUPPLY_HEALTH_COLD;
else
val->intval = POWER_SUPPLY_HEALTH_OVERHEAT;
+ } else if (di->charge_state == STATE_SAFETY_TIMER_EXPIRED ||
+ di->charge_state ==
+ STATE_SAFETY_TIMER_EXPIRED_INIT) {
+ val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE;
} else {
val->intval = POWER_SUPPLY_HEALTH_GOOD;
}