fefb606912
This adds a way to handle physical events like keypad slide switch, screen lock, camera lid, and others. This uses acpid from busybox (I was wrong about the real acpid package), and anl acpi.map file to map events to 'scripts'. The scripts are symlinked to /etc/acpi/handler.sh, automatically by the new post-install script, where they are handled based on which script was called. This allows for easily adding whatever is necessary for #178. If this PR is merged, I will create a new wiki page detailing how others can use this framework on other devices. There's an issue with Busybox's acpid, where it is unable to detect new devices added after the daemon loads. This is the case on the N900, where openrc starts acpid well before the kernel is done modprobing drivers (e.g. gpio_keys), so it's necessary to restart the acpid daemon after some time to 'load' the new devices.
84 lines
1.5 KiB
Bash
Executable file
84 lines
1.5 KiB
Bash
Executable file
#!/bin/ash
|
|
|
|
cmd=$( echo $0 | awk '{i=split($0,a,"/"); print a[i]}' )
|
|
|
|
function adjust_keypad_bl {
|
|
for i in $(seq 1 6); do
|
|
echo $1 > /sys/class/leds/lp5523\:kb$i/brightness
|
|
done
|
|
}
|
|
|
|
|
|
|
|
|
|
case $cmd in
|
|
KP_SLIDE_OPEN)
|
|
adjust_keypad_bl 255
|
|
;;
|
|
KP_SLIDE_CLOSE)
|
|
adjust_keypad_bl 0
|
|
;;
|
|
CAM_BTN_DWN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
CAM_BTN_UP)
|
|
echo "Not implemented yet"
|
|
;;
|
|
CAM_FOCUS_DWN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
CAM_FOCUS_UP)
|
|
echo "Not implemented yet"
|
|
;;
|
|
CAM_LID_CLOSE)
|
|
echo "Not implemented yet"
|
|
;;
|
|
CAM_LID_OPEN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
FRNT_PRXY_OFF)
|
|
echo "Not implemented yet"
|
|
;;
|
|
FRNT_PRXY_ON)
|
|
echo "Not implemented yet"
|
|
;;
|
|
KP_SLIDE_CLOSE)
|
|
echo "Not implemented yet"
|
|
;;
|
|
KP_SLIDE_OPEN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
SCRNLCK_DWN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
SCRNLCK_UP)
|
|
echo "Not implemented yet"
|
|
;;
|
|
HEADPHONE_INSERT)
|
|
echo "Not implemented yet"
|
|
;;
|
|
MICROPHONE_INSERT)
|
|
echo "Not implemented yet"
|
|
;;
|
|
PWR_BTN_DWN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
PWR_BTN_UP)
|
|
echo "Not implemented yet"
|
|
;;
|
|
VIDEOOUT_INSERT)
|
|
echo "Not implemented yet"
|
|
;;
|
|
VOL_DWN)
|
|
echo "Not implemented yet"
|
|
;;
|
|
VOL_UP)
|
|
echo "Not implemented yet"
|
|
;;
|
|
*)
|
|
echo "Unknown event"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
|