Skip to content

Commit f889bea

Browse files
Steve Twissdtor
authored andcommitted
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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent bcf5b3d commit f889bea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/misc/da9063_onkey.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ static irqreturn_t da9063_onkey_irq_handler(int irq, void *data)
179179
input_report_key(onkey->input, KEY_POWER, 1);
180180
input_sync(onkey->input);
181181
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");
183183
} else {
184-
input_report_key(onkey->input, KEY_SLEEP, 1);
184+
input_report_key(onkey->input, KEY_POWER, 1);
185185
input_sync(onkey->input);
186-
input_report_key(onkey->input, KEY_SLEEP, 0);
186+
input_report_key(onkey->input, KEY_POWER, 0);
187187
input_sync(onkey->input);
188-
dev_dbg(onkey->dev, "KEY_SLEEP pressed.\n");
188+
dev_dbg(onkey->dev, "KEY_POWER short press.\n");
189189
}
190190

191191
return IRQ_HANDLED;

0 commit comments

Comments
 (0)