]> 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 r149245,
[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 SYSCTL VARIABLES
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 .Bd -literal -offset indent
70 notify 10 {
71         match "system"          "ACPI";
72         match "subsystem"       "FUJITSU";
73         action "/usr/local/sbin/acpi_oem_exec.sh $notify fujitsu";
74 };
75 .Ed
76 .Pp
77 A possible
78 .Pa /usr/local/sbin/acpi_oem_exec.sh
79 script might look like:
80 .Bd -literal -offset indent
81 #!/bin/sh
82 #
83 if [ "$1" = "" -o "$2" = "" ]
84 then
85         echo "usage: $0 notify oem_name"
86         exit 1
87 fi
88 NOTIFY=`echo $1`
89 LOGGER="logger"
90 CALC="bc"
91 BC_PRECOMMANDS="scale=2"
92 ECHO="echo"
93 CUT="cut"
94 MAX_LCD_BRIGHTNESS=7
95 MAX_VOLUME=16
96 OEM=$2
97 DISPLAY_PIPE=/tmp/acpi_${OEM}_display
98
99 case ${NOTIFY} in
100         0x00)
101                 LEVEL=`sysctl -n hw.acpi.${OEM}.mute`
102                 if [ "$LEVEL" = "1" ]
103                 then
104                         MESSAGE="volume muted"
105                 else
106                         MESSAGE="volume unmuted"
107                 fi
108                 ;;
109         0x01)
110                 LEVEL=`sysctl -n hw.acpi.${OEM}.pointer_enable`
111                 if [ "$LEVEL" = "1" ]
112                 then
113                         MESSAGE="pointer enabled"
114                 else
115                         MESSAGE="pointer disabled"
116                 fi
117                 ;;
118         0x02)
119                 LEVEL=`sysctl -n hw.acpi.${OEM}.lcd_brightness`
120                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
121                          ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\\
122                          ${CALC} | ${CUT} -d . -f 1`
123                 MESSAGE="brightness level ${PERCENT}%"
124                 ;;
125         0x03)
126                 LEVEL=`sysctl -n hw.acpi.${OEM}.volume`
127                 PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \\
128                         ${LEVEL} / ${MAX_VOLUME} * 100" | \\
129                          ${CALC} | ${CUT} -d . -f 1`
130                 MESSAGE="volume level ${PERCENT}%"
131                 ;;
132         *)
133                 ;;
134         esac
135         ${LOGGER} ${MESSAGE}
136         if [ -p ${DISPLAY_PIPE} ]
137         then
138                 ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
139         fi
140 exit 0
141 .Ed
142 .Sh SEE ALSO
143 .Xr acpi 4 ,
144 .Xr sysctl.conf 5 ,
145 .Xr devd 8 ,
146 .Xr sysctl 8
147 .Sh HISTORY
148 The
149 .Nm
150 driver first appeared in
151 .Fx 5.4 .
152 .Sh AUTHORS
153 .An -nosplit
154 The
155 .Nm
156 driver was written by
157 .An Sean Bullington Aq sean@stalker.org ,
158 .An Anish Mistry Aq mistry.7@osu.edu ,
159 and
160 .An Marc Santcroos Aq marks@ripe.net .
161 .Pp
162 This manual page was written by
163 .An Philip Paeps Aq philip@FreeBSD.org .