|
NAMEacpi_ibm —
ThinkPad ACPI extras driver
SYNOPSISTo compile this driver into the kernel, place the following line in your kernel configuration file:device acpi_ibm Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): acpi_ibm_load="YES" DESCRIPTIONTheacpi_ibm driver provides support for hotkeys and
other components of ThinkPad laptops. The main purpose of this driver is to
provide an interface, accessible via
sysctl(8)
and
devd(8),
through which applications can determine the status of various laptop
components.
While the sysctl(8) interface is enabled automatically after loading the driver, the devd(8) interface has to be enabled explicitly, as it may alter the default action of certain keys. This is done by setting the events sysctl as described below. Specifying which keys should generate events is done by setting a bitmask, whereas each bit represents one key or key combination. This bitmask, accessible via the eventmask sysctl, is set to availmask by default, a value representing all possible keypress events on the specific ThinkPad model. devd(8) EventsHotkey events received by devd(8) provide the following information:
Depending on the ThinkPad model, event codes may vary. On a ThinkPad T41p these are as follows:
led(4) InterfaceTheacpi_ibm driver provides a
led(4)
interface for the ThinkLight. The ThinkLight can be made to blink by writing
ASCII strings to the /dev/led/thinklight device.
SYSCTL VARIABLESThe following sysctls are currently implemented:
Defaults for these sysctls can be set in sysctl.conf(5). FILES
EXAMPLESThe following can be added to devd.conf(5) in order to pass button events to a /usr/local/sbin/acpi_oem_exec.sh script:notify 10 { match "system" "ACPI"; match "subsystem" "IBM"; action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm"; }; A possible /usr/local/sbin/acpi_oem_exec.sh script might look like: #!/bin/sh # if [ "$1" = "" -o "$2" = "" ] then echo "usage: $0 notify oem_name" exit 1 fi NOTIFY=`echo $1` LOGGER="logger" CALC="bc" BC_PRECOMMANDS="scale=2" ECHO="echo" CUT="cut" MAX_LCD_BRIGHTNESS=7 MAX_VOLUME=14 OEM=$2 DISPLAY_PIPE=/tmp/acpi_${OEM}_display case ${NOTIFY} in 0x05) LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth` if [ "$LEVEL" = "1" ] then sysctl dev.acpi_${OEM}.0.bluetooth=0 MESSAGE="bluetooth disabled" else sysctl dev.acpi_${OEM}.0.bluetooth=1 MESSAGE="bluetooth enabled" fi ;; 0x10|0x11) LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness` PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \ ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\ ${CALC} | ${CUT} -d . -f 1` MESSAGE="brightness level ${PERCENT}%" ;; 0x12) LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight` if [ "$LEVEL" = "1" ] then MESSAGE="thinklight enabled" else MESSAGE="thinklight disabled" fi ;; 0x15|0x16) LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume` PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \ ${LEVEL} / ${MAX_VOLUME} * 100" | \ ${CALC} | ${CUT} -d . -f 1` MESSAGE="volume level ${PERCENT}%" ;; 0x17) LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute` if [ "$LEVEL" = "1" ] then MESSAGE="volume muted" else MESSAGE="volume unmuted" fi ;; 0x1b) LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led` if [ $LEVEL -eq 0 ]; then sysctl dev.acpi_ibm.0.mic_led=1 mixer rec 0 fi if [ $LEVEL -eq 1 ]; then sysctl dev.acpi_ibm.0.mic_led=0 mixer rec 30 fi ;; *) ;; esac ${LOGGER} ${MESSAGE} if [ -p ${DISPLAY_PIPE} ] then ${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} & fi exit 0 The following example specify that event code 0x04 (Suspend to
RAM), 0x10 (Brightness up) and 0x11 (Brightness down) are handled by
sysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11' in sysctl.conf(5): dev.acpi_ibm.0.handlerevents=0x04\ 0x10\ 0x11 SEE ALSOacpi(4), led(4), sysctl.conf(5), devd(8), sysctl(8)HISTORYTheacpi_ibm device driver first appeared in
FreeBSD 6.0.
AUTHORSTheacpi_ibm driver was written by
Takanori Watanabe
<takawata@FreeBSD.org>
and later mostly rewritten by Markus Brueffer
<markus@FreeBSD.org>.
This manual page was written by Christian Brueffer
<brueffer@FreeBSD.org>
and Markus Brueffer
<markus@FreeBSD.org>.
Visit the GSP FreeBSD Man Page Interface. |