ACPI_IBM(4)
π acpi_ibm β ThinkPad ACPI extras driver π
okay bestie, this is the page for ACPI_IBM(4), and we're doing a full tour of the ThinkPad ACPI extras driver. It's giving laptop-whisperer energy, no cap. π«Ά
π NAME π
acpi_ibm β ThinkPad ACPI extras driver
π SYNOPSIS π
To compile this driver into the kernel, put this line in your kernel configuration file:
device acpi_ibm
Alternatively, to load the driver as a module at boot time, put this line in loader.conf(5):
acpi_ibm_load="YES"
π¦ DESCRIPTION π¦
The acpi_ibm driver gives you support for hotkeys and other components on ThinkPad laptops. The main character purpose here is to provide an interface β accessible via sysctl(8) and devd(8) β through which applications can figure out the status of various laptop components. π
The sysctl(8) interface gets enabled automatically after loading the driver, but the devd(8) interface has to be enabled explicitly, because it may alter the default action of certain keys. You do that by setting the events sysctl as described below. Specifying which keys should generate events is done by setting a bitmask, where each bit represents one key or key combination. This bitmask, accessible via the eventmask sysctl, is set to availmask by default β a value representing all possible keypress events on the specific ThinkPad model. β¨
π¦ devd(8) Events
Hotkey events received by devd(8) provide the following info:
system "ACPI"
subsystem "IBM"
type The source of the event in the ACPI namespace. The
value depends on the model.
notify Event code (see below).
Depending on the ThinkPad model, event codes may vary. On a ThinkPad T41p these are as follows:
0x01β Fn + F10x02β Fn + F20x03β Fn + F3 (LCD backlight)0x04β Fn + F4 (Suspend to RAM)0x05β Fn + F5 (Bluetooth)0x06β Fn + F60x07β Fn + F7 (Screen expand)0x08β Fn + F80x09β Fn + F90x0aβ Fn + F100x0bβ Fn + F110x0cβ Fn + F12 (Suspend to disk)0x0dβ Fn + Backspace0x0eβ Fn + Insert0x0fβ Fn + Delete0x10β Fn + Home (Brightness up)0x11β Fn + End (Brightness down)0x12β Fn + PageUp (ThinkLight)0x13β Fn + PageDown0x14β Fn + Space (Zoom)0x15β Volume Up0x16β Volume Down0x17β Mute0x18β Access IBM Button
πΈ led(4) Interface
The acpi_ibm driver provides a led(4) interface for the ThinkLight. The ThinkLight can be made to blink by writing ASCII strings to the /dev/led/thinklight device. π§
β¨ SYSCTL VARIABLES β¨
The following sysctls are currently implemented:
dev.acpi_ibm.0.initialmaskβ (read-only) Bitmask of ACPI events before theacpi_ibmdriver was loaded.dev.acpi_ibm.0.availmaskβ (read-only) Bitmask of all supported ACPI events.dev.acpi_ibm.0.eventsβ Enable ACPI events and set theeventmasktoavailmask. Without theacpi_ibmdriver being loaded, only the Fn+F4 button generates an ACPI event.dev.acpi_ibm.0.eventmaskβ Sets the ACPI events which are reported todevd(8). Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which valueeventmaskhas. Depending on the ThinkPad model, the meaning of different bits in theeventmaskmay vary. On a ThinkPad T41p this is a bitwise OR of the following:1β Fn + F12β Fn + F24β Fn + F3 (LCD backlight)8β Fn + F4 (Suspend to RAM)16β Fn + F5 (Bluetooth)32β Fn + F664β Fn + F7 (Screen expand)128β Fn + F8256β Fn + F9512β Fn + F101024β Fn + F112048β Fn + F12 (Suspend to disk)4096β Fn + Backspace8192β Fn + Insert16384β Fn + Delete32768β Fn + Home (Brightness up)65536β Fn + End (Brightness down)131072β Fn + PageUp (ThinkLight)262144β Fn + PageDown524288β Fn + Space (Zoom)1048576β Volume Up2097152β Volume Down4194304β Mute8388608β Access IBM Button
dev.acpi_ibm.0.hotkeyβ (read-only) Status of several buttons. Every time a button is pressed, the respecting bit is toggled. It is a bitwise OR of the following:1β Home Button2β Search Button4β Mail Button8β Access IBM Button16β Zoom32β Wireless LAN Button64β Video Button128β Hibernate Button256β ThinkLight Button512β Screen Expand1024β Brightness Up/Down Button2048β Volume Up/Down/Mute Button
dev.acpi_ibm.0.lcd_brightnessβ Current brightness level of the display.dev.acpi_ibm.0.volumeβ Speaker volume.dev.acpi_ibm.0.muteβ Indicates whether the speakers are muted or not.dev.acpi_ibm.0.mic_muteβ Indicates whether the microphone led (present on some model) is on or not. Note that this does not mean that the microphone input is muted.dev.acpi_ibm.0.thinklightβ Indicates whether the ThinkLight keyboard light is activated or not.dev.acpi_ibm.0.bluetoothβ Toggle Bluetooth chip activity.dev.acpi_ibm.0.wlanβ (read-only) Indicates whether the WLAN chip is active or not.dev.acpi_ibm.0.fanβ Indicates whether the fan is in automatic (1) or manual (0) mode. Default is automatic mode.
bestie, this one is serious: this sysctl should be used with extreme precaution, since disabling automatic fan control might overheat the ThinkPad and lead to permanent damage if the fan_level is not set accordingly. π
dev.acpi_ibm.0.fan_levelβ Indicates at what speed the fan should run when being in manual mode. Valid values range from0(off) to7(max) and8. Level8is used by the driver to set the fan in unthrottled mode. In this mode, the fan is set to spin freely and will quickly reach a very high speed. Use this mode only if absolutely necessary, e.g., if the system has reached its critical temperature and it is about to shut down. The resulting speed differs from model to model. On a T41p this is as follows:0β off1, 2β ~3000 RPM3, 4, 5β ~3600 RPM6, 7β ~4300 RPM8β ~6400 RPM (Full-speed, unthrottled)
dev.acpi_ibm.0.fan_speedβ (read-only) Fan speed in rounds per minute. A few older ThinkPads report the fan speed in levels ranging from0(off) to7(max).dev.acpi_ibm.0.thermalβ (read-only) Shows the readings of up to eight different temperature sensors. Most ThinkPads include six or more temperature sensors but only expose the CPU temperature throughacpi_thermal(4). Some ThinkPads have the below sensor layout which might vary depending on the specific model:- CPU
- Mini PCI Module
- HDD
- GPU
- Built-in battery
- UltraBay battery
- Built-in battery
- UltraBay battery
dev.acpi_ibm.0.handlereventsβdevd(8)events handled byacpi_ibmwheneventsis set to1. Events are specified as a whitespace-separated list of event code in hexadecimal or decimal form. Note that the event maybe handled twice (e.g., Brightness up/down) if ACPI BIOS already handled the event.
Defaults for these sysctls can be set in sysctl.conf(5).
π FILES π
/dev/led/thinklightβ ThinkLightled(4)device node
β¨ EXAMPLES β¨
okay bestie, this is where you actually make the buttons do stuff π
You can add this next bit to devd.conf(5) so button events get passed to a /usr/local/sbin/acpi_oem_exec.sh script:
notify 10 {
match "system" "ACPI";
match "subsystem" "IBM";
action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
};
A possible /usr/local/sbin/acpi_oem_exec.sh script might look like this β yes, the whole thing, no skipped lines π:
#!/bin/sh
#
if [ "$1" = "" -o "$2" = "" ]
then
echo "usage: $0 notify oem_name"
exit 1
fi
NOTIFY=`echo $1`
LOGGER="logger"
CALC="bc"
BC_PRECOMMANDS="scale=2"
ECHO="echo"
CUT="cut"
MAX_LCD_BRIGHTNESS=7
MAX_VOLUME=14
OEM=$2
DISPLAY_PIPE=/tmp/acpi_${OEM}_display
case ${NOTIFY} in
0x05)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
if [ "$LEVEL" = "1" ]
then
sysctl dev.acpi_${OEM}.0.bluetooth=0
MESSAGE="bluetooth disabled"
else
sysctl dev.acpi_${OEM}.0.bluetooth=1
MESSAGE="bluetooth enabled"
fi
;;
0x10|0x11)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \
${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\
${CALC} | ${CUT} -d . -f 1`
MESSAGE="brightness level ${PERCENT}%"
;;
0x12)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
if [ "$LEVEL" = "1" ]
then
MESSAGE="thinklight enabled"
else
MESSAGE="thinklight disabled"
fi
;;
0x15|0x16)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \
${LEVEL} / ${MAX_VOLUME} * 100" | \
${CALC} | ${CUT} -d . -f 1`
MESSAGE="volume level ${PERCENT}%"
;;
0x17)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
if [ "$LEVEL" = "1" ]
then
MESSAGE="volume muted"
else
MESSAGE="volume unmuted"
fi
;;
0x1b)
LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
if [ $LEVEL -eq 0 ]; then
sysctl dev.acpi_ibm.0.mic_led=1
mixer rec.volume=0
fi
if [ $LEVEL -eq 1 ]; then
sysctl dev.acpi_ibm.0.mic_led=0
mixer rec.volume=30%
fi
;;
*)
;;
esac
${LOGGER} ${MESSAGE}
if [ -p ${DISPLAY_PIPE} ]
then
${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
fi
exit 0
And if you want event code 0x04 (Suspend to RAM), 0x10 (Brightness up), and 0x11 (Brightness down) to be handled by acpi_ibm, the example is literally this:
sysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11'
In sysctl.conf(5), that same vibe looks like:
dev.acpi_ibm.0.handlerevents=0x04\ 0x10\ 0x11
π SEE ALSO π
π¦ HISTORY π¦
The acpi_ibm device driver first appeared in FreeBSD 6.0 β vintage but iconic β¨
π AUTHORS π
The acpi_ibm driver was written by Takanori Watanabe <takawata@FreeBSD.org> and later mostly rewritten by Markus Brueffer <markus@FreeBSD.org>. This manual page was written by Christian Brueffer <brueffer@FreeBSD.org> and Markus Brueffer <markus@FreeBSD.org>. Give them their flowers, fr fr π
that's the whole page, bestie π«Ά it's from the Debian crew, dated March 13, 2022, and the page is literally ACPI_IBM(4) β slay β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2005 Christian Brueffer
- Copyright (c) 2005 Markus Brueffer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms