Skip to content

Commit bac705a

Browse files
committed
power: supply: core: add capacity error margin property
Add a property for reporting the error margin expected by fuel gauge chips. Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 655078f commit bac705a

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ Description:
7474
Access: Read, Write
7575
Valid values: 0 - 100 (percent)
7676

77+
What: /sys/class/power_supply/<supply_name>/capacity_error_margin
78+
Date: April 2019
79+
80+
Description:
81+
Battery capacity measurement becomes unreliable without
82+
recalibration. This values provides the maximum error
83+
margin expected to exist by the fuel gauge in percent.
84+
Values close to 0% will be returned after (re-)calibration
85+
has happened. Over time the error margin will increase.
86+
100% means, that the capacity related values are basically
87+
completely useless.
88+
89+
Access: Read
90+
Valid values: 0 - 100 (percent)
91+
7792
What: /sys/class/power_supply/<supply_name>/capacity_level
7893
Date: June 2009
7994

drivers/power/supply/power_supply_sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static struct power_supply_attr power_supply_attrs[] = {
178178
POWER_SUPPLY_ATTR(CAPACITY),
179179
POWER_SUPPLY_ATTR(CAPACITY_ALERT_MIN),
180180
POWER_SUPPLY_ATTR(CAPACITY_ALERT_MAX),
181+
POWER_SUPPLY_ATTR(CAPACITY_ERROR_MARGIN),
181182
POWER_SUPPLY_ENUM_ATTR(CAPACITY_LEVEL),
182183
POWER_SUPPLY_ATTR(TEMP),
183184
POWER_SUPPLY_ATTR(TEMP_MAX),

include/linux/power_supply.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ enum power_supply_property {
139139
POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
140140
POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN, /* in percents! */
141141
POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */
142+
POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN, /* in percents! */
142143
POWER_SUPPLY_PROP_CAPACITY_LEVEL,
143144
POWER_SUPPLY_PROP_TEMP,
144145
POWER_SUPPLY_PROP_TEMP_MAX,

0 commit comments

Comments
 (0)