diff options
| author | Peter Marheine <[email protected]> | 2025-05-08 02:41:45 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2025-05-09 19:14:34 +0000 |
| commit | 234f71555019d308c6bc6f98c78c5551cb8cd56a (patch) | |
| tree | e860fd0578f53429d366b5cbe75a416158738943 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | |
| parent | ACPI: battery: Round capacity percengate to closest integer (diff) | |
| download | kernel-234f71555019d308c6bc6f98c78c5551cb8cd56a.tar.gz kernel-234f71555019d308c6bc6f98c78c5551cb8cd56a.zip | |
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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
0 files changed, 0 insertions, 0 deletions
