aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorAnshul Garg <aksgarg1989@gmail.com>2015-01-08 16:41:24 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-01-08 16:53:30 -0500
commit5ab17145708e6ad4582b0372fb3a171be3379293 (patch)
tree639fb4778d8cb9d917a6061a4587c7234b0adf9b /drivers/input/input.c
parent061a5ad7c9b938fd730672b21347b69896a27973 (diff)
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: Anshul Garg <anshul.g@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 213e3a1903ee..26199abee36c 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -152,12 +152,14 @@ static void input_pass_values(struct input_dev *dev,
152 add_input_randomness(vals->type, vals->code, vals->value); 152 add_input_randomness(vals->type, vals->code, vals->value);
153 153
154 /* trigger auto repeat for key events */ 154 /* trigger auto repeat for key events */
155 for (v = vals; v != vals + count; v++) { 155 if (test_bit(EV_REP, dev->evbit) && test_bit(EV_KEY, dev->evbit)) {
156 if (v->type == EV_KEY && v->value != 2) { 156 for (v = vals; v != vals + count; v++) {
157 if (v->value) 157 if (v->type == EV_KEY && v->value != 2) {
158 input_start_autorepeat(dev, v->code); 158 if (v->value)
159 else 159 input_start_autorepeat(dev, v->code);
160 input_stop_autorepeat(dev); 160 else
161 input_stop_autorepeat(dev);
162 }
161 } 163 }
162 } 164 }
163} 165}