xref: /freebsd/share/man/man4/acpi_ibm.4 (revision 154be29631bf4ae8293e6d196ece43b902ee8450)
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.\"
28*154be296SMitsuru IWASAKI.Dd June 24, 2012
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.
77e6769554SRui Paulo.Ss Xr devd 8 Ss 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
147e6769554SRui Paulo.Ss Xr led 4 Ss 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.
276e6769554SRui Paulo.It Va dev.acpi_ibm.0.thinklight
277e6769554SRui PauloIndicates, whether the ThinkLight keyboard light is activated or not.
278e6769554SRui Paulo.It Va dev.acpi_ibm.0.bluetooth
279e6769554SRui PauloToggle Bluetooth chip activity.
280e6769554SRui Paulo.It Va dev.acpi_ibm.0.wlan
281e6769554SRui Paulo(read-only)
282e6769554SRui PauloIndicates whether the WLAN chip is active or not.
283e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan
284e6769554SRui PauloIndicates whether the fan is in automatic (1) or manual (0) mode.
285e6769554SRui PauloDefault is automatic mode.
286e6769554SRui PauloThis sysctl should be used with extreme precaution, since disabling automatic
287e6769554SRui Paulofan control might overheat the ThinkPad and lead to permanent damage if the
288e6769554SRui Paulo.Va fan_level
289e6769554SRui Paulois not set accordingly.
290e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_level
291e6769554SRui PauloIndicates at what speed the fan should run when being in manual mode.
292e6769554SRui PauloValues are ranging from 0 (off) to 7 (max).
293e6769554SRui PauloThe resulting speed differs from model to model.
294e6769554SRui PauloOn a T41p this is as follows:
295e6769554SRui Paulo.Pp
296e6769554SRui Paulo.Bl -tag -width indent-two -compact
297e6769554SRui Paulo.It Li 0
298e6769554SRui Paulooff
299e6769554SRui Paulo.It Li 1, 2
300e6769554SRui Paulo~3000 RPM
301e6769554SRui Paulo.It Li 3, 4, 5
302e6769554SRui Paulo~3600 RPM
303e6769554SRui Paulo.It Li 6, 7
304e6769554SRui Paulo~4300 RPM
305e6769554SRui Paulo.El
306e6769554SRui Paulo.It Va dev.acpi_ibm.0.fan_speed
307e6769554SRui Paulo(read-only)
308e6769554SRui PauloFan speed in rounds per minute.
309e6769554SRui PauloA few older ThinkPads report the fan speed in levels ranging from 0 (off)
310e6769554SRui Pauloto 7 (max).
311e6769554SRui Paulo.It Va dev.acpi_ibm.0.thermal
312e6769554SRui Paulo(read-only)
313e6769554SRui PauloShows the readings of up to eight different temperature sensors.
314e6769554SRui PauloMost ThinkPads include six or more temperature sensors but
315e6769554SRui Pauloonly expose the CPU temperature through
316e6769554SRui Paulo.Xr acpi_thermal 4 .
317e6769554SRui PauloSome ThinkPads have the below sensor layout which might vary depending on the
318e6769554SRui Paulospecific model:
319e6769554SRui Paulo.Pp
320e6769554SRui Paulo.Bl -enum -compact
321e6769554SRui Paulo.It
322e6769554SRui PauloCPU
323e6769554SRui Paulo.It
324e6769554SRui PauloMini PCI Module
325e6769554SRui Paulo.It
326e6769554SRui PauloHDD
327e6769554SRui Paulo.It
328e6769554SRui PauloGPU
329e6769554SRui Paulo.It
330e6769554SRui PauloBuilt-in battery
331e6769554SRui Paulo.It
332e6769554SRui PauloUltraBay battery
333e6769554SRui Paulo.It
334e6769554SRui PauloBuilt-in battery
335e6769554SRui Paulo.It
336e6769554SRui PauloUltraBay battery
337e6769554SRui Paulo.El
338*154be296SMitsuru IWASAKI.It Va dev.acpi_ibm.0.handlerevents
339*154be296SMitsuru IWASAKI.Xr devd 8
340*154be296SMitsuru IWASAKIevents handled by
341*154be296SMitsuru IWASAKI.Nm
342*154be296SMitsuru IWASAKIwhen
343*154be296SMitsuru IWASAKI.Va events
344*154be296SMitsuru IWASAKIis set to 1.
345*154be296SMitsuru IWASAKIEvents are specified as a whitespace-separated list of event code in
346*154be296SMitsuru IWASAKIhexadecimal or decimal form.
347*154be296SMitsuru IWASAKINote that the event maybe handled twice (eg. Brightness up/down) if ACPI BIOS
348*154be296SMitsuru IWASAKIalready handled the event.
349e6769554SRui Paulo.El
350e6769554SRui Paulo.Pp
351e6769554SRui PauloDefaults for these sysctls can be set in
352e6769554SRui Paulo.Xr sysctl.conf 5 .
353e6769554SRui Paulo.Sh FILES
354e6769554SRui Paulo.Bl -tag -width ".Pa /dev/led/thinklight"
355e6769554SRui Paulo.It Pa /dev/led/thinklight
356e6769554SRui PauloThinkLight
357e6769554SRui Paulo.Xr led 4
358e6769554SRui Paulodevice node
359e6769554SRui Paulo.El
360e6769554SRui Paulo.Sh EXAMPLES
361e6769554SRui PauloThe following can be added to
362e6769554SRui Paulo.Xr devd.conf 5
363e6769554SRui Pauloin order to pass button events to a
364e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
365e6769554SRui Pauloscript:
366e6769554SRui Paulo.Bd -literal -offset indent
367e6769554SRui Paulonotify 10 {
368e6769554SRui Paulo        match "system"          "ACPI";
369e6769554SRui Paulo        match "subsystem"       "IBM";
370e6769554SRui Paulo        action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
371e6769554SRui Paulo};
372e6769554SRui Paulo.Ed
373e6769554SRui Paulo.Pp
374e6769554SRui PauloA possible
375e6769554SRui Paulo.Pa /usr/local/sbin/acpi_oem_exec.sh
376e6769554SRui Pauloscript might look like:
377e6769554SRui Paulo.Bd -literal -offset indent
378e6769554SRui Paulo#!/bin/sh
379e6769554SRui Paulo#
380e6769554SRui Pauloif [ "$1" = "" -o "$2" = "" ]
381e6769554SRui Paulothen
382e6769554SRui Paulo        echo "usage: $0 notify oem_name"
383e6769554SRui Paulo        exit 1
384e6769554SRui Paulofi
385e6769554SRui PauloNOTIFY=`echo $1`
386e6769554SRui PauloLOGGER="logger"
387e6769554SRui PauloCALC="bc"
388e6769554SRui PauloBC_PRECOMMANDS="scale=2"
389e6769554SRui PauloECHO="echo"
390e6769554SRui PauloCUT="cut"
391e6769554SRui PauloMAX_LCD_BRIGHTNESS=7
392e6769554SRui PauloMAX_VOLUME=14
393e6769554SRui PauloOEM=$2
394e6769554SRui PauloDISPLAY_PIPE=/tmp/acpi_${OEM}_display
395e6769554SRui Paulo
396e6769554SRui Paulocase ${NOTIFY} in
397e6769554SRui Paulo        0x05)
398e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
399e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
400e6769554SRui Paulo                then
401e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=0
402e6769554SRui Paulo                        MESSAGE="bluetooth disabled"
403e6769554SRui Paulo                else
404e6769554SRui Paulo                        sysctl dev.acpi_${OEM}.0.bluetooth=1
405e6769554SRui Paulo                        MESSAGE="bluetooth enabled"
406e6769554SRui Paulo                fi
407e6769554SRui Paulo                ;;
408e6769554SRui Paulo        0x10|0x11)
409e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
410e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
411e6769554SRui Paulo                         ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
412e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
413e6769554SRui Paulo                MESSAGE="brightness level ${PERCENT}%"
414e6769554SRui Paulo                ;;
415e6769554SRui Paulo        0x12)
416e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
417e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
418e6769554SRui Paulo                then
419e6769554SRui Paulo                        MESSAGE="thinklight enabled"
420e6769554SRui Paulo                else
421e6769554SRui Paulo                        MESSAGE="thinklight disabled"
422e6769554SRui Paulo                fi
423e6769554SRui Paulo                ;;
424e6769554SRui Paulo        0x15|0x16)
425e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
426e6769554SRui Paulo                PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
427e6769554SRui Paulo                        ${LEVEL} / ${MAX_VOLUME} * 100" | \\
428e6769554SRui Paulo                         ${CALC} | ${CUT} -d . -f 1`
429e6769554SRui Paulo                MESSAGE="volume level ${PERCENT}%"
430e6769554SRui Paulo                ;;
431e6769554SRui Paulo        0x17)
432e6769554SRui Paulo                LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
433e6769554SRui Paulo                if [ "$LEVEL" = "1" ]
434e6769554SRui Paulo                then
435e6769554SRui Paulo                        MESSAGE="volume muted"
436e6769554SRui Paulo                else
437e6769554SRui Paulo                        MESSAGE="volume unmuted"
438e6769554SRui Paulo                fi
439e6769554SRui Paulo                ;;
440e6769554SRui Paulo        *)
441e6769554SRui Paulo                ;;
442e6769554SRui Pauloesac
443e6769554SRui Paulo${LOGGER} ${MESSAGE}
444e6769554SRui Pauloif [ -p ${DISPLAY_PIPE} ]
445e6769554SRui Paulothen
446e6769554SRui Paulo        ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
447e6769554SRui Paulofi
448e6769554SRui Pauloexit 0
449e6769554SRui Paulo.Ed
450*154be296SMitsuru IWASAKI.Pp
451*154be296SMitsuru IWASAKIThe following example specify that event code 0x04 (Suspend to RAM),
452*154be296SMitsuru IWASAKI0x10 (Brightness up) and 0x11 (Brightness down) are handled by
453*154be296SMitsuru IWASAKI.Nm .
454*154be296SMitsuru IWASAKI.Bd -literal -offset indent
455*154be296SMitsuru IWASAKIsysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11'
456*154be296SMitsuru IWASAKI.Ed
457*154be296SMitsuru IWASAKI.Pp
458*154be296SMitsuru IWASAKIin
459*154be296SMitsuru IWASAKI.Xr sysctl.conf 5 :
460*154be296SMitsuru IWASAKI.Bd -literal -offset indent
461*154be296SMitsuru IWASAKIdev.acpi_ibm.0.handlerevents=0x04\\ 0x10\\ 0x11
462*154be296SMitsuru IWASAKI.Ed
463*154be296SMitsuru IWASAKI.Pp
464e6769554SRui Paulo.Sh SEE ALSO
465e6769554SRui Paulo.Xr acpi 4 ,
466e6769554SRui Paulo.Xr led 4 ,
467e6769554SRui Paulo.Xr sysctl.conf 5 ,
468e6769554SRui Paulo.Xr devd 8 ,
469e6769554SRui Paulo.Xr sysctl 8
470e6769554SRui Paulo.Sh HISTORY
471e6769554SRui PauloThe
472e6769554SRui Paulo.Nm
473e6769554SRui Paulodevice driver first appeared in
474e6769554SRui Paulo.Fx 6.0 .
475e6769554SRui Paulo.Sh AUTHORS
476e6769554SRui Paulo.An -nosplit
477e6769554SRui PauloThe
478e6769554SRui Paulo.Nm
479e6769554SRui Paulodriver was written by
480e6769554SRui Paulo.An Takanori Watanabe Aq takawata@FreeBSD.org
481e6769554SRui Pauloand later mostly rewritten by
482e6769554SRui Paulo.An Markus Brueffer Aq markus@FreeBSD.org .
483e6769554SRui PauloThis manual page was written by
484e6769554SRui Paulo.An Christian Brueffer Aq brueffer@FreeBSD.org
485e6769554SRui Pauloand
486e6769554SRui Paulo.An Markus Brueffer Aq markus@FreeBSD.org .
487