]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: Tie cached HID_DG_CONTACTCOUNT indices to report ID
authorJason Gerecke <killertofu@gmail.com>
Wed, 7 Oct 2015 23:54:21 +0000 (16:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Jan 2016 19:25:54 +0000 (11:25 -0800)
commit4fb5b5240132170cd176845086085c213f6d9cf5
tree2092e82862c913ba4737bda8ec48aac2d1b75b64
parent3016b876d0b746eaf78ec0a33a15d19fa0fdb469
HID: wacom: Tie cached HID_DG_CONTACTCOUNT indices to report ID

commit 499522c8c015de995aabce3d0f0bf4b9b17f44c3 upstream.

The cached indicies 'cc_index' and 'cc_value_index' introduced in 1b5d514
are only valid for a single report ID. If a touchscreen has multiple
reports with a HID_DG_CONTACTCOUNT usage, its possible that the values
will not be correct for the report we're handling, resulting in an
incorrect value for 'num_expected'. This has been observed with the Cintiq
Companion 2.

To address this, we store the ID of the report those indicies are valid
for in a new  'cc_report' variable. Before using them to get the expected
contact count, we first check if the ID of the report we're processing
matches 'cc_report'. If it doesn't, we update the indicies to point to
the HID_DG_CONTACTCOUNT usage of the current report (if it has one).

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h