Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver power_meter
0002 =========================
0003 
0004 This driver talks to ACPI 4.0 power meters.
0005 
0006 Supported systems:
0007 
0008   * Any recent system with ACPI 4.0.
0009 
0010     Prefix: 'power_meter'
0011 
0012     Datasheet: https://uefi.org/specifications, section 10.4.
0013 
0014 Author: Darrick J. Wong
0015 
0016 Description
0017 -----------
0018 
0019 This driver implements sensor reading support for the power meters exposed in
0020 the ACPI 4.0 spec (Chapter 10.4).  These devices have a simple set of
0021 features--a power meter that returns average power use over a configurable
0022 interval, an optional capping mechanism, and a couple of trip points.  The
0023 sysfs interface conforms with the specification outlined in the "Power" section
0024 of Documentation/hwmon/sysfs-interface.rst.
0025 
0026 Special Features
0027 ----------------
0028 
0029 The `power[1-*]_is_battery` knob indicates if the power supply is a battery.
0030 Both `power[1-*]_average_{min,max}` must be set before the trip points will work.
0031 When both of them are set, an ACPI event will be broadcast on the ACPI netlink
0032 socket and a poll notification will be sent to the appropriate
0033 `power[1-*]_average` sysfs file.
0034 
0035 The `power[1-*]_{model_number, serial_number, oem_info}` fields display
0036 arbitrary strings that ACPI provides with the meter.  The measures/ directory
0037 contains symlinks to the devices that this meter measures.
0038 
0039 Some computers have the ability to enforce a power cap in hardware.  If this is
0040 the case, the `power[1-*]_cap` and related sysfs files will appear.  When the
0041 average power consumption exceeds the cap, an ACPI event will be broadcast on
0042 the netlink event socket and a poll notification will be sent to the
0043 appropriate `power[1-*]_alarm` file to indicate that capping has begun, and the
0044 hardware has taken action to reduce power consumption.  Most likely this will
0045 result in reduced performance.
0046 
0047 There are a few other ACPI notifications that can be sent by the firmware.  In
0048 all cases the ACPI event will be broadcast on the ACPI netlink event socket as
0049 well as sent as a poll notification to a sysfs file.  The events are as
0050 follows:
0051 
0052 `power[1-*]_cap` will be notified if the firmware changes the power cap.
0053 `power[1-*]_interval` will be notified if the firmware changes the averaging
0054 interval.