Add comma.
[dragonfly.git] / share / man / man4 / acpi_thinkpad.4
1 .\" Copyright (c) 2005 Christian Brueffer
2 .\" Copyright (c) 2005 Markus Brueffer
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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.
13 .\"
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
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\" $DragonFly: src/share/man/man4/acpi_thinkpad.4,v 1.3 2008/08/28 17:00:27 swildner Exp $
28 .\"
29 .Dd August 28, 2008
30 .Dt ACPI_THINKPAD 4
31 .Os
32 .Sh NAME
33 .Nm acpi_thinkpad
34 .Nd "ACPI extras driver for IBM/Lenovo Thinkpad laptops"
35 .Sh SYNOPSIS
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"
41 .Ed
42 .Pp
43 Alternatively, to load the driver as a
44 module at boot time, place the following line in
45 .Xr loader.conf 5 :
46 .Bd -literal -offset indent
47 acpi_thinkpad_load="YES"
48 .Ed
49 .Sh DESCRIPTION
50 The
51 .Nm
52 driver provides support for hotkeys and other components of IBM/Lenovo
53 Thinkpad laptops.
54 The main purpose of this driver is to provide an interface,
55 accessible via
56 .Xr sysctl 8 ,
57 .\" and
58 .\" .Xr devd 8 ,
59 through which applications can determine the status of
60 various laptop components.
61 .\" .Pp
62 .\" While the
63 .\" .Xr sysctl 8
64 .\" interface is enabled automatically after loading the driver, the
65 .\" .Xr devd 8
66 .\" interface has to be enabled explicitly, as it may alter the default action of
67 .\" certain keys.
68 .\" This is done by setting the
69 .\" .Va events
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
74 .\" .Va eventmask
75 .\" sysctl, is set to
76 .\" .Va availmask
77 .\" by default, a value representing all possible keypress events on the specific
78 .\" ThinkPad model.
79 .\" .Ss Xr devd 8 Ss Events
80 .\" Hotkey events received by
81 .\" .Xr devd 8
82 .\" provide the following information:
83 .\" .Pp
84 .\" .Bl -tag -width "subsystem" -offset indent -compact
85 .\" .It system
86 .\" .Qq Li ACPI
87 .\" .It subsystem
88 .\" .Qq Li IBM
89 .\" .It type
90 .\" The source of the event in the ACPI namespace.
91 .\" The value depends on the model.
92 .\" .It notify
93 .\" Event code (see below).
94 .\" .El
95 .\" .Pp
96 .\" Depending on the ThinkPad model, event codes may vary.
97 .\" On a ThinkPad T41p these are as follows:
98 .\" .Pp
99 .\" .Bl -tag -width "subsystem" -offset indent -compact
100 .\" .It Li 0x01
101 .\" Fn + F1
102 .\" .It Li 0x02
103 .\" Fn + F2
104 .\" .It Li 0x03
105 .\" Fn + F3 (LCD backlight)
106 .\" .It Li 0x04
107 .\" Fn + F4 (Suspend to RAM)
108 .\" .It Li 0x05
109 .\" Fn + F5 (Bluetooth)
110 .\" .It Li 0x06
111 .\" Fn + F6
112 .\" .It Li 0x07
113 .\" Fn + F7 (Screen expand)
114 .\" .It Li 0x08
115 .\" Fn + F8
116 .\" .It Li 0x09
117 .\" Fn + F9
118 .\" .It Li 0x0a
119 .\" Fn + F10
120 .\" .It Li 0x0b
121 .\" Fn + F11
122 .\" .It Li 0x0c
123 .\" Fn + F12 (Suspend to disk)
124 .\" .It Li 0x0d
125 .\" Fn + Backspace
126 .\" .It Li 0x0e
127 .\" Fn + Insert
128 .\" .It Li 0x0f
129 .\" Fn + Delete
130 .\" .It Li 0x10
131 .\" Fn + Home (Brightness up)
132 .\" .It Li 0x11
133 .\" Fn + End (Brightness down)
134 .\" .It Li 0x12
135 .\" Fn + PageUp (ThinkLight)
136 .\" .It Li 0x13
137 .\" Fn + PageDown
138 .\" .It Li 0x14
139 .\" Fn + Space (Zoom)
140 .\" .It Li 0x15
141 .\" Volume Up
142 .\" .It Li 0x16
143 .\" Volume Down
144 .\" .It Li 0x17
145 .\" Mute
146 .\" .It Li 0x18
147 .\" Access IBM Button
148 .\" .El
149 .\" .Ss Xr led 4 Ss Interface
150 .\" The
151 .\" .Nm
152 .\" driver provides a
153 .\" .Xr led 4
154 .\" interface for the ThinkLight.
155 .\" The ThinkLight can be made to blink by writing
156 .\" .Tn ASCII
157 .\" strings to the
158 .\" .Pa /dev/led/thinklight
159 .\" device.
160 .Sh SYSCTL VARIABLES
161 The following sysctls are currently implemented:
162 .Bl -tag -width indent
163 .It Va dev.acpi_thinkpad.0.initialmask
164 (read-only)
165 Bitmask of ACPI events before the
166 .Nm
167 driver was loaded.
168 .It Va dev.acpi_thinkpad.0.availmask
169 (read-only)
170 Bitmask of all supported ACPI events.
171 .It Va dev.acpi_thinkpad.0.events
172 Enable ACPI events and set the
173 .Va eventmask
174 to
175 .Va availmask .
176 Without the
177 .Nm
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
181 .Xr devd 8
182 (not yet available in
183 .Dx
184 ).
185 Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
186 .Va eventmask
187 has.
188 Depending on the ThinkPad model, the meaning of different bits in the
189 .Va eventmask
190 may vary.
191 On a ThinkPad T41p this is a bitwise OR of the following:
192 .Pp
193 .Bl -tag -width indent-two -compact
194 .It Li 1
195 Fn + F1
196 .It Li 2
197 Fn + F2
198 .It Li 4
199 Fn + F3 (LCD backlight)
200 .It Li 8
201 Fn + F4 (Suspend to RAM)
202 .It Li 16
203 Fn + F5 (Bluetooth)
204 .It Li 32
205 Fn + F6
206 .It Li 64
207 Fn + F7 (Screen expand)
208 .It Li 128
209 Fn + F8
210 .It Li 256
211 Fn + F9
212 .It Li 512
213 Fn + F10
214 .It Li 1024
215 Fn + F11
216 .It Li 2048
217 Fn + F12 (Suspend to disk)
218 .It Li 4096
219 Fn + Backspace
220 .It Li 8192
221 Fn + Insert
222 .It Li 16384
223 Fn + Delete
224 .It Li 32768
225 Fn + Home (Brightness up)
226 .It Li 65536
227 Fn + End (Brightness down)
228 .It Li 131072
229 Fn + PageUp (ThinkLight)
230 .It Li 262144
231 Fn + PageDown
232 .It Li 524288
233 Fn + Space (Zoom)
234 .It Li 1048576
235 Volume Up
236 .It Li 2097152
237 Volume Down
238 .It Li 4194304
239 Mute
240 .It Li 8388608
241 Access IBM Button
242 .El
243 .It Va dev.acpi_thinkpad.0.hotkey
244 (read-only)
245 Status of several buttons.
246 Every time a button is pressed, the respecting bit is toggled.
247 It is a bitwise OR of the following:
248 .Pp
249 .Bl -tag -width indent-two -compact
250 .It Li 1
251 Home Button
252 .It Li 2
253 Search Button
254 .It Li 4
255 Mail Button
256 .It Li 8
257 Access IBM Button
258 .It Li 16
259 Zoom
260 .It Li 32
261 Wireless LAN Button
262 .It Li 64
263 Video Button
264 .It Li 128
265 Hibernate Button
266 .It Li 256
267 ThinkLight Button
268 .It Li 512
269 Screen Expand
270 .It Li 1024
271 Brightness Up/Down Button
272 .It Li 2048
273 Volume Up/Down/Mute Button
274 .El
275 .It Va dev.acpi_thinkpad.0.lcd_brightness
276 Current brightness level of the display.
277 .It Va dev.acpi_thinkpad.0.volume
278 Speaker volume.
279 .It Va dev.acpi_thinkpad.0.mute
280 Indicates, whether the speakers are muted or not.
281 .It Va dev.acpi_thinkpad.0.thinklight
282 Indicates, whether the ThinkLight keyboard light is activated or not.
283 .It Va dev.acpi_thinkpad.0.bluetooth
284 Toggle Bluetooth chip activity.
285 .It Va dev.acpi_thinkpad.0.wlan
286 (read-only)
287 Indicates whether the WLAN chip is active or not.
288 .It Va dev.acpi_thinkpad.0.fan
289 Indicates whether the fan is in automatic (1) or manual (0) mode.
290 Default is automatic mode.
291 This sysctl should be used with extreme precaution, since disabling automatic
292 fan control might overheat the ThinkPad and lead to permanent damage if the
293 .Va fan_level
294 is not set accordingly.
295 .It Va dev.acpi_thinkpad.0.fan_level
296 Indicates at what speed the fan should run when being in manual mode.
297 Values are ranging from 0 (off) to 7 (max).
298 The resulting speed differs from model to model.
299 On a T41p this is as follows:
300 .Pp
301 .Bl -tag -width indent-two -compact
302 .It Li 0
303 off
304 .It Li 1, 2
305 ~3000 RPM
306 .It Li 3, 4, 5
307 ~3600 RPM
308 .It Li 6, 7
309 ~4300 RPM
310 .El
311 .It Va hw.sensors.acpi_thinkpad0.tempX
312 Show the readings of up to eight different temperature sensors.
313 Most ThinkPads include six or more temperature sensors but
314 only expose the CPU temperature through
315 .Xr acpi_thermal 4 .
316 Some ThinkPads have the below sensor layout which might vary depending on the
317 specific model:
318 .Pp
319 .Bl -enum -compact
320 .It
321 CPU
322 .It
323 Mini PCI Module
324 .It
325 HDD
326 .It
327 GPU
328 .It
329 Built-in battery
330 .It
331 UltraBay battery
332 .It
333 Built-in battery
334 .It
335 UltraBay battery
336 .El
337 .It Va hw.sensors.acpi_thinkpad0.fan0
338 Fan speed in rounds per minute.
339 .\" A few older ThinkPads report the fan speed in levels ranging from 0 (off)
340 .\" to 7 (max).
341 .El
342 .Pp
343 Defaults for these sysctls can be set in
344 .Xr sysctl.conf 5 .
345 Sensors can be monitored by
346 .Xr sensorsd 8 .
347 .\" .Sh FILES
348 .\" .Bl -tag -width ".Pa /dev/led/thinklight"
349 .\" .It Pa /dev/led/thinklight
350 .\" ThinkLight
351 .\" .Xr led 4
352 .\" device node
353 .\" .El
354 .\" .Sh EXAMPLES
355 .\" The following can be added to
356 .\" .Xr devd.conf 5
357 .\" in order to pass button events to a
358 .\" .Pa /usr/local/sbin/acpi_oem_exec.sh
359 .\" script:
360 .\" .Bd -literal -offset indent
361 .\" notify 10 {
362 .\"         match "system"          "ACPI";
363 .\"         match "subsystem"       "IBM";
364 .\"         action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
365 .\" };
366 .\" .Ed
367 .\" .Pp
368 .\" A possible
369 .\" .Pa /usr/local/sbin/acpi_oem_exec.sh
370 .\" script might look like:
371 .\" .Bd -literal -offset indent
372 .\" #!/bin/sh
373 .\" #
374 .\" if [ "$1" = "" -o "$2" = "" ]
375 .\" then
376 .\"         echo "usage: $0 notify oem_name"
377 .\"         exit 1
378 .\" fi
379 .\" NOTIFY=`echo $1`
380 .\" LOGGER="logger"
381 .\" CALC="bc"
382 .\" BC_PRECOMMANDS="scale=2"
383 .\" ECHO="echo"
384 .\" CUT="cut"
385 .\" MAX_LCD_BRIGHTNESS=7
386 .\" MAX_VOLUME=14
387 .\" OEM=$2
388 .\" DISPLAY_PIPE=/tmp/acpi_${OEM}_display
389 .\" 
390 .\" case ${NOTIFY} in
391 .\"         0x05)
392 .\"                 LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
393 .\"                 if [ "$LEVEL" = "1" ]
394 .\"                 then
395 .\"                         sysctl dev.acpi_${OEM}.0.bluetooth=0
396 .\"                         MESSAGE="bluetooth disabled"
397 .\"                 else
398 .\"                         sysctl dev.acpi_${OEM}.0.bluetooth=1
399 .\"                         MESSAGE="bluetooth enabled"
400 .\"                 fi
401 .\"                 ;;
402 .\"         0x10|0x11)
403 .\"                 LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
404 .\"                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
405 .\"                          ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
406 .\"                          ${CALC} | ${CUT} -d . -f 1`
407 .\"                 MESSAGE="brightness level ${PERCENT}%"
408 .\"                 ;;
409 .\"         0x12)
410 .\"                 LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
411 .\"                 if [ "$LEVEL" = "1" ]
412 .\"                 then
413 .\"                         MESSAGE="thinklight enabled"
414 .\"                 else
415 .\"                         MESSAGE="thinklight disabled"
416 .\"                 fi
417 .\"                 ;;
418 .\"         0x15|0x16)
419 .\"                 LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
420 .\"                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
421 .\"                         ${LEVEL} / ${MAX_VOLUME} * 100" | \\
422 .\"                          ${CALC} | ${CUT} -d . -f 1`
423 .\"                 MESSAGE="volume level ${PERCENT}%"
424 .\"                 ;;
425 .\"         0x17)
426 .\"                 LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
427 .\"                 if [ "$LEVEL" = "1" ]
428 .\"                 then
429 .\"                         MESSAGE="volume muted"
430 .\"                 else
431 .\"                         MESSAGE="volume unmuted"
432 .\"                 fi
433 .\"                 ;;
434 .\"         *)
435 .\"                 ;;
436 .\" esac
437 .\" ${LOGGER} ${MESSAGE}
438 .\" if [ -p ${DISPLAY_PIPE} ]
439 .\" then
440 .\"         ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
441 .\" fi
442 .\" exit 0
443 .\" .Ed
444 .Sh SEE ALSO
445 .Xr acpi 4 ,
446 .\" .Xr led 4 ,
447 .Xr sysctl.conf 5 ,
448 .\" .Xr devd 8 ,
449 .Xr sensorsd 8 ,
450 .Xr sysctl 8
451 .Sh HISTORY
452 The
453 .Nm
454 device driver first appeared in
455 .Fx 6.0
456 and was imported into
457 .Dx 2.1 .
458 .Sh AUTHORS
459 .An -nosplit
460 The
461 .Nm
462 driver was written by
463 .An Takanori Watanabe Aq takawata@FreeBSD.org
464 and later mostly rewritten by
465 .An Markus Brueffer Aq markus@FreeBSD.org .
466 This manual page was written by
467 .An Christian Brueffer Aq brueffer@FreeBSD.org
468 and
469 .An Markus Brueffer Aq markus@FreeBSD.org .