[PATCH 4/4] HID: multitouch: pick the contact count field in advance

From: Benjamin Tissoires
Date: Mon Jan 28 2013 - 12:37:59 EST


Signed-off-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxx>
---
drivers/hid/hid-multitouch.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6ce232e..3d7db96 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -698,6 +698,13 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)
if (report->id != td->mt_report_id)
return;

+ /*
+ * Includes multi-packet support where subsequent
+ * packets are sent with zero contactcount.
+ */
+ if (field_cc->value[td->contactcount_index])
+ td->num_expected = field_cc->value[td->contactcount_index];
+
for (r = 0; r < report->maxfield; r++) {
field = report->field[r];
count = field->report_count;
--
1.8.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/