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
27 .\" $DragonFly: src/share/man/man4/acpi_thinkpad.4,v 1.6 2008/10/03 10:32:10 swildner Exp $
34 .Nd "ACPI extras driver for IBM/Lenovo Thinkpad laptops"
36 To compile this driver into the kernel,
37 place the following line in your
38 kernel configuration file:
39 .Bd -ragged -offset indent
40 .Cd "device acpi_thinkpad"
43 Alternatively, to load the driver as a
44 module at boot time, place the following line in
46 .Bd -literal -offset indent
47 acpi_thinkpad_load="YES"
52 driver provides support for hotkeys and other components of IBM/Lenovo
54 The main purpose of this driver is to provide an interface,
59 through which applications can determine the status of
60 various laptop components.
64 interface is enabled automatically after loading the driver, the
66 interface has to be enabled explicitly, as it may alter the default action of
68 This is done by setting the
70 sysctl as described below.
71 Specifying which keys should generate events is done by setting a bitmask,
72 whereas each bit represents one key or key combination.
73 This bitmask, accessible via the
77 by default, a value representing all possible keypress events on the specific
79 .Ss Xr devd 8 Ss Events
80 Hotkey events received by
82 provide the following information:
84 .Bl -tag -width "subsystem" -offset indent -compact
90 The source of the event in the ACPI namespace.
91 The value depends on the model.
93 Event code (see below).
96 Depending on the ThinkPad model, event codes may vary.
97 On a ThinkPad T41p these are as follows:
99 .Bl -tag -width "subsystem" -offset indent -compact
105 Fn + F3 (LCD backlight)
107 Fn + F4 (Suspend to RAM)
113 Fn + F7 (Screen expand)
123 Fn + F12 (Suspend to disk)
131 Fn + Home (Brightness up)
133 Fn + End (Brightness down)
135 Fn + PageUp (ThinkLight)
149 .\" .Ss Xr led 4 Ss Interface
152 .\" driver provides a
154 .\" interface for the ThinkLight.
155 .\" The ThinkLight can be made to blink by writing
158 .\" .Pa /dev/led/thinklight
161 The following sysctls are currently implemented:
162 .Bl -tag -width indent
163 .It Va dev.acpi_thinkpad.0.initialmask
165 Bitmask of ACPI events before the
168 .It Va dev.acpi_thinkpad.0.availmask
170 Bitmask of all supported ACPI events.
171 .It Va dev.acpi_thinkpad.0.events
172 Enable ACPI events and set the
178 driver being loaded, only the Fn+F4 button generates an ACPI event.
179 .It Va dev.acpi_thinkpad.0.eventmask
180 Sets the ACPI events which are reported to
182 (not yet available in
184 Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
187 Depending on the ThinkPad model, the meaning of different bits in the
190 On a ThinkPad T41p this is a bitwise OR of the following:
192 .Bl -tag -width indent-two -compact
198 Fn + F3 (LCD backlight)
200 Fn + F4 (Suspend to RAM)
206 Fn + F7 (Screen expand)
216 Fn + F12 (Suspend to disk)
224 Fn + Home (Brightness up)
226 Fn + End (Brightness down)
228 Fn + PageUp (ThinkLight)
242 .It Va dev.acpi_thinkpad.0.hotkey
244 Status of several buttons.
245 Every time a button is pressed, the respecting bit is toggled.
246 It is a bitwise OR of the following:
248 .Bl -tag -width indent-two -compact
270 Brightness Up/Down Button
272 Volume Up/Down/Mute Button
274 .It Va dev.acpi_thinkpad.0.lcd_brightness
275 Current brightness level of the display.
276 .It Va dev.acpi_thinkpad.0.volume
278 .It Va dev.acpi_thinkpad.0.mute
279 Indicates, whether the speakers are muted or not.
280 .It Va dev.acpi_thinkpad.0.thinklight
281 Indicates, whether the ThinkLight keyboard light is activated or not.
282 .It Va dev.acpi_thinkpad.0.bluetooth
283 Toggle Bluetooth chip activity.
284 .It Va dev.acpi_thinkpad.0.wlan
286 Indicates whether the WLAN chip is active or not.
287 .It Va dev.acpi_thinkpad.0.fan
288 Indicates whether the fan is in automatic (1) or manual (0) mode.
289 Default is automatic mode.
290 This sysctl should be used with extreme precaution, since disabling automatic
291 fan control might overheat the ThinkPad and lead to permanent damage if the
293 is not set accordingly.
294 .It Va dev.acpi_thinkpad.0.fan_level
295 Indicates at what speed the fan should run when being in manual mode.
296 Values are ranging from 0 (off) to 7 (max).
297 The resulting speed differs from model to model.
298 On a T41p this is as follows:
300 .Bl -tag -width indent-two -compact
310 .It Va hw.sensors.acpi_thinkpad0.tempX
311 Show the readings of up to eight different temperature sensors.
312 Most ThinkPads include six or more temperature sensors but
313 only expose the CPU temperature through
315 Some ThinkPads have the below sensor layout which might vary depending on the
336 .It Va hw.sensors.acpi_thinkpad0.fan0
337 Fan speed in rounds per minute.
338 .\" A few older ThinkPads report the fan speed in levels ranging from 0 (off)
342 Defaults for these sysctls can be set in
344 Sensors can be monitored by
347 .\" .Bl -tag -width ".Pa /dev/led/thinklight"
348 .\" .It Pa /dev/led/thinklight
354 The following can be added to
356 in order to pass button events to a
357 .Pa /usr/local/sbin/acpi_oem_exec.sh
359 .Bd -literal -offset indent
361 match "system" "ACPI";
362 match "subsystem" "IBM";
363 action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
368 .Pa /usr/local/sbin/acpi_oem_exec.sh
369 script might look like:
370 .Bd -literal -offset indent
373 if [ "$1" = "" -o "$2" = "" ]
375 echo "usage: $0 notify oem_name"
381 BC_PRECOMMANDS="scale=2"
387 DISPLAY_PIPE=/tmp/acpi_${OEM}_display
391 LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
392 if [ "$LEVEL" = "1" ]
394 sysctl dev.acpi_${OEM}.0.bluetooth=0
395 MESSAGE="bluetooth disabled"
397 sysctl dev.acpi_${OEM}.0.bluetooth=1
398 MESSAGE="bluetooth enabled"
402 LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
403 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
404 ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
405 ${CALC} | ${CUT} -d . -f 1`
406 MESSAGE="brightness level ${PERCENT}%"
409 LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
410 if [ "$LEVEL" = "1" ]
412 MESSAGE="thinklight enabled"
414 MESSAGE="thinklight disabled"
418 LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
419 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
420 ${LEVEL} / ${MAX_VOLUME} * 100" | \\
421 ${CALC} | ${CUT} -d . -f 1`
422 MESSAGE="volume level ${PERCENT}%"
425 LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
426 if [ "$LEVEL" = "1" ]
428 MESSAGE="volume muted"
430 MESSAGE="volume unmuted"
437 if [ -p ${DISPLAY_PIPE} ]
439 ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
453 device driver first appeared in
455 and was imported into
461 driver was written by
462 .An Takanori Watanabe Aq takawata@FreeBSD.org
463 and later mostly rewritten by
464 .An Markus Brueffer Aq markus@FreeBSD.org .
465 This manual page was written by
466 .An Christian Brueffer Aq brueffer@FreeBSD.org
468 .An Markus Brueffer Aq markus@FreeBSD.org .