Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: da9063 - report KEY_POWER instead of KEY_SLEEP during power key-press

Stop reporting KEY_SLEEP for a short key-press and report KEY_POWER instead
This change applies to both DA9063 and DA9062 ONKEY drivers.

A previous application used for testing by the developer required a
KEY_SLEEP and KEY_POWER input_report_key event to distinguish between a
short and long key-press of the power key. This is not the general
convention and the typical solution is for KEY_POWER to be used in both
cases: suspend and S/W power off.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Steve Twiss and committed by
Dmitry Torokhov
f889beaa bcf5b3de

+4 -4
+4 -4
drivers/input/misc/da9063_onkey.c
··· 179 179 input_report_key(onkey->input, KEY_POWER, 1); 180 180 input_sync(onkey->input); 181 181 schedule_delayed_work(&onkey->work, 0); 182 - dev_dbg(onkey->dev, "KEY_POWER pressed.\n"); 182 + dev_dbg(onkey->dev, "KEY_POWER long press.\n"); 183 183 } else { 184 - input_report_key(onkey->input, KEY_SLEEP, 1); 184 + input_report_key(onkey->input, KEY_POWER, 1); 185 185 input_sync(onkey->input); 186 - input_report_key(onkey->input, KEY_SLEEP, 0); 186 + input_report_key(onkey->input, KEY_POWER, 0); 187 187 input_sync(onkey->input); 188 - dev_dbg(onkey->dev, "KEY_SLEEP pressed.\n"); 188 + dev_dbg(onkey->dev, "KEY_POWER short press.\n"); 189 189 } 190 190 191 191 return IRQ_HANDLED;