diff options
author | Peter Marheine <pmarheine@chromium.org> | 2025-05-08 12:41:45 +1000 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-05-09 21:14:34 +0200 |
commit | 234f71555019d308c6bc6f98c78c5551cb8cd56a (patch) | |
tree | e860fd0578f53429d366b5cbe75a416158738943 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 46d839adcc93ccc445f90866c31b2ed2785f0319 (diff) |
ACPI: battery: negate current when discharging
The ACPI specification requires that battery rate is always positive,
but the kernel ABI for POWER_SUPPLY_PROP_CURRENT_NOW
(Documentation/ABI/testing/sysfs-class-power) specifies that it should
be negative when a battery is discharging. When reporting CURRENT_NOW,
massage the value to match the documented ABI.
This only changes the sign of `current_now` and not `power_now` because
documentation doesn't describe any particular meaning for `power_now` so
leaving `power_now` unchanged is less likely to confuse userspace
unnecessarily, whereas becoming consistent with the documented ABI is
worth potentially confusing clients that read `current_now`.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Link: https://patch.msgid.link/20250508024146.1436129-1-pmarheine@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions