aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Swanson <reiver@improbability.net>2019-05-29 11:36:12 +0100
committerPetr Štetiar <ynezz@true.cz>2019-05-30 11:55:50 +0200
commita46259787d019eac7abc9be6711381159785b536 (patch)
tree4c77775b3f2dbe66f80c238e9214b2d53e3c9f42
parent70c7a0c33e3789fcc13b868bd41ffbd59ea999f1 (diff)
downloadupstream-a46259787d019eac7abc9be6711381159785b536.tar.gz
upstream-a46259787d019eac7abc9be6711381159785b536.tar.bz2
upstream-a46259787d019eac7abc9be6711381159785b536.zip
button-hotplug: add KEY_POWER2 handling
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 <reiver@improbability.net> Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
-rw-r--r--package/kernel/button-hotplug/src/button-hotplug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/package/kernel/button-hotplug/src/button-hotplug.c b/package/kernel/button-hotplug/src/button-hotplug.c
index 5294a9700d..1b77cd7922 100644
--- a/package/kernel/button-hotplug/src/button-hotplug.c
+++ b/package/kernel/button-hotplug/src/button-hotplug.c
@@ -85,6 +85,7 @@ static struct bh_map button_map[] = {
BH_MAP(BTN_9, "BTN_9"),
BH_MAP(KEY_RESTART, "reset"),
BH_MAP(KEY_POWER, "power"),
+ BH_MAP(KEY_POWER2, "reboot"),
BH_MAP(KEY_RFKILL, "rfkill"),
BH_MAP(KEY_WPS_BUTTON, "wps"),
BH_MAP(KEY_WIMAX, "wwan"),