OSDN Git Service

HID: multitouch: Properly deal with Win8 PTP reports with 0 touches
authorHans de Goede <hdegoede@redhat.com>
Wed, 22 Nov 2017 11:57:08 +0000 (12:57 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 22 Nov 2017 15:01:06 +0000 (16:01 +0100)
commitaf8dc4d0949092c4fba17ebb9e54448697c3d4e0
tree84f033d92a75931415db4324418bc7d70dc694be
parentfb55b4026d88a2bdc351f5485461d9314c885b60
HID: multitouch: Properly deal with Win8 PTP reports with 0 touches

The Windows Precision Touchpad spec "Figure 4 Button Only Down and Up"
and "Table 9 Report Sequence for Button Only Down and Up" indicate
that the first packet of a (possibly hybrid mode multi-packet) frame
may contain a contact-count of 0 if only a button is pressed and no
fingers are detected.

This means that a value of 0 for contact-count is a valid value and
should be used as expected contact count when it is the first packet
(num_received == 0), as extra check to make sure that this is the first
packet of a buttons only frame, we also check that the timestamp is
different.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-multitouch.c