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