power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED
authorSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 13 May 2020 18:56:00 +0000 (20:56 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 28 May 2020 17:25:31 +0000 (19:25 +0200)
Some battery fuel gauges know when the battery needs to
be recalibrated before providing usable values. This
should be reported via the health property.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Documentation/ABI/testing/sysfs-class-power
drivers/power/supply/power_supply_sysfs.c
include/linux/power_supply.h

index e6d7348766b23085709af4e76f9cb0b80698c168..216d61a22f1e72cadb1961fc3ad8a774fcb7395d 100644 (file)
@@ -205,7 +205,7 @@ Description:
                Valid values: "Unknown", "Good", "Overheat", "Dead",
                              "Over voltage", "Unspecified failure", "Cold",
                              "Watchdog timer expire", "Safety timer expire",
-                             "Over current"
+                             "Over current", "Calibration required"
 
 What:          /sys/class/power_supply/<supply_name>/precharge_current
 Date:          June 2017
index 78d5382e69f11d6c20bbaf671cf92efeb5f2c35f..bc79560229b5143f22f5a18678b56b233a9434e8 100644 (file)
@@ -100,6 +100,7 @@ static const char * const POWER_SUPPLY_HEALTH_TEXT[] = {
        [POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE] = "Watchdog timer expire",
        [POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE]   = "Safety timer expire",
        [POWER_SUPPLY_HEALTH_OVERCURRENT]           = "Over current",
+       [POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED]  = "Calibration required",
 };
 
 static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = {
index 63ffe2a0a87b24a3cbc87e2c1b63ae58e74c5f85..ac1345a48ad051737ed2355f94e68fbaae9e2131 100644 (file)
@@ -61,6 +61,7 @@ enum {
        POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
        POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
        POWER_SUPPLY_HEALTH_OVERCURRENT,
+       POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED,
 };
 
 enum {