xref: /freebsd/share/man/man4/acpi_ibm.4 (revision 707347f886492a149d17b4cff1fc6731f5e752a1)
1e6769554SRui Paulo.\" Copyright (c) 2005 Christian Brueffer
2e6769554SRui Paulo.\" Copyright (c) 2005 Markus Brueffer
3e6769554SRui Paulo.\" All rights reserved.
4e6769554SRui Paulo.\"
5e6769554SRui Paulo.\" Redistribution and use in source and binary forms, with or without
6e6769554SRui Paulo.\" modification, are permitted provided that the following conditions
7e6769554SRui Paulo.\" are met:
8e6769554SRui Paulo.\" 1. Redistributions of source code must retain the above copyright
9e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer.
10e6769554SRui Paulo.\" 2. Redistributions in binary form must reproduce the above copyright
11e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer in the
12e6769554SRui Paulo.\"    documentation and/or other materials provided with the distribution.
13e6769554SRui Paulo.\"
14e6769554SRui Paulo.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15e6769554SRui Paulo.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16e6769554SRui Paulo.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17e6769554SRui Paulo.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18e6769554SRui Paulo.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19e6769554SRui Paulo.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20e6769554SRui Paulo.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21e6769554SRui Paulo.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22e6769554SRui Paulo.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23e6769554SRui Paulo.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24e6769554SRui Paulo.\" SUCH DAMAGE.
25e6769554SRui Paulo.\"
26e6769554SRui Paulo.\" $FreeBSD$
27e6769554SRui Paulo.\"
2810b942e5SXin LI.Dd June 19, 2015
29891acefeSGavin Atkinson.Dt ACPI_IBM 4
30e6769554SRui Paulo.Os
31e6769554SRui Paulo.Sh NAME
32e6769554SRui Paulo.Nm acpi_ibm
33e6769554SRui Paulo.Nd "ACPI extras driver for IBM laptops"
34e6769554SRui Paulo.Sh SYNOPSIS
35e6769554SRui PauloTo compile this driver into the kernel,
36e6769554SRui Pauloplace the following line in your
37e6769554SRui Paulokernel configuration file:
38e6769554SRui Paulo.Bd -ragged -offset indent
39e6769554SRui Paulo.Cd "device acpi_ibm"
40e6769554SRui Paulo.Ed
41e6769554SRui Paulo.Pp
42e6769554SRui PauloAlternatively, to load the driver as a
43e6769554SRui Paulomodule at boot time, place the following line in
44e6769554SRui Paulo.Xr loader.conf 5 :
45e6769554SRui Paulo.Bd -literal -offset indent
46e6769554SRui Pauloacpi_ibm_load="YES"
47e6769554SRui Paulo.Ed
48e6769554SRui Paulo.Sh DESCRIPTION
49e6769554SRui PauloThe
50e6769554SRui Paulo.Nm
51e6769554SRui Paulodriver provides support for hotkeys and other components of IBM laptops.
52e6769554SRui PauloThe main purpose of this driver is to provide an interface,
53e6769554SRui Pauloaccessible via
54e6769554SRui Paulo.Xr sysctl 8
55e6769554SRui Pauloand
56e6769554SRui Paulo.Xr devd 8 ,
57e6769554SRui Paulothrough which applications can determine the status of
58e6769554SRui Paulovarious laptop components.
59e6769554SRui Paulo.Pp
60e6769554SRui PauloWhile the
61e6769554SRui Paulo.Xr sysctl 8
62e6769554SRui Paulointerface is enabled automatically after loading the driver, the
63e6769554SRui Paulo.Xr devd 8
64e6769554SRui Paulointerface has to be enabled explicitly, as it may alter the default action of
65e6769554SRui Paulocertain keys.
66e6769554SRui PauloThis is done by setting the
67e6769554SRui Paulo.Va events
68e6769554SRui Paulosysctl as described below.
69e6769554SRui PauloSpecifying which keys should generate events is done by setting a bitmask,
70e6769554SRui Paulowhereas each bit represents one key or key combination.
71e6769554SRui PauloThis bitmask, accessible via the
72e6769554SRui Paulo.Va eventmask
73e6769554SRui Paulosysctl, is set to
74e6769554SRui Paulo.Va availmask
75e6769554SRui Pauloby default, a value representing all possible keypress events on the specific
76e6769554SRui PauloThinkPad model.
7710b942e5SXin LI.Ss Xr devd 8 Events
78e6769554SRui PauloHotkey events received by
79e6769554SRui Paulo.Xr devd 8
80e6769554SRui Pauloprovide the following information:
81e6769554SRui Paulo.Pp
82e6769554SRui Paulo.Bl -tag -width "subsystem" -offset indent -compact
83e6769554SRui Paulo.It system
84e6769554SRui Paulo.Qq Li ACPI
85e6769554SRui Paulo.It subsystem
86e6769554SRui Paulo.Qq Li IBM
87e6769554SRui Paulo.It type
88e6769554SRui PauloThe source of the event in the ACPI namespace.
89e6769554SRui PauloThe value depends on the model.
90e6769554SRui Paulo.It notify
91e6769554SRui PauloEvent code (see below).
92e6769554SRui Paulo.El
93e6769554SRui Paulo.Pp
94e6769554SRui PauloDepending on the ThinkPad model, event codes may vary.
95e6769554SRui PauloOn a ThinkPad T41p these are as follows:
96e6769554SRui Paulo.Pp
97e6769554SRui Paulo.Bl -tag -width "subsystem" -offset indent -compact
98e6769554SRui Paulo.It Li 0x01
99e6769554SRui PauloFn + F1
100e6769554SRui Paulo.It Li 0x02
101e6769554SRui PauloFn + F2
102e6769554SRui Paulo.It Li 0x03
103e6769554SRui PauloFn + F3 (LCD backlight)
104e6769554SRui Paulo.It Li 0x04
105e6769554SRui PauloFn + F4 (Suspend to RAM)
106e6769554SRui Paulo.It Li 0x05
107e6769554SRui PauloFn + F5 (Bluetooth)
108e6769554SRui Paulo.It Li 0x06
109e6769554SRui PauloFn + F6
110e6769554SRui Paulo.It Li 0x07
111e6769554SRui PauloFn + F7 (Screen expand)
112e6769554SRui Paulo.It Li 0x08
113e6769554SRui PauloFn + F8
114e6769554SRui Paulo.It Li 0x09
115e6769554SRui PauloFn + F9
116e6769554SRui Paulo.It Li 0x0a
117e6769554SRui PauloFn + F10
118e6769554SRui Paulo.It Li 0x0b
119e6769554SRui PauloFn + F11
120e6769554SRui Paulo.It Li 0x0c
121e6769554SRui PauloFn + F12 (Suspend to disk)
122e6769554SRui Paulo.It Li 0x0d
123e6769554SRui PauloFn + Backspace
124e6769554SRui Paulo.It Li 0x0e
125e6769554SRui PauloFn + Insert
126e6769554SRui Paulo.It Li 0x0f
127e6769554SRui PauloFn + Delete
128e6769554SRui Paulo.It Li 0x10
129e6769554SRui PauloFn + Home (Brightness up)
130e6769554SRui Paulo.It Li 0x11
131e6769554SRui PauloFn + End (Brightness down)
132e6769554SRui Paulo.It Li 0x12
133e6769554SRui PauloFn + PageUp (ThinkLight)
134e6769554SRui Paulo.It Li 0x13
135e6769554SRui PauloFn + PageDown
136e6769554SRui Paulo.It Li 0x14
137e6769554SRui PauloFn + Space (Zoom)
138e6769554SRui Paulo.It Li 0x15
139e6769554SRui PauloVolume Up
140e6769554SRui Paulo.It Li 0x16
141e6769554SRui PauloVolume Down
142e6769554SRui Paulo.It Li 0x17
143e6769554SRui PauloMute
144e6769554SRui Paulo.It Li 0x18
145e6769554SRui PauloAccess IBM Button
146e6769554SRui Paulo.El
14710b942e5SXin LI.Ss Xr led 4 Interface
148e6769554SRui PauloThe
149e6769554SRui Paulo.Nm
150e6769554SRui Paulodriver provides a
151e6769554SRui Paulo.Xr led 4
152e6769554SRui Paulointerface for the ThinkLight.
153e6769554SRui PauloThe ThinkLight can be made to blink by writing
154e6769554SRui Paulo.Tn ASCII
155e6769554SRui Paulostrings to the
156e6769554SRui Paulo.Pa /dev/led/thinklight
157e6769554SRui Paulodevice.
158e6769554SRui Paulo.Sh SYSCTL VARIABLES
159e6769554SRui PauloThe following sysctls are currently implemented:
160e6769554SRui Paulo.Bl -tag -width indent
161e6769554SRui Paulo.It Va dev.acpi_ibm.0.initialmask
162e6769554SRui Paulo(read-only)
163e6769554SRui PauloBitmask of ACPI events before the
164e6769554SRui Paulo.Nm
165e6769554SRui Paulodriver was loaded.
166e6769554SRui Paulo.It Va dev.acpi_ibm.0.availmask
167e6769554SRui Paulo(read-only)
168e6769554SRui PauloBitmask of all supported ACPI events.
169e6769554SRui Paulo.It Va dev.acpi_ibm.0.events
170e6769554SRui PauloEnable ACPI events and set the
171e6769554SRui Paulo.Va eventmask
172e6769554SRui Pauloto
173e6769554SRui Paulo.Va availmask .
174e6769554SRui PauloWithout the
175e6769554SRui Paulo.Nm
176e6769554SRui Paulodriver being loaded, only the Fn+F4 button generates an ACPI event.
177e6769554SRui Paulo.It Va dev.acpi_ibm.0.eventmask
178e6769554SRui PauloSets the ACPI events which are reported to
179e6769554SRui Paulo.Xr devd 8 .
180e6769554SRui PauloFn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
181e6769554SRui Paulo.Va eventmask
182e6769554SRui Paulohas.
183e6769554SRui PauloDepending on the ThinkPad model, the meaning of different bits in the
184e6769554SRui Paulo.Va eventmask
185e6769554SRui Paulomay vary.
186e6769554SRui PauloOn a ThinkPad T41p this is a bitwise OR of the following:
187e6769554SRui Paulo.Pp
188e6769554SRui Paulo.Bl -tag -width indent-two -compact
189e6769554SRui Paulo.It Li 1
190e6769554SRui PauloFn + F1
191e6769554SRui Paulo.It Li 2
192e6769554SRui PauloFn + F2
193e6769554SRui Paulo.It Li 4
194e6769554SRui PauloFn + F3 (LCD backlight)
195e6769554SRui Paulo.It Li 8
196e6769554SRui PauloFn + F4 (Suspend to RAM)
197e6769554SRui Paulo.It Li 16
198e6769554SRui PauloFn + F5 (Bluetooth)
199e6769554SRui Paulo.It Li 32
200e6769554SRui PauloFn + F6
201e6769554SRui Paulo.It Li 64
202e6769554SRui PauloFn + F7 (Screen expand)
203e6769554SRui Paulo.It Li 128
204e6769554SRui PauloFn + F8
205e6769554SRui Paulo.It Li 256
206e6769554SRui PauloFn + F9
207e6769554SRui Paulo.It Li 512
208e6769554SRui PauloFn + F10
209e6769554SRui Paulo.It Li 1024
210e6769554SRui PauloFn + F11
211e6769554SRui Paulo.It Li 2048
212e6769554SRui PauloFn + F12 (Suspend to disk)
213e6769554SRui Paulo.It Li 4096
214e6769554SRui PauloFn + Backspace
215e6769554SRui Paulo.It Li 8192
216e6769554SRui PauloFn + Insert
217e6769554SRui Paulo.It Li 16384
218e6769554SRui PauloFn + Delete
219e6769554SRui Paulo.It Li 32768
220e6769554SRui PauloFn + Home (Brightness up)
221e6769554SRui Paulo.It Li 65536
222e6769554SRui PauloFn + End (Brightness down)
223e6769554SRui Paulo.It Li 131072
224e6769554SRui PauloFn + PageUp (ThinkLight)
225e6769554SRui Paulo.It Li 262144
226e6769554SRui PauloFn + PageDown
227e6769554SRui Paulo.It Li 524288
228e6769554SRui PauloFn + Space (Zoom)
229e6769554SRui Paulo.It Li 1048576
230e6769554SRui PauloVolume Up
231e6769554SRui Paulo.It Li 2097152
232e6769554SRui PauloVolume Down
233e6769554SRui Paulo.It Li 4194304
234e6769554SRui PauloMute
235e6769554SRui Paulo.It Li 8388608
236e6769554SRui PauloAccess IBM Button
237e6769554SRui Paulo.El
238e6769554SRui Paulo.It Va dev.acpi_ibm.0.hotkey
239e6769554SRui Paulo(read-only)
240e6769554SRui PauloStatus of several buttons.
241e6769554SRui PauloEvery time a button is pressed, the respecting bit is toggled.
242e6769554SRui PauloIt is a bitwise OR of the following:
243e6769554SRui Paulo.Pp
244e6769554SRui Paulo.Bl -tag -width indent-two -compact
245e6769554SRui Paulo.It Li 1
246e6769554SRui PauloHome Button
247e6769554SRui Paulo.It Li 2
248e6769554SRui PauloSearch Button
249e6769554SRui Paulo.It Li 4
250e6769554SRui PauloMail Button
251e6769554SRui Paulo.It Li 8
252e6769554SRui PauloAccess IBM Button
253e6769554SRui Paulo.It Li 16
254e6769554SRui PauloZoom
255e6769554SRui Paulo.It Li 32
256e6769554SRui PauloWireless LAN Button
257e6769554SRui Paulo.It Li 64
258e6769554SRui PauloVideo Button
259e6769554SRui Paulo.It Li 128
260e6769554SRui PauloHibernate Button
261e6769554SRui Paulo.It Li 256
262e6769554SRui PauloThinkLight Button
263e6769554SRui Paulo.It Li 512
264e6769554SRui PauloScreen Expand
265e6769554SRui Paulo.It Li 1024
266e6769554SRui PauloBrightness Up/Down Button
267e6769554SRui Paulo.It Li 2048
268e6769554SRui PauloVolume Up/Down/Mute Button
269e6769554SRui Paulo.El
270e6769554SRui Paulo.It Va dev.acpi_ibm.0.lcd_brightness
271e6769554SRui PauloCurrent brightness level of the display.
272e6769554SRui Paulo.It Va dev.acpi_ibm.0.volume
273e6769554SRui PauloSpeaker volume.
274e6769554SRui Paulo.It Va dev.acpi_ibm.0.mute
275e6769554SRui PauloIndicates, whether the speakers are muted or not.
276*707347f8SAllan Jude.It Va dev.acpi_ibm.0.mic_mute
277*707347f8SAllan JudeIndicates, whether the microphone led (present on some model) is on or not.
278*707347f8SAllan JudeNote that this does not mean that the microphone input is muted.
279e6769554SRui Paulo.It Va dev.acpi_ibm.0.thinklight
280e6769554SRui PauloIndicates, whether the ThinkLight keyboard light is activated or not.
281e6769554SRui Paulo.It Va dev.acpi_ibm.0.bluetooth
282e6769554SRui PauloToggle Bluetooth chip activity.
283e6769554SRui Paulo.It Va dev.acpi_ibm.0.wlan
284e6769554SRui Paulo(read-only)
285e6769554SRui PauloIndicates whether the WLAN chip is active or not.
286e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan
287e6769554SRui PauloIndicates whether the fan is in automatic (1) or manual (0) mode.
288e6769554SRui PauloDefault is automatic mode.
289e6769554SRui PauloThis sysctl should be used with extreme precaution, since disabling automatic
290e6769554SRui Paulofan control might overheat the ThinkPad and lead to permanent damage if the
291e6769554SRui Paulo.Va fan_level
292e6769554SRui Paulois not set accordingly.
293e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_level
294e6769554SRui PauloIndicates at what speed the fan should run when being in manual mode.
295e6769554SRui PauloValues are ranging from 0 (off) to 7 (max).
296e6769554SRui PauloThe resulting speed differs from model to model.
297e6769554SRui PauloOn a T41p this is as follows:
298e6769554SRui Paulo.Pp
299e6769554SRui Paulo.Bl -tag -width indent-two -compact
300e6769554SRui Paulo.It Li 0
301e6769554SRui Paulooff
302e6769554SRui Paulo.It Li 1, 2
303e6769554SRui Paulo~3000 RPM
304e6769554SRui Paulo.It Li 3, 4, 5
305e6769554SRui Paulo~3600 RPM
306e6769554SRui Paulo.It Li 6, 7
307e6769554SRui Paulo~4300 RPM
308e6769554SRui Paulo.El
309e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_speed
310e6769554SRui Paulo(read-only)
311e6769554SRui PauloFan speed in rounds per minute.
312e6769554SRui PauloA few older ThinkPads report the fan speed in levels ranging from 0 (off)
313e6769554SRui Pauloto 7 (max).
314e6769554SRui Paulo.It Va dev.acpi_ibm.0.thermal
315e6769554SRui Paulo(read-only)
316e6769554SRui PauloShows the readings of up to eight different temperature sensors.
317e6769554SRui PauloMost ThinkPads include six or more temperature sensors but
318e6769554SRui Pauloonly expose the CPU temperature through
319e6769554SRui Paulo.Xr acpi_thermal 4 .
320e6769554SRui PauloSome ThinkPads have the below sensor layout which might vary depending on the
321e6769554SRui Paulospecific model:
322e6769554SRui Paulo.Pp
323e6769554SRui Paulo.Bl -enum -compact
324e6769554SRui Paulo.It
325e6769554SRui PauloCPU
326e6769554SRui Paulo.It
327e6769554SRui PauloMini PCI Module
328e6769554SRui Paulo.It
329e6769554SRui PauloHDD
330e6769554SRui Paulo.It
331e6769554SRui PauloGPU
332e6769554SRui Paulo.It
333e6769554SRui PauloBuilt-in battery
334e6769554SRui Paulo.It
335e6769554SRui PauloUltraBay battery
336e6769554SRui Paulo.It
337e6769554SRui PauloBuilt-in battery
338e6769554SRui Paulo.It
339e6769554SRui PauloUltraBay battery
340e6769554SRui Paulo.El
341154be296SMitsuru IWASAKI.It Va dev.acpi_ibm.0.handlerevents
342154be296SMitsuru IWASAKI.Xr devd 8
343154be296SMitsuru IWASAKIevents handled by
344154be296SMitsuru IWASAKI.Nm
345154be296SMitsuru IWASAKIwhen
346154be296SMitsuru IWASAKI.Va events
347154be296SMitsuru IWASAKIis set to 1.
348154be296SMitsuru IWASAKIEvents are specified as a whitespace-separated list of event code in
349154be296SMitsuru IWASAKIhexadecimal or decimal form.
35010b942e5SXin LINote that the event maybe handled twice (e.g., Brightness up/down) if ACPI BIOS
351154be296SMitsuru IWASAKIalready handled the event.
352e6769554SRui Paulo.El
353e6769554SRui Paulo.Pp
354e6769554SRui PauloDefaults for these sysctls can be set in
355e6769554SRui Paulo.Xr sysctl.conf 5 .
356e6769554SRui Paulo.Sh FILES
357e6769554SRui Paulo.Bl -tag -width ".Pa /dev/led/thinklight"
358e6769554SRui Paulo.It Pa /dev/led/thinklight
359e6769554SRui PauloThinkLight
360e6769554SRui Paulo.Xr led 4
361e6769554SRui Paulodevice node
362e6769554SRui Paulo.El
363e6769554SRui Paulo.Sh EXAMPLES
364e6769554SRui PauloThe following can be added to
365e6769554SRui Paulo.Xr devd.conf 5
366e6769554SRui Pauloin order to pass button events to a
367e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
368e6769554SRui Pauloscript:
369e6769554SRui Paulo.Bd -literal -offset indent
370e6769554SRui Paulonotify 10 {
371e6769554SRui Paulo        match "system"          "ACPI";
372e6769554SRui Paulo        match "subsystem"       "IBM";
373e6769554SRui Paulo        action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
374e6769554SRui Paulo};
375e6769554SRui Paulo.Ed
376e6769554SRui Paulo.Pp
377e6769554SRui PauloA possible
378e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
379e6769554SRui Pauloscript might look like:
380e6769554SRui Paulo.Bd -literal -offset indent
381e6769554SRui Paulo#!/bin/sh
382e6769554SRui Paulo#
383e6769554SRui Pauloif [ "$1" = "" -o "$2" = "" ]
384e6769554SRui Paulothen
385e6769554SRui Paulo        echo "usage: $0 notify oem_name"
386e6769554SRui Paulo        exit 1
387e6769554SRui Paulofi
388e6769554SRui PauloNOTIFY=`echo $1`
389e6769554SRui PauloLOGGER="logger"
390e6769554SRui PauloCALC="bc"
391e6769554SRui PauloBC_PRECOMMANDS="scale=2"
392e6769554SRui PauloECHO="echo"
393e6769554SRui PauloCUT="cut"
394e6769554SRui PauloMAX_LCD_BRIGHTNESS=7
395e6769554SRui PauloMAX_VOLUME=14
396e6769554SRui PauloOEM=$2
397e6769554SRui PauloDISPLAY_PIPE=/tmp/acpi_${OEM}_display
398e6769554SRui Paulo
399e6769554SRui Paulocase ${NOTIFY} in
400e6769554SRui Paulo        0x05)
401e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
402e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
403e6769554SRui Paulo                then
404e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=0
405e6769554SRui Paulo                        MESSAGE="bluetooth disabled"
406e6769554SRui Paulo                else
407e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=1
408e6769554SRui Paulo                        MESSAGE="bluetooth enabled"
409e6769554SRui Paulo                fi
410e6769554SRui Paulo                ;;
411e6769554SRui Paulo        0x10|0x11)
412e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
413e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
414e6769554SRui Paulo                         ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
415e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
416e6769554SRui Paulo                MESSAGE="brightness level ${PERCENT}%"
417e6769554SRui Paulo                ;;
418e6769554SRui Paulo        0x12)
419e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
420e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
421e6769554SRui Paulo                then
422e6769554SRui Paulo                        MESSAGE="thinklight enabled"
423e6769554SRui Paulo                else
424e6769554SRui Paulo                        MESSAGE="thinklight disabled"
425e6769554SRui Paulo                fi
426e6769554SRui Paulo                ;;
427e6769554SRui Paulo        0x15|0x16)
428e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
429e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
430e6769554SRui Paulo                        ${LEVEL} / ${MAX_VOLUME} * 100" | \\
431e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
432e6769554SRui Paulo                MESSAGE="volume level ${PERCENT}%"
433e6769554SRui Paulo                ;;
434e6769554SRui Paulo        0x17)
435e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
436e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
437e6769554SRui Paulo                then
438e6769554SRui Paulo                        MESSAGE="volume muted"
439e6769554SRui Paulo                else
440e6769554SRui Paulo                        MESSAGE="volume unmuted"
441e6769554SRui Paulo                fi
442e6769554SRui Paulo                ;;
443*707347f8SAllan Jude	0x1b)
444*707347f8SAllan Jude		LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
445*707347f8SAllan Jude		if [ $LEVEL -eq 0 ]; then
446*707347f8SAllan Jude			sysctl dev.acpi_ibm.0.mic_led=1
447*707347f8SAllan Jude			mixer rec 0
448*707347f8SAllan Jude		fi
449*707347f8SAllan Jude		if [ $LEVEL -eq 1 ]; then
450*707347f8SAllan Jude			sysctl dev.acpi_ibm.0.mic_led=0
451*707347f8SAllan Jude			mixer rec 30
452*707347f8SAllan Jude		fi
453*707347f8SAllan Jude		;;
454e6769554SRui Paulo        *)
455e6769554SRui Paulo                ;;
456e6769554SRui Pauloesac
457e6769554SRui Paulo${LOGGER} ${MESSAGE}
458e6769554SRui Pauloif [ -p ${DISPLAY_PIPE} ]
459e6769554SRui Paulothen
460e6769554SRui Paulo        ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
461e6769554SRui Paulofi
462e6769554SRui Pauloexit 0
463e6769554SRui Paulo.Ed
464154be296SMitsuru IWASAKI.Pp
465154be296SMitsuru IWASAKIThe following example specify that event code 0x04 (Suspend to RAM),
466154be296SMitsuru IWASAKI0x10 (Brightness up) and 0x11 (Brightness down) are handled by
467154be296SMitsuru IWASAKI.Nm .
468154be296SMitsuru IWASAKI.Bd -literal -offset indent
469154be296SMitsuru IWASAKIsysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11'
470154be296SMitsuru IWASAKI.Ed
471154be296SMitsuru IWASAKI.Pp
472154be296SMitsuru IWASAKIin
473154be296SMitsuru IWASAKI.Xr sysctl.conf 5 :
474154be296SMitsuru IWASAKI.Bd -literal -offset indent
475154be296SMitsuru IWASAKIdev.acpi_ibm.0.handlerevents=0x04\\ 0x10\\ 0x11
476154be296SMitsuru IWASAKI.Ed
477e6769554SRui Paulo.Sh SEE ALSO
478e6769554SRui Paulo.Xr acpi 4 ,
479e6769554SRui Paulo.Xr led 4 ,
480e6769554SRui Paulo.Xr sysctl.conf 5 ,
481e6769554SRui Paulo.Xr devd 8 ,
482e6769554SRui Paulo.Xr sysctl 8
483e6769554SRui Paulo.Sh HISTORY
484e6769554SRui PauloThe
485e6769554SRui Paulo.Nm
486e6769554SRui Paulodevice driver first appeared in
487e6769554SRui Paulo.Fx 6.0 .
488e6769554SRui Paulo.Sh AUTHORS
489e6769554SRui Paulo.An -nosplit
490e6769554SRui PauloThe
491e6769554SRui Paulo.Nm
492e6769554SRui Paulodriver was written by
4936c899950SBaptiste Daroussin.An Takanori Watanabe Aq Mt takawata@FreeBSD.org
494e6769554SRui Pauloand later mostly rewritten by
4956c899950SBaptiste Daroussin.An Markus Brueffer Aq Mt markus@FreeBSD.org .
496e6769554SRui PauloThis manual page was written by
4976c899950SBaptiste Daroussin.An Christian Brueffer Aq Mt brueffer@FreeBSD.org
498e6769554SRui Pauloand
4996c899950SBaptiste Daroussin.An Markus Brueffer Aq Mt markus@FreeBSD.org .
500