ACPI_BATTERY(4) | Device Drivers Manual | ACPI_BATTERY(4) |
acpi_battery
—
ACPI battery management subsystem
device acpi
The acpi_battery
is a driver for battery
management features of the ACPI module.
An ACPI-compatible battery device supports either a Control Method Battery interface or a Smart Battery subsystem interface. The former is accessed by the AML (ACPI Machine Language) code control methods, and the latter is controlled directly through the ACPI EC (Embedded Controller) typically via an SMBus interface.
This driver supports the sysctl(8) and ioctl(2) interfaces as well as the devd(8) event notification interface.
Every ioctl for the acpi_battery
driver
takes a single integer value for the battery unit number as an argument, and
returns a specific structure for each request. A special unit number
ACPI_BATTERY_ALL_UNITS
specifies all of the attached
units and reports accumulated information.
ACPIIO_BATT_GET_UNITS
intACPIIO_BATT_GET_BATTINFO
struct acpi_battinfoACPI_BATT_STAT_DISCHARG
(0x0001)ACPI_BATT_STAT_CHARGING
(0x0002)ACPI_BATT_STAT_CRITICAL
(0x0004)Note that the status bits of each battery will be
consolidated when ACPI_BATTERY_ALL_UNITS
is
specified.
-1
means not discharging right now.ACPIIO_BATT_GET_BIX
struct acpi_bix_BIX
(Battery Information) object, which is the static portion of the Control
Method Battery information. In the case of a Smart Battery attached to
SMBus or a Control Method Battery with a _BIF
object, this ioctl will build a struct acpi_bix
structure based on the obtained information and return it.
ACPI_BIX_REV_0
(0x0000)_BIX
object in ACPI 4.0.ACPI_BIX_REV_1
(0x0001)_BIX
object in ACPI 6.0.ACPI_BIX_REV_BIF
(0xffff)_BIX
object built from the
_BIF
object found on the system.Note that this field should be
checked by using
ACPI_BIX_REV_MIN_CHECK
(var,
rev) macro when checking the minimum revision
number.
Note that capacity is expressed in mWh or mAh, and rate is expressed in mW or mA, respectively.
_BST
. If two succeeding readings of
_BST
beyond this duration occur, two different
results can be returned._BST
. The Sampling Time specifies the
frequency of measurements, and the Average Interval specifies the
width of the time window of every measurement.ACPIIO_BATT_GET_BIF
struct acpi_bif_BIF
(Battery Information) object, which was
deprecated in ACPI 4.0 specification. The data structure is a subset of
struct acpi_bix.
Note that this ioctl will built a struct
acpi_bif structure based on the obtained information even if this
object is not available and a _BIX
object is
found.
_BST
(Battery Status) object, which is the present battery status. In the case
of a Smart Battery attached to SMBus, this ioctl will build a
struct acpi_bst structure based on the obtained
information and return it.
The following sysctl(8) variables export battery status. Note that they are accumulated status of all of the connected batteries:
_BIX
or _BIF
object will be stored and reused for successive read access to this MIB
within the specified period.-1
.Battery-related event notifications are sent to the userland via the devd(8) interface. See /etc/devd.conf and devd.conf(5) for more details. Note that notifications are supported only by the Control Method Battery.
The acpi_battery
driver sends events with
the following attributes:
Nate Lawson <njl@FreeBSD.org>, Munehiro Matsuda, Takanori Watanabe <takawata@FreeBSD.org>, Mitsuru IWASAKI <iwasaki@FreeBSD.org>, Hans Petter Selasky <hselasky@FreeBSD.org>, and Hiroki Sato <hrs@FreeBSD.org>.
This manual page was written by Takanori Watanabe <takawata@FreeBSD.org> and Hiroki Sato <hrs@FreeBSD.org>.
February 16, 2020 | Debian |