Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: wacom: generic: Clear ABS_MISC when tool leaves proximity

The tool ID information sent in ABS_MISC is expected to be reset to 0
when a tool leaves proximity. Not doing this can cause problems if a
tool is removed and then re-introduced. Kernel event filtering will
prevent the (identical) ABS_MISC event from being sent when the tool
re-enters proxmity. This can cause userspace to not properly set the
tool ID.

Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types")
Cc: stable # v4.10 <stable@vger.kernel.org>
Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jason Gerecke and committed by
Jiri Kosina
92380b57 993f0d93

+1 -1
+1 -1
drivers/hid/wacom_wac.c
··· 2272 2272 input_report_key(input, wacom_wac->tool[0], prox); 2273 2273 if (wacom_wac->serial[0]) { 2274 2274 input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); 2275 - input_report_abs(input, ABS_MISC, id); 2275 + input_report_abs(input, ABS_MISC, prox ? id : 0); 2276 2276 } 2277 2277 2278 2278 wacom_wac->hid_data.tipswitch = false;