]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitfcee5412bdc05d9147e170a5db79003d6b76373b
tree84f033d92a75931415db4324418bc7d70dc694be
parent4190e3a2d33578e6c77d7241a50e78598e60a336
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