]> www.infradead.org Git - users/hch/misc.git/commitdiff
power: supply: core: Add resistance power supply property
authorFenglin Wu <fenglin.wu@oss.qualcomm.com>
Wed, 17 Sep 2025 10:15:14 +0000 (18:15 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 17 Sep 2025 23:01:03 +0000 (01:01 +0200)
Some battery drivers provide the ability to export internal resistance
as a parameter. Add internal_resistance power supply property for that
purpose.

Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
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 87a058e14e7edd0b89a0a10b161d31c5d16e8da7..e6cce423c632f0bb706187dde198c180405dd9c7 100644 (file)
@@ -553,6 +553,22 @@ Description:
                        Integer > 0: representing full cycles
                        Integer = 0: cycle_count info is not available
 
+What:          /sys/class/power_supply/<supply_name>/internal_resistance
+Date:          August 2025
+Contact:       linux-arm-msm@vger.kernel.org
+Description:
+               Represent the battery's internal resistance, often referred
+               to as Equivalent Series Resistance (ESR). It is a dynamic
+               parameter that reflects the opposition to current flow within
+               the cell. It is not a fixed value but varies significantly
+               based on several operational conditions, including battery
+               state of charge (SoC), temperature, and whether the battery
+               is in a charging or discharging state.
+
+               Access: Read
+
+               Valid values: Represented in microohms
+
 **USB Properties**
 
 What:          /sys/class/power_supply/<supply_name>/input_current_limit
index 18e5e84a81c634f7c6c07b761456265dd0fc8cea..8ba08d456352b9333e136bc2417043f9244848d6 100644 (file)
@@ -223,6 +223,7 @@ static struct power_supply_attr power_supply_attrs[] __ro_after_init = {
        POWER_SUPPLY_ATTR(MANUFACTURE_YEAR),
        POWER_SUPPLY_ATTR(MANUFACTURE_MONTH),
        POWER_SUPPLY_ATTR(MANUFACTURE_DAY),
+       POWER_SUPPLY_ATTR(INTERNAL_RESISTANCE),
        /* Properties of type `const char *' */
        POWER_SUPPLY_ATTR(MODEL_NAME),
        POWER_SUPPLY_ATTR(MANUFACTURER),
index f21f806bfb3831e0328683afe994ff3b18d1938d..f38da7c039d20500cf9b7d901f64a9bdfece8604 100644 (file)
@@ -176,6 +176,7 @@ enum power_supply_property {
        POWER_SUPPLY_PROP_MANUFACTURE_YEAR,
        POWER_SUPPLY_PROP_MANUFACTURE_MONTH,
        POWER_SUPPLY_PROP_MANUFACTURE_DAY,
+       POWER_SUPPLY_PROP_INTERNAL_RESISTANCE,
        /* Properties of type `const char *' */
        POWER_SUPPLY_PROP_MODEL_NAME,
        POWER_SUPPLY_PROP_MANUFACTURER,