aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hid/hid-ids.h
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2019-11-06 11:59:46 -0800
committerJiri Kosina <jkosina@suse.cz>2019-11-06 21:37:29 +0100
commitff479731c3859609530416a18ddb3db5db019b66 (patch)
tree4a09d3a6037b7085058506029ceb1ed7beb2aac9 /drivers/hid/hid-ids.h
parentHID: i2c-hid: Send power-on command after reset (diff)
downloadwireguard-linux-ff479731c3859609530416a18ddb3db5db019b66.tar.xz
wireguard-linux-ff479731c3859609530416a18ddb3db5db019b66.zip
HID: wacom: generic: Treat serial number and related fields as unsigned
The HID descriptors for most Wacom devices oddly declare the serial number and other related fields as signed integers. When these numbers are ingested by the HID subsystem, they are automatically sign-extended into 32-bit integers. We treat the fields as unsigned elsewhere in the kernel and userspace, however, so this sign-extension causes problems. In particular, the sign-extended tool ID sent to userspace as ABS_MISC does not properly match unsigned IDs used by xf86-input-wacom and libwacom. We introduce a function 'wacom_s32tou' that can undo the automatic sign extension performed by 'hid_snto32'. We call this function when processing the serial number and related fields to ensure that we are dealing with and reporting the unsigned form. We opt to use this method rather than adding a descriptor fixup in 'wacom_hid_usage_quirk' since it should be more robust in the face of future devices. Ref: https://github.com/linuxwacom/input-wacom/issues/134 Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types") CC: <stable@vger.kernel.org> # v4.10+ Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-ids.h')
0 files changed, 0 insertions, 0 deletions