Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-16 10:45:04 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-16 10:45:17 +0200
commitb75e73e0d8ead1a2f6487c6c58e5c3fed2828f5d (patch)
treecc64349d684f95549b68ab2ef98ac80c3c740cd1
parent2595c7f6e10b81e49fa9ca0765ed6963381a1fe0 (diff)
HID: wacom: Don't set tool type until we're in range
(bsc#1051510).
-rw-r--r--patches.drivers/HID-wacom-Don-t-set-tool-type-until-we-re-in-range.patch75
-rw-r--r--series.conf1
2 files changed, 76 insertions, 0 deletions
diff --git a/patches.drivers/HID-wacom-Don-t-set-tool-type-until-we-re-in-range.patch b/patches.drivers/HID-wacom-Don-t-set-tool-type-until-we-re-in-range.patch
new file mode 100644
index 0000000000..7b98372204
--- /dev/null
+++ b/patches.drivers/HID-wacom-Don-t-set-tool-type-until-we-re-in-range.patch
@@ -0,0 +1,75 @@
+From 2cc08800a6b9fcda7c7afbcf2da1a6e8808da725 Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Wed, 24 Apr 2019 15:12:57 -0700
+Subject: [PATCH] HID: wacom: Don't set tool type until we're in range
+Git-commit: 2cc08800a6b9fcda7c7afbcf2da1a6e8808da725
+Patch-mainline: v5.2 or v5.2-rc5 (next release)
+References: bsc#1051510
+
+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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/hid/wacom_wac.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
+index 747730d32ab6..4c1bc239207e 100644
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -1236,13 +1236,13 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
+ /* Add back in missing bits of ID for non-USI pens */
+ wacom->id[0] |= (wacom->serial[0] >> 32) & 0xFFFFF;
+ }
+- wacom->tool[0] = wacom_intuos_get_tool_type(wacom_intuos_id_mangle(wacom->id[0]));
+
+ for (i = 0; i < pen_frames; i++) {
+ unsigned char *frame = &data[i*pen_frame_len + 1];
+ bool valid = frame[0] & 0x80;
+ bool prox = frame[0] & 0x40;
+ bool range = frame[0] & 0x20;
++ bool invert = frame[0] & 0x10;
+
+ if (!valid)
+ continue;
+@@ -1251,9 +1251,24 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
+ wacom->shared->stylus_in_proximity = false;
+ wacom_exit_report(wacom);
+ input_sync(pen_input);
++
++ wacom->tool[0] = 0;
++ wacom->id[0] = 0;
++ wacom->serial[0] = 0;
+ return;
+ }
++
+ if (range) {
++ if (!wacom->tool[0]) { /* first in range */
++ /* Going into range select tool */
++ if (invert)
++ wacom->tool[0] = BTN_TOOL_RUBBER;
++ else if (wacom->id[0])
++ wacom->tool[0] = wacom_intuos_get_tool_type(wacom->id[0]);
++ else
++ wacom->tool[0] = BTN_TOOL_PEN;
++ }
++
+ input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1]));
+ input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3]));
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 98b4c67868..d18f635a15 100644
--- a/series.conf
+++ b/series.conf
@@ -22478,6 +22478,7 @@
patches.drm/0003-drm-i915-gvt-Fix-cmd-length-of-VEB_DI_IECP.patch
patches.drivers/parport-Fix-mem-leak-in-parport_register_dev_model.patch
patches.fixes/0001-test_firmware-Use-correct-snprintf-limit.patch
+ patches.drivers/HID-wacom-Don-t-set-tool-type-until-we-re-in-range.patch
patches.drivers/ALSA-hda-realtek-Update-headset-mode-for-ALC256.patch
patches.drivers/ALSA-firewire-motu-fix-destruction-of-data-for-isoch.patch
patches.drivers/ALSA-oxfw-allow-PCM-capture-for-Stanton-SCS.1m.patch