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 237509 2012-06-23 20:44:45Z joel $
33 .Nd "ACPI extras driver for IBM/Lenovo Thinkpad laptops"
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 IBM/Lenovo
53 The main purpose of this driver is to provide an interface,
58 through which applications can determine the status of
59 various laptop components.
63 interface is enabled automatically after loading the driver, the
65 interface has to be enabled explicitly, as it may alter the default action of
67 This is done by setting the
69 sysctl as described below.
70 Specifying which keys should generate events is done by setting a bitmask,
71 whereas each bit represents one key or key combination.
72 This bitmask, accessible via the
76 by default, a value representing all possible keypress events on the specific
78 .Ss Xr devd 8 Ss Events
79 Hotkey events received by
81 provide the following information:
83 .Bl -tag -width "subsystem" -offset indent -compact
89 The source of the event in the ACPI namespace.
90 The value depends on the model.
92 Event code (see below).
95 Depending on the ThinkPad model, event codes may vary.
96 On a ThinkPad T41p these are as follows:
98 .Bl -tag -width "subsystem" -offset indent -compact
104 Fn + F3 (LCD backlight)
106 Fn + F4 (Suspend to RAM)
112 Fn + F7 (Screen expand)
122 Fn + F12 (Suspend to disk)
130 Fn + Home (Brightness up)
132 Fn + End (Brightness down)
134 Fn + PageUp (ThinkLight)
148 .Ss Xr led 4 Ss Interface
153 interface for the ThinkLight.
154 The ThinkLight can be made to blink by writing
157 .Pa /dev/led/thinklight
160 The following sysctls are currently implemented:
161 .Bl -tag -width indent
162 .It Va hw.acpi.thinkpad.initialmask
164 Bitmask of ACPI events before the
167 .It Va hw.acpi.thinkpad.availmask
169 Bitmask of all supported ACPI events.
170 .It Va hw.acpi.thinkpad.events
171 Enable ACPI events and set the
177 driver being loaded, only the Fn+F4 button generates an ACPI event.
178 .It Va hw.acpi.thinkpad.eventmask
179 Sets the ACPI events which are reported to
181 Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
184 Depending on the ThinkPad model, the meaning of different bits in the
187 On a ThinkPad T41p this is a bitwise OR of the following:
189 .Bl -tag -width indent-two -compact
195 Fn + F3 (LCD backlight)
197 Fn + F4 (Suspend to RAM)
203 Fn + F7 (Screen expand)
213 Fn + F12 (Suspend to disk)
221 Fn + Home (Brightness up)
223 Fn + End (Brightness down)
225 Fn + PageUp (ThinkLight)
239 .It Va hw.acpi.thinkpad.hotkey
241 Status of several buttons.
242 Every time a button is pressed, the respecting bit is toggled.
243 It is a bitwise OR of the following:
245 .Bl -tag -width indent-two -compact
267 Brightness Up/Down Button
269 Volume Up/Down/Mute Button
271 .It Va hw.acpi.thinkpad.lcd_brightness
272 Current brightness level of the display.
273 .It Va hw.acpi.thinkpad.volume
275 .It Va hw.acpi.thinkpad.mute
276 Indicates, whether the speakers are muted or not.
277 .It Va hw.acpi.thinkpad.thinklight
278 Indicates, whether the ThinkLight keyboard light is activated or not.
279 .It Va hw.acpi.thinkpad.bluetooth
280 Toggle Bluetooth chip activity.
281 .It Va hw.acpi.thinkpad.wlan
283 Indicates whether the WLAN chip is active or not.
284 .It Va hw.acpi.thinkpad.fan
285 Indicates whether the fan is in automatic (1) or manual (0) mode.
286 Default is automatic mode.
287 This sysctl should be used with extreme precaution, since disabling automatic
288 fan control might overheat the ThinkPad and lead to permanent damage if the
290 is not set accordingly.
291 .It Va hw.acpi.thinkpad.fan_level
292 Indicates at what speed the fan should run when being in manual mode.
293 Values are ranging from 0 (off) to 7 (max).
294 The resulting speed differs from model to model.
295 On a T41p this is as follows:
297 .Bl -tag -width indent-two -compact
307 .It Va hw.acpi.thinkpad.fan_speed
309 Fan speed in rounds per minute.
310 A few older ThinkPads report the fan speed in levels ranging from 0 (off)
312 .It Va hw.acpi.thinkpad.thermal
314 Shows the readings of up to eight different temperature sensors.
315 Most ThinkPads include six or more temperature sensors but
316 only expose the CPU temperature through
318 Some ThinkPads have the below sensor layout which might vary depending on the
339 .It Va hw.acpi.thinkpad.handlerevents
346 Events are specified as a whitespace-separated list of event code in
347 hexadecimal or decimal form.
348 Note that the event maybe handled twice (eg. Brightness up/down) if ACPI BIOS
349 already handled the event.
350 .It Va hw.sensors.acpi_thinkpad0.tempX
351 Show the readings of up to eight different temperature sensors.
352 .It Va hw.sensors.acpi_thinkpad0.fan0
353 Fan speed in rounds per minute.
354 .\" A few older ThinkPads report the fan speed in levels ranging from 0 (off)
358 Defaults for these sysctls can be set in
360 Sensors can be monitored by
363 .Bl -tag -width ".Pa /dev/led/thinklight"
364 .It Pa /dev/led/thinklight
370 The following can be added to
372 in order to pass button events to a
373 .Pa /usr/local/sbin/acpi_oem_exec.sh
375 .Bd -literal -offset indent
377 match "system" "ACPI";
378 match "subsystem" "IBM";
379 action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
384 .Pa /usr/local/sbin/acpi_oem_exec.sh
385 script might look like:
386 .Bd -literal -offset indent
389 if [ "$1" = "" -o "$2" = "" ]
391 echo "usage: $0 notify oem_name"
397 BC_PRECOMMANDS="scale=2"
403 DISPLAY_PIPE=/tmp/acpi_${OEM}_display
407 LEVEL=`sysctl -n hw.acpi.${OEM}.bluetooth`
408 if [ "$LEVEL" = "1" ]
410 sysctl hw.acpi.${OEM}.bluetooth=0
411 MESSAGE="bluetooth disabled"
413 sysctl hw.acpi.${OEM}.bluetooth=1
414 MESSAGE="bluetooth enabled"
418 LEVEL=`sysctl -n hw.acpi.${OEM}.lcd_brightness`
419 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
420 ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
421 ${CALC} | ${CUT} -d . -f 1`
422 MESSAGE="brightness level ${PERCENT}%"
425 LEVEL=`sysctl -n hw.acpi.${OEM}.thinklight`
426 if [ "$LEVEL" = "1" ]
428 MESSAGE="thinklight enabled"
430 MESSAGE="thinklight disabled"
434 LEVEL=`sysctl -n hw.acpi.${OEM}.volume`
435 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
436 ${LEVEL} / ${MAX_VOLUME} * 100" | \\
437 ${CALC} | ${CUT} -d . -f 1`
438 MESSAGE="volume level ${PERCENT}%"
441 LEVEL=`sysctl -n hw.acpi.${OEM}.mute`
442 if [ "$LEVEL" = "1" ]
444 MESSAGE="volume muted"
446 MESSAGE="volume unmuted"
453 if [ -p ${DISPLAY_PIPE} ]
455 ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
460 The following example specify that event code 0x04 (Suspend to RAM),
461 0x10 (Brightness up) and 0x11 (Brightness down) are handled by
463 .Bd -literal -offset indent
464 sysctl hw.acpi.thinkpad.handlerevents='0x04 0x10 0x11'
469 .Bd -literal -offset indent
470 hw.acpi.thinkpad.handlerevents=0x04\\ 0x10\\ 0x11
482 device driver first appeared in
484 and was imported into
490 driver was written by
491 .An Takanori Watanabe Aq Mt takawata@FreeBSD.org
492 and later mostly rewritten by
493 .An Markus Brueffer Aq Mt markus@FreeBSD.org .
494 This manual page was written by
495 .An Christian Brueffer Aq Mt brueffer@FreeBSD.org
497 .An Markus Brueffer Aq Mt markus@FreeBSD.org .