From 5422fed7875a44b0dfd90685c5826f3e28a119f7 Mon Sep 17 00:00:00 2001 From: Alan Swanson Date: Wed, 29 May 2019 11:39:30 +0100 Subject: [PATCH] gpio-button-hotplug: add KEY_POWER2 handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For devices such as BTHOMEHUBV5A with both reset and restart buttons, its easily accessible restart button has been assigned to KEY_POWER power script to poweroff preventing accidental (or malicious) factory resets by KEY_RESTART reset script. However an easily accessible button immediately powering off the device is also undesirable. As KEY_RESTART is already used for reset script (and there's no KEY_REBOOT in Linux input events), use KEY_POWER2 for rebooting via new reboot script with 5 second seen delay. Fixes: FS#1965 Signed-off-by: Alan Swanson Signed-off-by: Petr Å tetiar [long line wrap] --- package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 1aef23e876..8e0a21a80b 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -100,6 +100,7 @@ static struct bh_map button_map[] = { BH_MAP(KEY_LIGHTS_TOGGLE, "lights_toggle"), BH_MAP(KEY_PHONE, "phone"), BH_MAP(KEY_POWER, "power"), + BH_MAP(KEY_POWER2, "reboot"), BH_MAP(KEY_RESTART, "reset"), BH_MAP(KEY_RFKILL, "rfkill"), BH_MAP(KEY_VIDEO, "video"), -- 2.30.2