diff options
author | Benjamin Tissoires <benjamin.tissoires@gmail.com> | 2012-11-14 10:59:23 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-11-15 04:17:21 -0500 |
commit | 2872839904848a43c5222f284bc1168ec3f998e7 (patch) | |
tree | 59ca5233b5ecc78240f7709f72a30cdc63e672e2 /drivers/hid/hid-multitouch.c | |
parent | 29807d1e24b7cd696442d2f600057230f084b3c7 (diff) |
HID: multitouch: add MT_QUIRK_IGNORE_DUPLICATES
This quirk allows a device to reuse a contact id when sending garbage
inactive contacts at the end of a report.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r-- | drivers/hid/hid-multitouch.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index ffdbc70eb5ba..e86fbf4be639 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -52,6 +52,7 @@ MODULE_LICENSE("GPL"); | |||
52 | #define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 6) | 52 | #define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 6) |
53 | #define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) | 53 | #define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) |
54 | #define MT_QUIRK_NO_AREA (1 << 9) | 54 | #define MT_QUIRK_NO_AREA (1 << 9) |
55 | #define MT_QUIRK_IGNORE_DUPLICATES (1 << 10) | ||
55 | 56 | ||
56 | struct mt_slot { | 57 | struct mt_slot { |
57 | __s32 x, y, cx, cy, p, w, h; | 58 | __s32 x, y, cx, cy, p, w, h; |
@@ -505,10 +506,18 @@ static void mt_complete_slot(struct mt_device *td, struct input_dev *input) | |||
505 | if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { | 506 | if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { |
506 | int slotnum = mt_compute_slot(td, input); | 507 | int slotnum = mt_compute_slot(td, input); |
507 | struct mt_slot *s = &td->curdata; | 508 | struct mt_slot *s = &td->curdata; |
509 | struct input_mt *mt = input->mt; | ||
508 | 510 | ||
509 | if (slotnum < 0 || slotnum >= td->maxcontacts) | 511 | if (slotnum < 0 || slotnum >= td->maxcontacts) |
510 | return; | 512 | return; |
511 | 513 | ||
514 | if ((td->mtclass.quirks & MT_QUIRK_IGNORE_DUPLICATES) && mt) { | ||
515 | struct input_mt_slot *slot = &mt->slots[slotnum]; | ||
516 | if (input_mt_is_active(slot) && | ||
517 | input_mt_is_used(mt, slot)) | ||
518 | return; | ||
519 | } | ||
520 | |||
512 | input_mt_slot(input, slotnum); | 521 | input_mt_slot(input, slotnum); |
513 | input_mt_report_slot_state(input, MT_TOOL_FINGER, | 522 | input_mt_report_slot_state(input, MT_TOOL_FINGER, |
514 | s->touch_state); | 523 | s->touch_state); |