]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.13.6/hid-wacom-generic-clear-abs_misc-when-tool-leaves-proximity.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.13.6 / hid-wacom-generic-clear-abs_misc-when-tool-leaves-proximity.patch
CommitLineData
13e6d7ac
GKH
1From 92380b572d95caf48f8424746aeee63c5a2b1922 Mon Sep 17 00:00:00 2001
2From: Jason Gerecke <killertofu@gmail.com>
3Date: Thu, 7 Sep 2017 17:47:38 -0700
4Subject: HID: wacom: generic: Clear ABS_MISC when tool leaves proximity
5
6From: Jason Gerecke <killertofu@gmail.com>
7
8commit 92380b572d95caf48f8424746aeee63c5a2b1922 upstream.
9
10The tool ID information sent in ABS_MISC is expected to be reset to 0
11when a tool leaves proximity. Not doing this can cause problems if a
12tool is removed and then re-introduced. Kernel event filtering will
13prevent the (identical) ABS_MISC event from being sent when the tool
14re-enters proxmity. This can cause userspace to not properly set the
15tool ID.
16
17Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types")
18Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
19Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
20Signed-off-by: Jiri Kosina <jkosina@suse.cz>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 drivers/hid/wacom_wac.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27--- a/drivers/hid/wacom_wac.c
28+++ b/drivers/hid/wacom_wac.c
29@@ -2272,7 +2272,7 @@ static void wacom_wac_pen_report(struct
30 input_report_key(input, wacom_wac->tool[0], prox);
31 if (wacom_wac->serial[0]) {
32 input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]);
33- input_report_abs(input, ABS_MISC, id);
34+ input_report_abs(input, ABS_MISC, prox ? id : 0);
35 }
36
37 wacom_wac->hid_data.tipswitch = false;