History

power: supply: core: add capacity error margin property

Add a property for reporting the error margin expected by fuel gauge chips.

Sebastian Reichel committed 6 years ago

Commit bac705a1 parent 655078f3 files · +17 −0Browse files

Unified · Split

3 files
  1. Documentation/ABI/testing/sysfs-class-power +15 −0
  2. drivers/power/supply/power_supply_sysfs.c +1 −0
  3. include/linux/power_supply.h +1 −0
Documentation/ABI/testing/sysfs-class-power+15−0
@@ -74,6 +74,21 @@ Description: · 73 unmodified lines
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+Contact: linux-pm@vger.kernel.org
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 Contact: linux-pm@vger.kernel.org
drivers/power/supply/power_supply_sysfs.c+1−0
@@ -178,6 +178,7 @@ static struct power_supply_attr power_supply_attrs[] = { · 177 unmodified lines
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+1−0
@@ -139,6 +139,7 @@ enum power_supply_property { · 138 unmodified lines
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,