Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9283a1b2 authored by Kun Liang's avatar Kun Liang
Browse files

input: don't send dummy release event when system resumes



Dummy release event is sent when system resumes. This behavior
makes long press detection failed for some keys like POWER key
and HEADSET key. Add INPUT_PROP_NO_DUMMY_RELEASE to make it is
possible for some input to avoid this behavior.

Need add set_bit(INPUT_PROP_NO_DUMMY_RELEASE,inputdevice->propbit)
in specific drivers that don't want the DUMMY release event.

Change-Id: I30ba5045273aca9a4613b7f6dcdcf7a7173b5c27
Signed-off-by: default avatarKun Liang <kunliang@codeaurora.org>
parent 59cf2db6
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1662,10 +1662,12 @@ void input_reset_device(struct input_dev *dev)
		 * Keys that have been pressed at suspend time are unlikely
		 * to be still pressed when we resume.
		 */
		if (!test_bit(INPUT_PROP_NO_DUMMY_RELEASE, dev->propbit)) {
			spin_lock_irq(&dev->event_lock);
			input_dev_release_keys(dev);
			spin_unlock_irq(&dev->event_lock);
		}
	}

	mutex_unlock(&dev->mutex);
}
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ struct input_keymap_entry {
#define INPUT_PROP_DIRECT		0x01	/* direct input devices */
#define INPUT_PROP_BUTTONPAD		0x02	/* has button(s) under pad */
#define INPUT_PROP_SEMI_MT		0x03	/* touch rectangle only */
#define INPUT_PROP_NO_DUMMY_RELEASE	0x04	/* no dummy event */

#define INPUT_PROP_MAX			0x1f
#define INPUT_PROP_CNT			(INPUT_PROP_MAX + 1)