diff options
author | Ting Li <ting.li@intel.com> | 2015-07-23 18:05:29 +0800 |
---|---|---|
committer | Mihai Serban <mihai.serban@intel.com> | 2016-01-07 17:54:56 +0200 |
commit | ce337d33d0dd47b5ea0e40007c4678c22bf3dd67 (patch) | |
tree | 42921dae79eec00467e4dcb912900b6c4d69f946 | |
parent | f8e0a2dfd11c8b17bd7e6215c6a42c7bce29eb08 (diff) | |
download | minnowboard-v3.14-ce337d33d0dd47b5ea0e40007c4678c22bf3dd67.tar.gz |
input: only send a syn event when needed in input_dev_release_keys
On input_dev_release_keys, even if there is no key need to release,
it still send a spurious SYN evnet.
In this case, if user poll the event device with EPOLLWAKEUP enable,
there will always be wakeup event to stop system enter suspend
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-105
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-78
Change-Id: I2210491f2e89992debcf40ae7b2b60f2e0060b58
Signed-off-by: Ting Li <ting.li@intel.com>
-rw-r--r-- | drivers/input/input.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 29ca0bb4f56..ebf58cfbf1a 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -668,15 +668,18 @@ EXPORT_SYMBOL(input_close_device); static void input_dev_release_keys(struct input_dev *dev) { int code; + bool need_sync = false; if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) { for (code = 0; code <= KEY_MAX; code++) { 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); } } |