^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) Kernel driver power_meter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) =========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) This driver talks to ACPI 4.0 power meters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Supported systems:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Any recent system with ACPI 4.0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Prefix: 'power_meter'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Datasheet: https://uefi.org/specifications, section 10.4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) Author: Darrick J. Wong
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) This driver implements sensor reading support for the power meters exposed in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) features--a power meter that returns average power use over a configurable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) interval, an optional capping mechanism, and a couple of trip points. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) sysfs interface conforms with the specification outlined in the "Power" section
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) of Documentation/hwmon/sysfs-interface.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) Special Features
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) The `power[1-*]_is_battery` knob indicates if the power supply is a battery.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Both `power[1-*]_average_{min,max}` must be set before the trip points will work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) When both of them are set, an ACPI event will be broadcast on the ACPI netlink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) socket and a poll notification will be sent to the appropriate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) `power[1-*]_average` sysfs file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) The `power[1-*]_{model_number, serial_number, oem_info}` fields display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) arbitrary strings that ACPI provides with the meter. The measures/ directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) contains symlinks to the devices that this meter measures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) Some computers have the ability to enforce a power cap in hardware. If this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) the case, the `power[1-*]_cap` and related sysfs files will appear. When the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) average power consumption exceeds the cap, an ACPI event will be broadcast on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) the netlink event socket and a poll notification will be sent to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) appropriate `power[1-*]_alarm` file to indicate that capping has begun, and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) hardware has taken action to reduce power consumption. Most likely this will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) result in reduced performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) There are a few other ACPI notifications that can be sent by the firmware. In
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) all cases the ACPI event will be broadcast on the ACPI netlink event socket as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) well as sent as a poll notification to a sysfs file. The events are as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) `power[1-*]_cap` will be notified if the firmware changes the power cap.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) `power[1-*]_interval` will be notified if the firmware changes the averaging
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) interval.