[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250425231518.16125-1-W_Armin@gmx.de>
Date: Sat, 26 Apr 2025 01:15:15 +0200
From: Armin Wolf <W_Armin@....de>
To: hdegoede@...hat.com,
ilpo.jarvinen@...ux.intel.com
Cc: sre@...nel.org,
platform-driver-x86@...r.kernel.org,
linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] 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@....de>
---
Documentation/ABI/testing/sysfs-class-power | 2 +-
drivers/power/supply/power_supply_sysfs.c | 2 ++
include/linux/power_supply.h | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
index 2a5c1a09a28f..e84a7349f55f 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -456,7 +456,7 @@ Description:
"Over voltage", "Under voltage", "Unspecified failure", "Cold",
"Watchdog timer expire", "Safety timer expire",
"Over current", "Calibration required", "Warm",
- "Cool", "Hot", "No battery"
+ "Cool", "Hot", "No battery", "Fuse blown", "Cell imbalanced"
What: /sys/class/power_supply/<supply_name>/precharge_current
Date: June 2017
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index edb058c19c9c..3a9c9cf55b30 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -110,6 +110,8 @@ static const char * const POWER_SUPPLY_HEALTH_TEXT[] = {
[POWER_SUPPLY_HEALTH_COOL] = "Cool",
[POWER_SUPPLY_HEALTH_HOT] = "Hot",
[POWER_SUPPLY_HEALTH_NO_BATTERY] = "No battery",
+ [POWER_SUPPLY_HEALTH_FUSE_BLOWN] = "Fuse blown",
+ [POWER_SUPPLY_HEALTH_CELL_IMBALANCED] = "Cell imbalanced",
};
static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 888824592953..36454df14bc4 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -71,6 +71,8 @@ enum {
POWER_SUPPLY_HEALTH_COOL,
POWER_SUPPLY_HEALTH_HOT,
POWER_SUPPLY_HEALTH_NO_BATTERY,
+ POWER_SUPPLY_HEALTH_FUSE_BLOWN,
+ POWER_SUPPLY_HEALTH_CELL_IMBALANCED,
};
enum {
--
2.39.5
Powered by blists - more mailing lists