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

power: supply: core: Add state_of_health power supply property

Add state_of_health power supply property to represent battery
health percentage.

Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Fenglin Wu and committed by
Sebastian Reichel
cd93fbdc d69ae81e

+23
+21
Documentation/ABI/testing/sysfs-class-power
··· 569 569 570 570 Valid values: Represented in microohms 571 571 572 + What: /sys/class/power_supply/<supply_name>/state_of_health 573 + Date: August 2025 574 + Contact: linux-arm-msm@vger.kernel.org 575 + Description: 576 + The state_of_health parameter quantifies the overall condition 577 + of a battery as a percentage, reflecting its ability to deliver 578 + rated performance relative to its original specifications. It is 579 + dynamically computed using a combination of learned capacity 580 + and impedance-based degradation indicators, both of which evolve 581 + over the battery's lifecycle. 582 + Note that the exact algorithms are kept secret by most battery 583 + vendors and the value from different battery vendors cannot be 584 + compared with each other as there is no vendor-agnostic definition 585 + of "performance". Also this usually cannot be used for any 586 + calculations (i.e. this is not the factor between charge_full and 587 + charge_full_design). 588 + 589 + Access: Read 590 + 591 + Valid values: 0 - 100 (percent) 592 + 572 593 **USB Properties** 573 594 574 595 What: /sys/class/power_supply/<supply_name>/input_current_limit
+1
drivers/power/supply/power_supply_sysfs.c
··· 224 224 POWER_SUPPLY_ATTR(MANUFACTURE_MONTH), 225 225 POWER_SUPPLY_ATTR(MANUFACTURE_DAY), 226 226 POWER_SUPPLY_ATTR(INTERNAL_RESISTANCE), 227 + POWER_SUPPLY_ATTR(STATE_OF_HEALTH), 227 228 /* Properties of type `const char *' */ 228 229 POWER_SUPPLY_ATTR(MODEL_NAME), 229 230 POWER_SUPPLY_ATTR(MANUFACTURER),
+1
include/linux/power_supply.h
··· 177 177 POWER_SUPPLY_PROP_MANUFACTURE_MONTH, 178 178 POWER_SUPPLY_PROP_MANUFACTURE_DAY, 179 179 POWER_SUPPLY_PROP_INTERNAL_RESISTANCE, 180 + POWER_SUPPLY_PROP_STATE_OF_HEALTH, 180 181 /* Properties of type `const char *' */ 181 182 POWER_SUPPLY_PROP_MODEL_NAME, 182 183 POWER_SUPPLY_PROP_MANUFACTURER,