forked from rubenslte/android_kernel_samsung_msm8226
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. Signed-off-by: Kun Liang <kunliang@codeaurora.org>
This commit is contained in:
@@ -1574,9 +1574,11 @@ 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.
|
||||
*/
|
||||
spin_lock_irq(&dev->event_lock);
|
||||
input_dev_release_keys(dev);
|
||||
spin_unlock_irq(&dev->event_lock);
|
||||
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);
|
||||
|
||||
@@ -167,6 +167,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)
|
||||
|
||||
Reference in New Issue
Block a user