HID: wacom: Properly handle AES serial number and tool type
authorJason Gerecke <killertofu@gmail.com>
Fri, 10 Nov 2017 19:50:00 +0000 (11:50 -0800)
committerJiri Kosina <jkosina@suse.cz>
Tue, 21 Nov 2017 12:04:35 +0000 (13:04 +0100)
commit99acedadde157a02b21761fd406ef7adc7615533
tree879662a7a01241bf6b73b57a75fba91c4d56dfe8
parent20df15783a44a289aaa8c8f83b3f715f9040c9c2
HID: wacom: Properly handle AES serial number and tool type

Current AES sensors relay tool type and serial number information with
a different set of usages than those prescribed by the modern (i.e.
MobileStudio Pro and newer) EMR tablet standard. To ensure the driver
properly understands these usages, we modify them to be compatible.
The identifying information is split across three consecutive fields:
a 16-bit WACOM_HID_WT_SERIALNUMBER (which is more accurately described
as WACOM_HID_WD_TOOLTYPE), a 32-bit HID_DG_TOOLSERIALNUMBER, and an
8-bit 0xFF000000 (which should be WACOM_HID_WD_SERIALHI). While we're
at it, we also define proper min/max values since may may be undefined
on some devices.

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_wac.c
drivers/hid/wacom_wac.h