aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-08-06 19:15:30 -0700
committerguoyin.chen <guoyin.chen@freescale.com>2015-11-10 15:12:47 +0800
commit3efd56a6eb545e84e8d80bada802719db4c105ce (patch)
tree8c4c16319937aeea1d6df5f34253c80a58e6ecee
parent98b6e698f3be3d2d1613eda1bbbbc83ce4547601 (diff)
downloadfreescale-3efd56a6eb545e84e8d80bada802719db4c105ce.tar.gz
Input: do not emit unneeded EV_SYN when suspending
Do not emit EV_SYN/SYN_REPORT on suspend if there were no keys that are still pressed as we are suspending the device (and in all other cases when input core is forcibly releasing keys via input_dev_release_keys() call). Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Conflicts: drivers/input/input.c
-rw-r--r--drivers/input/input.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 29ca0bb4f56..087255a452c 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -667,6 +667,7 @@ 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)) {
@@ -674,9 +675,11 @@ static void input_dev_release_keys(struct input_dev *dev)
if (is_event_supported(code, dev->keybit, KEY_MAX) &&
__test_and_clear_bit(code, dev->key)) {
input_pass_event(dev, EV_KEY, code, 0);
+ need_sync = true;
}
}
- input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
+ if (need_sync)
+ input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
}
}