HID: wacom: Don't set tool type until we're in range
authorJason Gerecke <jason.gerecke@wacom.com>
Wed, 24 Apr 2019 22:12:57 +0000 (15:12 -0700)
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 17 May 2019 14:23:52 +0000 (16:23 +0200)
commit2cc08800a6b9fcda7c7afbcf2da1a6e8808da725
tree741093a7ccc64d49650e1279c587855f3bbcfc7a
parent10235380d18e8f666446970078d1ee69b33ab643
HID: wacom: Don't set tool type until we're in range

The serial number and tool type information that is reported by the tablet
while a pen is merely "in prox" instead of fully "in range" can be stale
and cause us to report incorrect tool information. Serial number, tool
type, and other information is only valid once the pen comes fully in range
so we should be careful to not use this information until that point.

In particular, this issue may cause the driver to incorectly report
BTN_TOOL_RUBBER after switching from the eraser tool back to the pen.

Fixes: a48324de6d4d ("HID: wacom: Bluetooth IRQ for Intuos Pro should handle prox/range")
Cc: <stable@vger.kernel.org> # 4.11+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
drivers/hid/wacom_wac.c