]> git.baikalelectronics.ru Git - kernel.git/commit
HID: multitouch: fix calculation of last slot field in multi-touch reports
authorBen Chan <benchan@chromium.org>
Tue, 29 May 2018 22:56:55 +0000 (15:56 -0700)
committerJiri Kosina <jkosina@suse.cz>
Wed, 30 May 2018 06:53:09 +0000 (08:53 +0200)
commit12185407d8bfaea40e4a55a1da96e42c6f1f073f
treeed1c00fc939fc3b1ac6e4a97a5b3fc7a716c5bfc
parentdba7a0eb2d3c9771e2dc7686ba7694e77d584015
HID: multitouch: fix calculation of last slot field in multi-touch reports

According to [1] and also seemingly agreed by [2], the Scan Time usage
(0x0D 0x56) is a report level usage, not a contact level usage.

However, the hid-multitouch driver currently includes HID_DG_SCANTIME
when calculating `td->last_slot_field', which may lead to
mt_complete_slot() being prematurely called in certain cases (e.g. when
each touch input report includes more than one contact and the Scan Time
usage appears before any contact logical collection).

This patch fixes the issue by skipping mt_store_field() on
HID_DG_SCANTIME, similar to how HID_DG_CONTACTCOUNT and
HID_DG_CONTACTMAX are handled.

[1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections#windows-precision-touchpad-input-reports
[2] https://patchwork.kernel.org/patch/1742181/

Fixes: 7055408ae8045 ("HID: hid-multitouch: forward MSC_TIMESTAMP")
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-multitouch.c