Thread (26 messages) 26 messages, 3 authors, 2015-09-04
STALE3979d
Revisions (4)
  1. v1 current
  2. v2 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]

[PATCH 02/13] power: bq24257: Add dead battery reporting

From: Andreas Dannenberg <hidden>
Date: 2015-09-01 02:10:24
Also in: linux-pm
Subsystem: the rest · Maintainer: Linus Torvalds

A missing/disconnected battery is now reported as dead rather than an
unspecified failure via the charger's sysfs health property.

$ cat health
Dead

Signed-off-by: Andreas Dannenberg <redacted>
---
 drivers/power/bq24257_charger.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c
index db81356..0b34528 100644
--- a/drivers/power/bq24257_charger.c
+++ b/drivers/power/bq24257_charger.c
@@ -274,6 +274,10 @@ static int bq24257_power_supply_get_property(struct power_supply *psy,
 			val->intval = POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE;
 			break;
 
+		case FAULT_NO_BAT:
+			val->intval = POWER_SUPPLY_HEALTH_DEAD;
+			break;
+
 		default:
 			val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE;
 			break;
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help