]> 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)
commit5f8413ffe5d77b1d9cb07c3cb212ce54c338a84c
tree84f033d92a75931415db4324418bc7d70dc694be
parent14acc90234d81e1b73b3cba459f42aabf8067619
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