button-hotplug: Add KEY_POWER handling
authorJohn Crispin <john@openwrt.org>
Thu, 4 Jul 2013 13:31:09 +0000 (13:31 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 4 Jul 2013 13:31:09 +0000 (13:31 +0000)
When running OpenWrt within KVM KEY_POWER is generated from the ACPI
button driver when restarting or powering down the VM.

Extend button-hotplug to allow user space handlers for these events.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Patchwork: http://patchwork.openwrt.org/patch/3799/

SVN-Revision: 37160

package/kernel/button-hotplug/src/button-hotplug.c

index 4a8c4a88ed4e0a91b040c204b2636a919d8bc18d..684a0c6e3dbd39c9e2d994c22c01edccea5ce58a 100644 (file)
@@ -84,6 +84,7 @@ static struct bh_map button_map[] = {
        BH_MAP(BTN_8,           "BTN_8"),
        BH_MAP(BTN_9,           "BTN_9"),
        BH_MAP(KEY_RESTART,     "reset"),
        BH_MAP(BTN_8,           "BTN_8"),
        BH_MAP(BTN_9,           "BTN_9"),
        BH_MAP(KEY_RESTART,     "reset"),
+       BH_MAP(KEY_POWER,       "power"),
 #ifdef KEY_WPS_BUTTON
        BH_MAP(KEY_WPS_BUTTON,  "wps"),
 #endif /* KEY_WPS_BUTTON */
 #ifdef KEY_WPS_BUTTON
        BH_MAP(KEY_WPS_BUTTON,  "wps"),
 #endif /* KEY_WPS_BUTTON */