Remove the meteor(4) driver.
[dragonfly.git] / share / man / man4 / acpi_fujitsu.4
1 .\"
2 .\" Copyright (c) 2005 Philip Paeps <philip@FreeBSD.org>
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: src/share/man/man4/acpi_fujitsu.4,v 1.1 2008/08/21 00:40:55 rpaulo Exp $
27 .\"
28 .Dd November 11, 2009
29 .Dt ACPI_FUJITSU 4
30 .Os
31 .Sh NAME
32 .Nm acpi_fujitsu
33 .Nd Fujitsu Laptop Extras
34 .Sh SYNOPSIS
35 To compile this driver into the kernel,
36 place the following line in your
37 kernel configuration file:
38 .Bd -ragged -offset indent
39 .Cd "device acpi_fujitsu"
40 .Ed
41 .Pp
42 Alternatively, to load the driver as a
43 module at boot time, place the following line in
44 .Xr loader.conf 5 :
45 .Bd -literal -offset indent
46 acpi_fujitsu_load="YES"
47 .Ed
48 .Sh DESCRIPTION
49 The
50 .Nm
51 driver enables the ACPI-controlled buttons on Fujitsu notebooks.
52 The button events are sent to userspace via
53 .Xr devd 8 ,
54 and a
55 .Xr sysctl 8
56 interface is provided to simulate the hardware events.
57 .Pp
58 Using this driver, one can control the brightness of the display, the volume
59 of the speakers, and the internal (eraserhead) mouse pointer.
60 .Sh SYSCTL VARIABLES
61 These sysctls are currently implemented:
62 .Bl -tag -width indent
63 .It Va hw.acpi.fujitsu.lcd_brightness
64 Makes the LCD backlight brighter or dimmer.
65 .It Va hw.acpi.fujitsu.pointer_enable
66 Enables or disables the internal mouse pointer.
67 .It Va hw.acpi.fujitsu.volume
68 Controls the speaker volume.
69 .It Va hw.acpi.fujitsu.mute
70 Mutes the speakers.
71 .El
72 .Pp
73 Defaults for these sysctls can be set in
74 .Xr sysctl.conf 5 .
75 .Sh EXAMPLES
76 The following can be added to
77 .Xr devd.conf 5
78 in order to pass button events to a
79 .Pa /usr/local/sbin/acpi_oem_exec.sh
80 script:
81 .Bd -literal -offset indent
82 notify 10 {
83         match "system"          "ACPI";
84         match "subsystem"       "FUJITSU";
85         action "/usr/local/sbin/acpi_oem_exec.sh $notify fujitsu";
86 };
87 .Ed
88 .Pp
89 A possible
90 .Pa /usr/local/sbin/acpi_oem_exec.sh
91 script might look like:
92 .Bd -literal -offset indent
93 #!/bin/sh
94 #
95 if [ "$1" = "" -o "$2" = "" ]
96 then
97         echo "usage: $0 notify oem_name"
98         exit 1
99 fi
100 NOTIFY=`echo $1`
101 LOGGER="logger"
102 CALC="bc"
103 BC_PRECOMMANDS="scale=2"
104 ECHO="echo"
105 CUT="cut"
106 MAX_LCD_BRIGHTNESS=7
107 MAX_VOLUME=16
108 OEM=$2
109 DISPLAY_PIPE=/tmp/acpi_${OEM}_display
110
111 case ${NOTIFY} in
112         0x00)
113                 LEVEL=`sysctl -n hw.acpi.${OEM}.mute`
114                 if [ "$LEVEL" = "1" ]
115                 then
116                         MESSAGE="volume muted"
117                 else
118                         MESSAGE="volume unmuted"
119                 fi
120                 ;;
121         0x01)
122                 LEVEL=`sysctl -n hw.acpi.${OEM}.pointer_enable`
123                 if [ "$LEVEL" = "1" ]
124                 then
125                         MESSAGE="pointer enabled"
126                 else
127                         MESSAGE="pointer disabled"
128                 fi
129                 ;;
130         0x02)
131                 LEVEL=`sysctl -n hw.acpi.${OEM}.lcd_brightness`
132                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
133                          ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
134                          ${CALC} | ${CUT} -d . -f 1`
135                 MESSAGE="brightness level ${PERCENT}%"
136                 ;;
137         0x03)
138                 LEVEL=`sysctl -n hw.acpi.${OEM}.volume`
139                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
140                         ${LEVEL} / ${MAX_VOLUME} * 100" | \\
141                          ${CALC} | ${CUT} -d . -f 1`
142                 MESSAGE="volume level ${PERCENT}%"
143                 ;;
144         *)
145                 ;;
146         esac
147         ${LOGGER} ${MESSAGE}
148         if [ -p ${DISPLAY_PIPE} ]
149         then
150                 ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
151         fi
152 exit 0
153 .Ed
154 .Sh SEE ALSO
155 .Xr acpi 4 ,
156 .Xr sysctl.conf 5 ,
157 .Xr devd 8 ,
158 .Xr sysctl 8
159 .Sh HISTORY
160 The
161 .Nm
162 driver first appeared in
163 .Fx 5.4 .
164 It was then ported to
165 .Dx 2.5 .
166 .Sh AUTHORS
167 .An -nosplit
168 The
169 .Nm
170 driver was written by
171 .An Sean Bullington Aq shegget@gmail.com ,
172 .An Anish Mistry Aq mistry.7@osu.edu ,
173 and
174 .An Marc Santcroos Aq marks@ripe.net .
175 .Pp
176 This manual page was written by
177 .An Philip Paeps Aq philip@FreeBSD.org .