1 .\" Copyright (c) 2005 Christian Brueffer
2 .\" Copyright (c) 2005 Markus Brueffer
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" $FreeBSD: head/share/man/man4/acpi_ibm.4 358333 2020-02-26 14:26:36Z kaktus $
33 .Nd "ThinkPad ACPI extras driver"
35 To compile this driver into the kernel,
36 place the following line in your
37 kernel configuration file:
38 .Bd -ragged -offset indent
39 .Cd "device acpi_thinkpad"
42 Alternatively, to load the driver as a
43 module at boot time, place the following line in
45 .Bd -literal -offset indent
46 acpi_thinkpad_load="YES"
51 driver provides support for hotkeys and other components of ThinkPad laptops.
52 The main purpose of this driver is to provide an interface,
57 through which applications can determine the status of
58 various laptop components.
62 interface is enabled automatically after loading the driver, the
64 interface has to be enabled explicitly, as it may alter the default action of
66 This is done by setting the
68 sysctl as described below.
69 Specifying which keys should generate events is done by setting a bitmask,
70 whereas each bit represents one key or key combination.
71 This bitmask, accessible via the
75 by default, a value representing all possible keypress events on the specific
78 Hotkey events received by
80 provide the following information:
82 .Bl -tag -width "subsystem" -offset indent -compact
88 The source of the event in the ACPI namespace.
89 The value depends on the model.
91 Event code (see below).
94 Depending on the ThinkPad model, event codes may vary.
95 On a ThinkPad T41p these are as follows:
97 .Bl -tag -width "subsystem" -offset indent -compact
103 Fn + F3 (LCD backlight)
105 Fn + F4 (Suspend to RAM)
111 Fn + F7 (Screen expand)
121 Fn + F12 (Suspend to disk)
129 Fn + Home (Brightness up)
131 Fn + End (Brightness down)
133 Fn + PageUp (ThinkLight)
145 Access THINKPAD Button
147 .Ss Xr led 4 Interface
152 interface for the ThinkLight.
153 The ThinkLight can be made to blink by writing
156 .Pa /dev/led/thinklight
159 The following sysctls are currently implemented:
160 .Bl -tag -width indent
161 .It Va dev.acpi_thinkpad.<node>.initialmask
163 Bitmask of ACPI events before the
166 .It Va dev.acpi_thinkpad.<node>.availmask
168 Bitmask of all supported ACPI events.
169 .It Va dev.acpi_thinkpad.<node>.events
170 Enable ACPI events and set the
176 driver being loaded, only the Fn+F4 button generates an ACPI event.
177 .It Va dev.acpi_thinkpad.<node>.eventmask
178 Sets the ACPI events which are reported to
180 Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
183 Depending on the ThinkPad model, the meaning of different bits in the
186 On a ThinkPad T41p this is a bitwise OR of the following:
188 .Bl -tag -width indent-two -compact
194 Fn + F3 (LCD backlight)
196 Fn + F4 (Suspend to RAM)
202 Fn + F7 (Screen expand)
212 Fn + F12 (Suspend to disk)
220 Fn + Home (Brightness up)
222 Fn + End (Brightness down)
224 Fn + PageUp (ThinkLight)
236 Access THINKPAD Button
238 .It Va dev.acpi_thinkpad.<node>.hotkey
240 Status of several buttons.
241 Every time a button is pressed, the respecting bit is toggled.
242 It is a bitwise OR of the following:
244 .Bl -tag -width indent-two -compact
252 Access THINKPAD Button
266 Brightness Up/Down Button
268 Volume Up/Down/Mute Button
270 .It Va dev.acpi_thinkpad.<node>.lcd_brightness
271 Current brightness level of the display.
272 .It Va dev.acpi_thinkpad.<node>.volume
274 .It Va dev.acpi_thinkpad.<node>.mute
275 Indicates, whether the speakers are muted or not.
276 .It Va dev.acpi_thinkpad.<node>.mic_mute
277 Indicates, whether the microphone led (present on some model) is on or not.
278 Note that this does not mean that the microphone input is muted.
279 .It Va dev.acpi_thinkpad.<node>.thinklight
280 Indicates, whether the ThinkLight keyboard light is activated or not.
281 .It Va dev.acpi_thinkpad.<node>.bluetooth
282 Toggle Bluetooth chip activity.
283 .It Va dev.acpi_thinkpad.<node>.wlan
285 Indicates whether the WLAN chip is active or not.
286 .It Va dev.acpi_thinkpad.<node>.fan
287 Indicates whether the fan is in automatic (1) or manual (0) mode.
288 Default is automatic mode.
289 This sysctl should be used with extreme precaution, since disabling automatic
290 fan control might overheat the ThinkPad and lead to permanent damage if the
292 is not set accordingly.
293 .It Va dev.acpi_thinkpad.<node>.fan_level
294 Indicates at what speed the fan should run when being in manual mode.
295 Values are ranging from 0 (off) to 7 (max).
296 The resulting speed differs from model to model.
297 On a T41p this is as follows:
299 .Bl -tag -width indent-two -compact
309 .It Va dev.acpi_thinkpad.<node>.fan_speed
311 Fan speed in rounds per minute.
312 A few older ThinkPads report the fan speed in levels ranging from 0 (off)
314 .It Va hw.acpi.thermal
316 Shows the readings of up to eight different temperature sensors.
317 Most ThinkPads include six or more temperature sensors but
318 only expose the CPU temperature through
320 Some ThinkPads have the below sensor layout which might vary depending on the
341 .It Va dev.acpi_thinkpad.<node>.handlerevents
348 Events are specified as a whitespace-separated list of event code in
349 hexadecimal or decimal form.
350 Note that the event may be handled twice (eg. Brightness up/down) if ACPI BIOS
351 already handled the event.
352 .It Va hw.sensors.acpi_thinkpad0.tempX
353 Show the readings of up to eight different temperature sensors.
354 .It Va hw.sensors.acpi_thinkpad0.fan0
355 Fan speed in rounds per minute.
356 .\" A few older ThinkPads report the fan speed in levels ranging from 0 (off)
360 Defaults for these sysctls can be set in
362 Sensors can be monitored by
365 .Bl -tag -width ".Pa /dev/led/thinklight"
366 .It Pa /dev/led/thinklight
372 The following can be added to
374 in order to pass button events to a
375 .Pa /usr/local/sbin/acpi_oem_exec.sh
377 .Bd -literal -offset indent
379 match "system" "ACPI";
380 match "subsystem" "THINKPAD";
381 action "/usr/local/sbin/acpi_oem_exec.sh $notify thinkpad";
386 .Pa /usr/local/sbin/acpi_oem_exec.sh
387 script might look like:
388 .Bd -literal -offset indent
391 if [ "$1" = "" -o "$2" = "" ]
393 echo "usage: $0 notify oem_name"
399 BC_PRECOMMANDS="scale=2"
405 DISPLAY_PIPE=/tmp/acpi_${OEM}_display
409 LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
410 if [ "$LEVEL" = "1" ]
412 sysctl dev.acpi_${OEM}.0.bluetooth=0
413 MESSAGE="bluetooth disabled"
415 sysctl dev.acpi_${OEM}.0.bluetooth=1
416 MESSAGE="bluetooth enabled"
420 LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
421 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
422 ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
423 ${CALC} | ${CUT} -d . -f 1`
424 MESSAGE="brightness level ${PERCENT}%"
427 LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
428 if [ "$LEVEL" = "1" ]
430 MESSAGE="thinklight enabled"
432 MESSAGE="thinklight disabled"
436 LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
437 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
438 ${LEVEL} / ${MAX_VOLUME} * 100" | \\
439 ${CALC} | ${CUT} -d . -f 1`
440 MESSAGE="volume level ${PERCENT}%"
443 LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
444 if [ "$LEVEL" = "1" ]
446 MESSAGE="volume muted"
448 MESSAGE="volume unmuted"
452 LEVEL=`sysctl -n dev.acpi_${OEM}.0.mic_led`
453 if [ $LEVEL -eq 0 ]; then
454 sysctl dev.acpi_${OEM}.0.mic_led=1
457 if [ $LEVEL -eq 1 ]; then
458 sysctl dev.acpi_${OEM}.0.mic_led=0
466 if [ -p ${DISPLAY_PIPE} ]
468 ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
473 The following example specify that event code 0x04 (Suspend to RAM),
474 0x10 (Brightness up) and 0x11 (Brightness down) are handled by
476 .Bd -literal -offset indent
477 sysctl dev.acpi_thinkpad.0.handlerevents='0x04 0x10 0x11'
482 .Bd -literal -offset indent
483 hw.acpi.thinkpad.handlerevents=0x04\\ 0x10\\ 0x11
495 device driver first appeared in
497 and was imported into
503 driver was written by
504 .An Takanori Watanabe Aq Mt takawata@FreeBSD.org
505 and later mostly rewritten by
506 .An Markus Brueffer Aq Mt markus@FreeBSD.org .
507 This manual page was written by
508 .An Christian Brueffer Aq Mt brueffer@FreeBSD.org
510 .An Markus Brueffer Aq Mt markus@FreeBSD.org .