Skip to content

Commit f4856c2

Browse files
Wer-Wolfij-intel
authored andcommitted
power: supply: core: Add additional health status values
Some batteries can signal when an internal fuse was blown. In such a case POWER_SUPPLY_HEALTH_DEAD is too vague for userspace applications to perform meaningful diagnostics. Additionally some batteries can also signal when some of their internal cells are imbalanced. In such a case returning POWER_SUPPLY_HEALTH_UNSPEC_FAILURE is again too vague for userspace applications to perform meaningful diagnostics. Add new health status values for both cases. Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 511a4a5 commit f4856c2

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ Description:
456456
"Over voltage", "Under voltage", "Unspecified failure", "Cold",
457457
"Watchdog timer expire", "Safety timer expire",
458458
"Over current", "Calibration required", "Warm",
459-
"Cool", "Hot", "No battery"
459+
"Cool", "Hot", "No battery", "Blown fuse", "Cell imbalance"
460460

461461
What: /sys/class/power_supply/<supply_name>/precharge_current
462462
Date: June 2017

drivers/power/supply/power_supply_sysfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ static const char * const POWER_SUPPLY_HEALTH_TEXT[] = {
110110
[POWER_SUPPLY_HEALTH_COOL] = "Cool",
111111
[POWER_SUPPLY_HEALTH_HOT] = "Hot",
112112
[POWER_SUPPLY_HEALTH_NO_BATTERY] = "No battery",
113+
[POWER_SUPPLY_HEALTH_BLOWN_FUSE] = "Blown fuse",
114+
[POWER_SUPPLY_HEALTH_CELL_IMBALANCE] = "Cell imbalance",
113115
};
114116

115117
static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = {

include/linux/power_supply.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ enum {
7171
POWER_SUPPLY_HEALTH_COOL,
7272
POWER_SUPPLY_HEALTH_HOT,
7373
POWER_SUPPLY_HEALTH_NO_BATTERY,
74+
POWER_SUPPLY_HEALTH_BLOWN_FUSE,
75+
POWER_SUPPLY_HEALTH_CELL_IMBALANCE,
7476
};
7577

7678
enum {

0 commit comments

Comments
 (0)