Commit 5ab17145 authored by Anshul Garg's avatar Anshul Garg Committed by Dmitry Torokhov

Input: small tweak to autorepeat handling

If a device does not support autorepeat or does not emit any key events we
should not be scanning all events in a packet to decide if we should start
or stop autorepeat function.
Signed-off-by: default avatarAnshul Garg <anshul.g@samsung.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 061a5ad7
...@@ -152,6 +152,7 @@ static void input_pass_values(struct input_dev *dev, ...@@ -152,6 +152,7 @@ static void input_pass_values(struct input_dev *dev,
add_input_randomness(vals->type, vals->code, vals->value); add_input_randomness(vals->type, vals->code, vals->value);
/* trigger auto repeat for key events */ /* trigger auto repeat for key events */
if (test_bit(EV_REP, dev->evbit) && test_bit(EV_KEY, dev->evbit)) {
for (v = vals; v != vals + count; v++) { for (v = vals; v != vals + count; v++) {
if (v->type == EV_KEY && v->value != 2) { if (v->type == EV_KEY && v->value != 2) {
if (v->value) if (v->value)
...@@ -160,6 +161,7 @@ static void input_pass_values(struct input_dev *dev, ...@@ -160,6 +161,7 @@ static void input_pass_values(struct input_dev *dev,
input_stop_autorepeat(dev); input_stop_autorepeat(dev);
} }
} }
}
} }
static void input_pass_event(struct input_dev *dev, static void input_pass_event(struct input_dev *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment