]>
Commit | Line | Data |
---|---|---|
13e6d7ac GKH |
1 | From 92380b572d95caf48f8424746aeee63c5a2b1922 Mon Sep 17 00:00:00 2001 |
2 | From: Jason Gerecke <killertofu@gmail.com> | |
3 | Date: Thu, 7 Sep 2017 17:47:38 -0700 | |
4 | Subject: HID: wacom: generic: Clear ABS_MISC when tool leaves proximity | |
5 | ||
6 | From: Jason Gerecke <killertofu@gmail.com> | |
7 | ||
8 | commit 92380b572d95caf48f8424746aeee63c5a2b1922 upstream. | |
9 | ||
10 | The tool ID information sent in ABS_MISC is expected to be reset to 0 | |
11 | when a tool leaves proximity. Not doing this can cause problems if a | |
12 | tool is removed and then re-introduced. Kernel event filtering will | |
13 | prevent the (identical) ABS_MISC event from being sent when the tool | |
14 | re-enters proxmity. This can cause userspace to not properly set the | |
15 | tool ID. | |
16 | ||
17 | Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types") | |
18 | Signed-off-by: Ping Cheng <ping.cheng@wacom.com> | |
19 | Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> | |
20 | Signed-off-by: Jiri Kosina <jkosina@suse.cz> | |
21 | Signed-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; |