HID: wacom: Detect and correct descriptors missing HID_DG_BARRELSWITCH2
authorJason Gerecke <killertofu@gmail.com>
Thu, 20 Oct 2016 01:03:40 +0000 (18:03 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 20 Oct 2016 07:53:56 +0000 (09:53 +0200)
commit6005a13c90a31501f3c21797b567e845c7098f25
tree8e38f20d8a260c307311535a7db13e1d46c3088b
parent49005b9fd05249d537363ff86cb41f07f48c847a
HID: wacom: Detect and correct descriptors missing HID_DG_BARRELSWITCH2

ISDv4 devices have long supported reporting data from each of two barrel
switches, but HID_DG_BARRELSWITCH2 itself was only recently standardized.
Prior to its adoption, ISDv4 devices would associate the bit indicating
the state of the second barrel switch with the "Undefined" 0x000D0000
usage. Although most such devices have explicit support, a few use the
HID_GENERIC codepath which ignores the "Undefined" usage.

This patch adds code which detects the presence of a pre-standard second
barrel switch and corrects the usage value so that the HID_GENERIC code
will declare its presence and report its state.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_sys.c