xref: /freebsd/share/man/man4/acpi_ibm.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
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.\"
26e83a53abSMateusz Piotrowski.Dd March 13, 2022
27891acefeSGavin Atkinson.Dt ACPI_IBM 4
28e6769554SRui Paulo.Os
29e6769554SRui Paulo.Sh NAME
30e6769554SRui Paulo.Nm acpi_ibm
318c5cb4ceSEd Maste.Nd "ThinkPad ACPI extras driver"
32e6769554SRui Paulo.Sh SYNOPSIS
33e6769554SRui PauloTo compile this driver into the kernel,
34e6769554SRui Pauloplace the following line in your
35e6769554SRui Paulokernel configuration file:
36e6769554SRui Paulo.Bd -ragged -offset indent
37e6769554SRui Paulo.Cd "device acpi_ibm"
38e6769554SRui Paulo.Ed
39e6769554SRui Paulo.Pp
40e6769554SRui PauloAlternatively, to load the driver as a
41e6769554SRui Paulomodule at boot time, place the following line in
42e6769554SRui Paulo.Xr loader.conf 5 :
43e6769554SRui Paulo.Bd -literal -offset indent
44e6769554SRui Pauloacpi_ibm_load="YES"
45e6769554SRui Paulo.Ed
46e6769554SRui Paulo.Sh DESCRIPTION
47e6769554SRui PauloThe
48e6769554SRui Paulo.Nm
498c5cb4ceSEd Mastedriver provides support for hotkeys and other components of ThinkPad laptops.
50e6769554SRui PauloThe main purpose of this driver is to provide an interface,
51e6769554SRui Pauloaccessible via
52e6769554SRui Paulo.Xr sysctl 8
53e6769554SRui Pauloand
54e6769554SRui Paulo.Xr devd 8 ,
55e6769554SRui Paulothrough which applications can determine the status of
56e6769554SRui Paulovarious laptop components.
57e6769554SRui Paulo.Pp
58e6769554SRui PauloWhile the
59e6769554SRui Paulo.Xr sysctl 8
60e6769554SRui Paulointerface is enabled automatically after loading the driver, the
61e6769554SRui Paulo.Xr devd 8
62e6769554SRui Paulointerface has to be enabled explicitly, as it may alter the default action of
63e6769554SRui Paulocertain keys.
64e6769554SRui PauloThis is done by setting the
65e6769554SRui Paulo.Va events
66e6769554SRui Paulosysctl as described below.
67e6769554SRui PauloSpecifying which keys should generate events is done by setting a bitmask,
68e6769554SRui Paulowhereas each bit represents one key or key combination.
69e6769554SRui PauloThis bitmask, accessible via the
70e6769554SRui Paulo.Va eventmask
71e6769554SRui Paulosysctl, is set to
72e6769554SRui Paulo.Va availmask
73e6769554SRui Pauloby default, a value representing all possible keypress events on the specific
74e6769554SRui PauloThinkPad model.
7510b942e5SXin LI.Ss Xr devd 8 Events
76e6769554SRui PauloHotkey events received by
77e6769554SRui Paulo.Xr devd 8
78e6769554SRui Pauloprovide the following information:
79e6769554SRui Paulo.Pp
80e6769554SRui Paulo.Bl -tag -width "subsystem" -offset indent -compact
81e6769554SRui Paulo.It system
82e6769554SRui Paulo.Qq Li ACPI
83e6769554SRui Paulo.It subsystem
84e6769554SRui Paulo.Qq Li IBM
85e6769554SRui Paulo.It type
86e6769554SRui PauloThe source of the event in the ACPI namespace.
87e6769554SRui PauloThe value depends on the model.
88e6769554SRui Paulo.It notify
89e6769554SRui PauloEvent code (see below).
90e6769554SRui Paulo.El
91e6769554SRui Paulo.Pp
92e6769554SRui PauloDepending on the ThinkPad model, event codes may vary.
93e6769554SRui PauloOn a ThinkPad T41p these are as follows:
94e6769554SRui Paulo.Pp
95e6769554SRui Paulo.Bl -tag -width "subsystem" -offset indent -compact
96e6769554SRui Paulo.It Li 0x01
97e6769554SRui PauloFn + F1
98e6769554SRui Paulo.It Li 0x02
99e6769554SRui PauloFn + F2
100e6769554SRui Paulo.It Li 0x03
101e6769554SRui PauloFn + F3 (LCD backlight)
102e6769554SRui Paulo.It Li 0x04
103e6769554SRui PauloFn + F4 (Suspend to RAM)
104e6769554SRui Paulo.It Li 0x05
105e6769554SRui PauloFn + F5 (Bluetooth)
106e6769554SRui Paulo.It Li 0x06
107e6769554SRui PauloFn + F6
108e6769554SRui Paulo.It Li 0x07
109e6769554SRui PauloFn + F7 (Screen expand)
110e6769554SRui Paulo.It Li 0x08
111e6769554SRui PauloFn + F8
112e6769554SRui Paulo.It Li 0x09
113e6769554SRui PauloFn + F9
114e6769554SRui Paulo.It Li 0x0a
115e6769554SRui PauloFn + F10
116e6769554SRui Paulo.It Li 0x0b
117e6769554SRui PauloFn + F11
118e6769554SRui Paulo.It Li 0x0c
119e6769554SRui PauloFn + F12 (Suspend to disk)
120e6769554SRui Paulo.It Li 0x0d
121e6769554SRui PauloFn + Backspace
122e6769554SRui Paulo.It Li 0x0e
123e6769554SRui PauloFn + Insert
124e6769554SRui Paulo.It Li 0x0f
125e6769554SRui PauloFn + Delete
126e6769554SRui Paulo.It Li 0x10
127e6769554SRui PauloFn + Home (Brightness up)
128e6769554SRui Paulo.It Li 0x11
129e6769554SRui PauloFn + End (Brightness down)
130e6769554SRui Paulo.It Li 0x12
131e6769554SRui PauloFn + PageUp (ThinkLight)
132e6769554SRui Paulo.It Li 0x13
133e6769554SRui PauloFn + PageDown
134e6769554SRui Paulo.It Li 0x14
135e6769554SRui PauloFn + Space (Zoom)
136e6769554SRui Paulo.It Li 0x15
137e6769554SRui PauloVolume Up
138e6769554SRui Paulo.It Li 0x16
139e6769554SRui PauloVolume Down
140e6769554SRui Paulo.It Li 0x17
141e6769554SRui PauloMute
142e6769554SRui Paulo.It Li 0x18
143e6769554SRui PauloAccess IBM Button
144e6769554SRui Paulo.El
14510b942e5SXin LI.Ss Xr led 4 Interface
146e6769554SRui PauloThe
147e6769554SRui Paulo.Nm
148e6769554SRui Paulodriver provides a
149e6769554SRui Paulo.Xr led 4
150e6769554SRui Paulointerface for the ThinkLight.
151e6769554SRui PauloThe ThinkLight can be made to blink by writing
152e6769554SRui Paulo.Tn ASCII
153e6769554SRui Paulostrings to the
154e6769554SRui Paulo.Pa /dev/led/thinklight
155e6769554SRui Paulodevice.
156e6769554SRui Paulo.Sh SYSCTL VARIABLES
157e6769554SRui PauloThe following sysctls are currently implemented:
158e6769554SRui Paulo.Bl -tag -width indent
159e6769554SRui Paulo.It Va dev.acpi_ibm.0.initialmask
160e6769554SRui Paulo(read-only)
161e6769554SRui PauloBitmask of ACPI events before the
162e6769554SRui Paulo.Nm
163e6769554SRui Paulodriver was loaded.
164e6769554SRui Paulo.It Va dev.acpi_ibm.0.availmask
165e6769554SRui Paulo(read-only)
166e6769554SRui PauloBitmask of all supported ACPI events.
167e6769554SRui Paulo.It Va dev.acpi_ibm.0.events
168e6769554SRui PauloEnable ACPI events and set the
169e6769554SRui Paulo.Va eventmask
170e6769554SRui Pauloto
171e6769554SRui Paulo.Va availmask .
172e6769554SRui PauloWithout the
173e6769554SRui Paulo.Nm
174e6769554SRui Paulodriver being loaded, only the Fn+F4 button generates an ACPI event.
175e6769554SRui Paulo.It Va dev.acpi_ibm.0.eventmask
176e6769554SRui PauloSets the ACPI events which are reported to
177e6769554SRui Paulo.Xr devd 8 .
178e6769554SRui PauloFn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless which value
179e6769554SRui Paulo.Va eventmask
180e6769554SRui Paulohas.
181e6769554SRui PauloDepending on the ThinkPad model, the meaning of different bits in the
182e6769554SRui Paulo.Va eventmask
183e6769554SRui Paulomay vary.
184e6769554SRui PauloOn a ThinkPad T41p this is a bitwise OR of the following:
185e6769554SRui Paulo.Pp
186e6769554SRui Paulo.Bl -tag -width indent-two -compact
187e6769554SRui Paulo.It Li 1
188e6769554SRui PauloFn + F1
189e6769554SRui Paulo.It Li 2
190e6769554SRui PauloFn + F2
191e6769554SRui Paulo.It Li 4
192e6769554SRui PauloFn + F3 (LCD backlight)
193e6769554SRui Paulo.It Li 8
194e6769554SRui PauloFn + F4 (Suspend to RAM)
195e6769554SRui Paulo.It Li 16
196e6769554SRui PauloFn + F5 (Bluetooth)
197e6769554SRui Paulo.It Li 32
198e6769554SRui PauloFn + F6
199e6769554SRui Paulo.It Li 64
200e6769554SRui PauloFn + F7 (Screen expand)
201e6769554SRui Paulo.It Li 128
202e6769554SRui PauloFn + F8
203e6769554SRui Paulo.It Li 256
204e6769554SRui PauloFn + F9
205e6769554SRui Paulo.It Li 512
206e6769554SRui PauloFn + F10
207e6769554SRui Paulo.It Li 1024
208e6769554SRui PauloFn + F11
209e6769554SRui Paulo.It Li 2048
210e6769554SRui PauloFn + F12 (Suspend to disk)
211e6769554SRui Paulo.It Li 4096
212e6769554SRui PauloFn + Backspace
213e6769554SRui Paulo.It Li 8192
214e6769554SRui PauloFn + Insert
215e6769554SRui Paulo.It Li 16384
216e6769554SRui PauloFn + Delete
217e6769554SRui Paulo.It Li 32768
218e6769554SRui PauloFn + Home (Brightness up)
219e6769554SRui Paulo.It Li 65536
220e6769554SRui PauloFn + End (Brightness down)
221e6769554SRui Paulo.It Li 131072
222e6769554SRui PauloFn + PageUp (ThinkLight)
223e6769554SRui Paulo.It Li 262144
224e6769554SRui PauloFn + PageDown
225e6769554SRui Paulo.It Li 524288
226e6769554SRui PauloFn + Space (Zoom)
227e6769554SRui Paulo.It Li 1048576
228e6769554SRui PauloVolume Up
229e6769554SRui Paulo.It Li 2097152
230e6769554SRui PauloVolume Down
231e6769554SRui Paulo.It Li 4194304
232e6769554SRui PauloMute
233e6769554SRui Paulo.It Li 8388608
234e6769554SRui PauloAccess IBM Button
235e6769554SRui Paulo.El
236e6769554SRui Paulo.It Va dev.acpi_ibm.0.hotkey
237e6769554SRui Paulo(read-only)
238e6769554SRui PauloStatus of several buttons.
239e6769554SRui PauloEvery time a button is pressed, the respecting bit is toggled.
240e6769554SRui PauloIt is a bitwise OR of the following:
241e6769554SRui Paulo.Pp
242e6769554SRui Paulo.Bl -tag -width indent-two -compact
243e6769554SRui Paulo.It Li 1
244e6769554SRui PauloHome Button
245e6769554SRui Paulo.It Li 2
246e6769554SRui PauloSearch Button
247e6769554SRui Paulo.It Li 4
248e6769554SRui PauloMail Button
249e6769554SRui Paulo.It Li 8
250e6769554SRui PauloAccess IBM Button
251e6769554SRui Paulo.It Li 16
252e6769554SRui PauloZoom
253e6769554SRui Paulo.It Li 32
254e6769554SRui PauloWireless LAN Button
255e6769554SRui Paulo.It Li 64
256e6769554SRui PauloVideo Button
257e6769554SRui Paulo.It Li 128
258e6769554SRui PauloHibernate Button
259e6769554SRui Paulo.It Li 256
260e6769554SRui PauloThinkLight Button
261e6769554SRui Paulo.It Li 512
262e6769554SRui PauloScreen Expand
263e6769554SRui Paulo.It Li 1024
264e6769554SRui PauloBrightness Up/Down Button
265e6769554SRui Paulo.It Li 2048
266e6769554SRui PauloVolume Up/Down/Mute Button
267e6769554SRui Paulo.El
268e6769554SRui Paulo.It Va dev.acpi_ibm.0.lcd_brightness
269e6769554SRui PauloCurrent brightness level of the display.
270e6769554SRui Paulo.It Va dev.acpi_ibm.0.volume
271e6769554SRui PauloSpeaker volume.
272e6769554SRui Paulo.It Va dev.acpi_ibm.0.mute
273e6769554SRui PauloIndicates, whether the speakers are muted or not.
274707347f8SAllan Jude.It Va dev.acpi_ibm.0.mic_mute
275707347f8SAllan JudeIndicates, whether the microphone led (present on some model) is on or not.
276707347f8SAllan JudeNote that this does not mean that the microphone input is muted.
277e6769554SRui Paulo.It Va dev.acpi_ibm.0.thinklight
278e6769554SRui PauloIndicates, whether the ThinkLight keyboard light is activated or not.
279e6769554SRui Paulo.It Va dev.acpi_ibm.0.bluetooth
280e6769554SRui PauloToggle Bluetooth chip activity.
281e6769554SRui Paulo.It Va dev.acpi_ibm.0.wlan
282e6769554SRui Paulo(read-only)
283e6769554SRui PauloIndicates whether the WLAN chip is active or not.
284e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan
285e6769554SRui PauloIndicates whether the fan is in automatic (1) or manual (0) mode.
286e6769554SRui PauloDefault is automatic mode.
287e6769554SRui PauloThis sysctl should be used with extreme precaution, since disabling automatic
288e6769554SRui Paulofan control might overheat the ThinkPad and lead to permanent damage if the
289e6769554SRui Paulo.Va fan_level
290e6769554SRui Paulois not set accordingly.
291e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_level
292e6769554SRui PauloIndicates at what speed the fan should run when being in manual mode.
2939f763f00SMark JohnstonValid values range from 0 (off) to 7 (max) and 8.
294ddf18432SMark JohnstonLevel 8 is used by the driver to set the fan in unthrottled mode.
2959f763f00SMark JohnstonIn this mode, the fan is set to spin freely and will quickly reach a very
2969f763f00SMark Johnstonhigh speed.
2979f763f00SMark JohnstonUse this mode only if absolutely necessary, e.g., if the system has reached its
2989f763f00SMark Johnstoncritical temperature and it is about to shut down.
299e6769554SRui PauloThe resulting speed differs from model to model.
300e6769554SRui PauloOn a T41p this is as follows:
301e6769554SRui Paulo.Pp
302e6769554SRui Paulo.Bl -tag -width indent-two -compact
303e6769554SRui Paulo.It Li 0
304e6769554SRui Paulooff
305e6769554SRui Paulo.It Li 1, 2
306e6769554SRui Paulo~3000 RPM
307e6769554SRui Paulo.It Li 3, 4, 5
308e6769554SRui Paulo~3600 RPM
309e6769554SRui Paulo.It Li 6, 7
310e6769554SRui Paulo~4300 RPM
3119f763f00SMark Johnston.It Li 8
312ddf18432SMark Johnston~6400 RPM (Full-speed, unthrottled)
313e6769554SRui Paulo.El
314e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_speed
315e6769554SRui Paulo(read-only)
316e6769554SRui PauloFan speed in rounds per minute.
317e6769554SRui PauloA few older ThinkPads report the fan speed in levels ranging from 0 (off)
318e6769554SRui Pauloto 7 (max).
319e6769554SRui Paulo.It Va dev.acpi_ibm.0.thermal
320e6769554SRui Paulo(read-only)
321e6769554SRui PauloShows the readings of up to eight different temperature sensors.
322e6769554SRui PauloMost ThinkPads include six or more temperature sensors but
323e6769554SRui Pauloonly expose the CPU temperature through
324e6769554SRui Paulo.Xr acpi_thermal 4 .
325e6769554SRui PauloSome ThinkPads have the below sensor layout which might vary depending on the
326e6769554SRui Paulospecific model:
327e6769554SRui Paulo.Pp
328e6769554SRui Paulo.Bl -enum -compact
329e6769554SRui Paulo.It
330e6769554SRui PauloCPU
331e6769554SRui Paulo.It
332e6769554SRui PauloMini PCI Module
333e6769554SRui Paulo.It
334e6769554SRui PauloHDD
335e6769554SRui Paulo.It
336e6769554SRui PauloGPU
337e6769554SRui Paulo.It
338e6769554SRui PauloBuilt-in battery
339e6769554SRui Paulo.It
340e6769554SRui PauloUltraBay battery
341e6769554SRui Paulo.It
342e6769554SRui PauloBuilt-in battery
343e6769554SRui Paulo.It
344e6769554SRui PauloUltraBay battery
345e6769554SRui Paulo.El
346154be296SMitsuru IWASAKI.It Va dev.acpi_ibm.0.handlerevents
347154be296SMitsuru IWASAKI.Xr devd 8
348154be296SMitsuru IWASAKIevents handled by
349154be296SMitsuru IWASAKI.Nm
350154be296SMitsuru IWASAKIwhen
351154be296SMitsuru IWASAKI.Va events
352154be296SMitsuru IWASAKIis set to 1.
353154be296SMitsuru IWASAKIEvents are specified as a whitespace-separated list of event code in
354154be296SMitsuru IWASAKIhexadecimal or decimal form.
35510b942e5SXin LINote that the event maybe handled twice (e.g., Brightness up/down) if ACPI BIOS
356154be296SMitsuru IWASAKIalready handled the event.
357e6769554SRui Paulo.El
358e6769554SRui Paulo.Pp
359e6769554SRui PauloDefaults for these sysctls can be set in
360e6769554SRui Paulo.Xr sysctl.conf 5 .
361e6769554SRui Paulo.Sh FILES
362e6769554SRui Paulo.Bl -tag -width ".Pa /dev/led/thinklight"
363e6769554SRui Paulo.It Pa /dev/led/thinklight
364e6769554SRui PauloThinkLight
365e6769554SRui Paulo.Xr led 4
366e6769554SRui Paulodevice node
367e6769554SRui Paulo.El
368e6769554SRui Paulo.Sh EXAMPLES
369e6769554SRui PauloThe following can be added to
370e6769554SRui Paulo.Xr devd.conf 5
371e6769554SRui Pauloin order to pass button events to a
372e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
373e6769554SRui Pauloscript:
374e6769554SRui Paulo.Bd -literal -offset indent
375e6769554SRui Paulonotify 10 {
376e6769554SRui Paulo        match "system"          "ACPI";
377e6769554SRui Paulo        match "subsystem"       "IBM";
378e6769554SRui Paulo        action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
379e6769554SRui Paulo};
380e6769554SRui Paulo.Ed
381e6769554SRui Paulo.Pp
382e6769554SRui PauloA possible
383e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
384e6769554SRui Pauloscript might look like:
385e6769554SRui Paulo.Bd -literal -offset indent
386e6769554SRui Paulo#!/bin/sh
387e6769554SRui Paulo#
388e6769554SRui Pauloif [ "$1" = "" -o "$2" = "" ]
389e6769554SRui Paulothen
390e6769554SRui Paulo        echo "usage: $0 notify oem_name"
391e6769554SRui Paulo        exit 1
392e6769554SRui Paulofi
393e6769554SRui PauloNOTIFY=`echo $1`
394e6769554SRui PauloLOGGER="logger"
395e6769554SRui PauloCALC="bc"
396e6769554SRui PauloBC_PRECOMMANDS="scale=2"
397e6769554SRui PauloECHO="echo"
398e6769554SRui PauloCUT="cut"
399e6769554SRui PauloMAX_LCD_BRIGHTNESS=7
400e6769554SRui PauloMAX_VOLUME=14
401e6769554SRui PauloOEM=$2
402e6769554SRui PauloDISPLAY_PIPE=/tmp/acpi_${OEM}_display
403e6769554SRui Paulo
404e6769554SRui Paulocase ${NOTIFY} in
405e6769554SRui Paulo        0x05)
406e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
407e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
408e6769554SRui Paulo                then
409e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=0
410e6769554SRui Paulo                        MESSAGE="bluetooth disabled"
411e6769554SRui Paulo                else
412e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=1
413e6769554SRui Paulo                        MESSAGE="bluetooth enabled"
414e6769554SRui Paulo                fi
415e6769554SRui Paulo                ;;
416e6769554SRui Paulo        0x10|0x11)
417e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
418e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
419e6769554SRui Paulo                         ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
420e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
421e6769554SRui Paulo                MESSAGE="brightness level ${PERCENT}%"
422e6769554SRui Paulo                ;;
423e6769554SRui Paulo        0x12)
424e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
425e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
426e6769554SRui Paulo                then
427e6769554SRui Paulo                        MESSAGE="thinklight enabled"
428e6769554SRui Paulo                else
429e6769554SRui Paulo                        MESSAGE="thinklight disabled"
430e6769554SRui Paulo                fi
431e6769554SRui Paulo                ;;
432e6769554SRui Paulo        0x15|0x16)
433e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
434e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
435e6769554SRui Paulo                        ${LEVEL} / ${MAX_VOLUME} * 100" | \\
436e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
437e6769554SRui Paulo                MESSAGE="volume level ${PERCENT}%"
438e6769554SRui Paulo                ;;
439e6769554SRui Paulo        0x17)
440e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
441e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
442e6769554SRui Paulo                then
443e6769554SRui Paulo                        MESSAGE="volume muted"
444e6769554SRui Paulo                else
445e6769554SRui Paulo                        MESSAGE="volume unmuted"
446e6769554SRui Paulo                fi
447e6769554SRui Paulo                ;;
448707347f8SAllan Jude	0x1b)
449707347f8SAllan Jude		LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
450707347f8SAllan Jude		if [ $LEVEL -eq 0 ]; then
451707347f8SAllan Jude			sysctl dev.acpi_ibm.0.mic_led=1
452e83a53abSMateusz Piotrowski			mixer rec.volume=0
453707347f8SAllan Jude		fi
454707347f8SAllan Jude		if [ $LEVEL -eq 1 ]; then
455707347f8SAllan Jude			sysctl dev.acpi_ibm.0.mic_led=0
456*4014365eSKyle Evans			mixer rec.volume=30%
457707347f8SAllan Jude		fi
458707347f8SAllan Jude		;;
459e6769554SRui Paulo        *)
460e6769554SRui Paulo                ;;
461e6769554SRui Pauloesac
462e6769554SRui Paulo${LOGGER} ${MESSAGE}
463e6769554SRui Pauloif [ -p ${DISPLAY_PIPE} ]
464e6769554SRui Paulothen
465e6769554SRui Paulo        ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
466e6769554SRui Paulofi
467e6769554SRui Pauloexit 0
468e6769554SRui Paulo.Ed
469154be296SMitsuru IWASAKI.Pp
470154be296SMitsuru IWASAKIThe following example specify that event code 0x04 (Suspend to RAM),
471154be296SMitsuru IWASAKI0x10 (Brightness up) and 0x11 (Brightness down) are handled by
472154be296SMitsuru IWASAKI.Nm .
473154be296SMitsuru IWASAKI.Bd -literal -offset indent
474154be296SMitsuru IWASAKIsysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11'
475154be296SMitsuru IWASAKI.Ed
476154be296SMitsuru IWASAKI.Pp
477154be296SMitsuru IWASAKIin
478154be296SMitsuru IWASAKI.Xr sysctl.conf 5 :
479154be296SMitsuru IWASAKI.Bd -literal -offset indent
480154be296SMitsuru IWASAKIdev.acpi_ibm.0.handlerevents=0x04\\ 0x10\\ 0x11
481154be296SMitsuru IWASAKI.Ed
482e6769554SRui Paulo.Sh SEE ALSO
483e6769554SRui Paulo.Xr acpi 4 ,
484e6769554SRui Paulo.Xr led 4 ,
485e6769554SRui Paulo.Xr sysctl.conf 5 ,
486e6769554SRui Paulo.Xr devd 8 ,
487e6769554SRui Paulo.Xr sysctl 8
488e6769554SRui Paulo.Sh HISTORY
489e6769554SRui PauloThe
490e6769554SRui Paulo.Nm
491e6769554SRui Paulodevice driver first appeared in
492e6769554SRui Paulo.Fx 6.0 .
493e6769554SRui Paulo.Sh AUTHORS
494e6769554SRui Paulo.An -nosplit
495e6769554SRui PauloThe
496e6769554SRui Paulo.Nm
497e6769554SRui Paulodriver was written by
4986c899950SBaptiste Daroussin.An Takanori Watanabe Aq Mt takawata@FreeBSD.org
499e6769554SRui Pauloand later mostly rewritten by
5006c899950SBaptiste Daroussin.An Markus Brueffer Aq Mt markus@FreeBSD.org .
501e6769554SRui PauloThis manual page was written by
5026c899950SBaptiste Daroussin.An Christian Brueffer Aq Mt brueffer@FreeBSD.org
503e6769554SRui Pauloand
5046c899950SBaptiste Daroussin.An Markus Brueffer Aq Mt markus@FreeBSD.org .
505