From: Jason Gerecke Date: Fri, 8 Sep 2017 00:47:38 +0000 (-0700) Subject: HID: wacom: generic: Clear ABS_MISC when tool leaves proximity X-Git-Tag: v4.13.6~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b0ad678bc05c817f7145b032b40bf935b1f821c;p=thirdparty%2Fkernel%2Fstable.git HID: wacom: generic: Clear ABS_MISC when tool leaves proximity commit 92380b572d95caf48f8424746aeee63c5a2b1922 upstream. 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") Signed-off-by: Ping Cheng Signed-off-by: Jason Gerecke Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index e7064dfee0929..9678acce7e72b 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2272,7 +2272,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev, input_report_key(input, wacom_wac->tool[0], prox); if (wacom_wac->serial[0]) { input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); - input_report_abs(input, ABS_MISC, id); + input_report_abs(input, ABS_MISC, prox ? id : 0); } wacom_wac->hid_data.tipswitch = false;