]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/input/input.c
Input: elants_i2c - enable asynchronous probing
[karo-tx-linux.git] / drivers / input / input.c
index 78d24990a816c10e6312108a316e61ddb8e164b9..5391abd28b2799c6776cf1bc8a398f70ed8382d7 100644 (file)
@@ -674,13 +674,19 @@ EXPORT_SYMBOL(input_close_device);
  */
 static void input_dev_release_keys(struct input_dev *dev)
 {
+       bool need_sync = false;
        int code;
 
        if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) {
-               for_each_set_bit(code, dev->key, KEY_CNT)
+               for_each_set_bit(code, dev->key, KEY_CNT) {
                        input_pass_event(dev, EV_KEY, code, 0);
+                       need_sync = true;
+               }
+
+               if (need_sync)
+                       input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
+
                memset(dev->key, 0, sizeof(dev->key));
-               input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
        }
 }