Skip to content

Commit 54f4c0c

Browse files
bentissJiri Kosina
authored andcommitted
HID: multitouch: support arrays for the split of the touches in a report
Win8 certification introduced the ability to transmit two X and two Y per touch. The specification precises that it must be used in an array. This test guarantees that we split the touches on the last element in this array. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent f262d1f commit 54f4c0c

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎drivers/hid/hid-multitouch.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,15 @@ static int mt_event(struct hid_device *hid, struct hid_field *field,
576576
return 0;
577577
}
578578

579-
if (usage->hid == td->last_slot_field)
580-
mt_complete_slot(td, field->hidinput->input);
581-
582-
if (field->index == td->last_field_index
583-
&& td->num_received >= td->num_expected)
584-
mt_sync_frame(td, field->hidinput->input);
579+
if (usage->usage_index + 1 == field->report_count) {
580+
/* we only take into account the last report. */
581+
if (usage->hid == td->last_slot_field)
582+
mt_complete_slot(td, field->hidinput->input);
583+
584+
if (field->index == td->last_field_index
585+
&& td->num_received >= td->num_expected)
586+
mt_sync_frame(td, field->hidinput->input);
587+
}
585588

586589
}
587590

0 commit comments

Comments
 (0)