Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <W_Armin@gmx.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20250429003606.303870-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Armin Wolf and committed by
Ilpo Järvinen
f4856c20 511a4a5e

+5 -1
+1 -1
Documentation/ABI/testing/sysfs-class-power
··· 456 456 "Over voltage", "Under voltage", "Unspecified failure", "Cold", 457 457 "Watchdog timer expire", "Safety timer expire", 458 458 "Over current", "Calibration required", "Warm", 459 - "Cool", "Hot", "No battery" 459 + "Cool", "Hot", "No battery", "Blown fuse", "Cell imbalance" 460 460 461 461 What: /sys/class/power_supply/<supply_name>/precharge_current 462 462 Date: June 2017
+2
drivers/power/supply/power_supply_sysfs.c
··· 110 110 [POWER_SUPPLY_HEALTH_COOL] = "Cool", 111 111 [POWER_SUPPLY_HEALTH_HOT] = "Hot", 112 112 [POWER_SUPPLY_HEALTH_NO_BATTERY] = "No battery", 113 + [POWER_SUPPLY_HEALTH_BLOWN_FUSE] = "Blown fuse", 114 + [POWER_SUPPLY_HEALTH_CELL_IMBALANCE] = "Cell imbalance", 113 115 }; 114 116 115 117 static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = {
+2
include/linux/power_supply.h
··· 71 71 POWER_SUPPLY_HEALTH_COOL, 72 72 POWER_SUPPLY_HEALTH_HOT, 73 73 POWER_SUPPLY_HEALTH_NO_BATTERY, 74 + POWER_SUPPLY_HEALTH_BLOWN_FUSE, 75 + POWER_SUPPLY_HEALTH_CELL_IMBALANCE, 74 76 }; 75 77 76 78 enum {