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:21 +0200
commit39f2fa9221e129b1e8e038ee4c41398f194ffc35 (patch)
tree31ab0a6b2cdafb540b824b53c829127488553241
parentb75e73e0d8ead1a2f6487c6c58e5c3fed2828f5d (diff)
HID: wacom: Don't report anything prior to the tool entering
range (bsc#1051510).
-rw-r--r--patches.drivers/HID-wacom-Don-t-report-anything-prior-to-the-tool-en.patch77
-rw-r--r--series.conf1
2 files changed, 78 insertions, 0 deletions
diff --git a/patches.drivers/HID-wacom-Don-t-report-anything-prior-to-the-tool-en.patch b/patches.drivers/HID-wacom-Don-t-report-anything-prior-to-the-tool-en.patch
new file mode 100644
index 0000000000..0cd7f595ac
--- /dev/null
+++ b/patches.drivers/HID-wacom-Don-t-report-anything-prior-to-the-tool-en.patch
@@ -0,0 +1,77 @@
+From e92a7be7fe5b2510fa60965eaf25f9e3dc08b8cc Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Wed, 24 Apr 2019 15:12:58 -0700
+Subject: [PATCH] HID: wacom: Don't report anything prior to the tool entering range
+Git-commit: e92a7be7fe5b2510fa60965eaf25f9e3dc08b8cc
+Patch-mainline: v5.2 or v5.2-rc5 (next release)
+References: bsc#1051510
+
+If the tool spends some time in prox before entering range, a series of
+events (e.g. ABS_DISTANCE, MSC_SERIAL) can be sent before we or userspace
+have any clue about the pen whose data is being reported. We need to hold
+off on reporting anything until the pen has entered range. Since we still
+want to report events that occur "in prox" after the pen has *left* range
+we use 'wacom-tool[0]' as the indicator that the pen did at one point
+enter range and provide us/userspace with tool type and serial number
+information.
+
+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 | 33 ++++++++++++++++++---------------
+ 1 file changed, 18 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
+index 4c1bc239207e..613342bb9d6b 100644
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -1290,23 +1290,26 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
+ get_unaligned_le16(&frame[11]));
+ }
+ }
+- input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
+- if (wacom->features.type == INTUOSP2_BT) {
+- input_report_abs(pen_input, ABS_DISTANCE,
+- range ? frame[13] : wacom->features.distance_max);
+- } else {
+- input_report_abs(pen_input, ABS_DISTANCE,
+- range ? frame[7] : wacom->features.distance_max);
+- }
+
+- input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x01);
+- input_report_key(pen_input, BTN_STYLUS, frame[0] & 0x02);
+- input_report_key(pen_input, BTN_STYLUS2, frame[0] & 0x04);
++ if (wacom->tool[0]) {
++ input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5]));
++ if (wacom->features.type == INTUOSP2_BT) {
++ input_report_abs(pen_input, ABS_DISTANCE,
++ range ? frame[13] : wacom->features.distance_max);
++ } else {
++ input_report_abs(pen_input, ABS_DISTANCE,
++ range ? frame[7] : wacom->features.distance_max);
++ }
++
++ input_report_key(pen_input, BTN_TOUCH, frame[0] & 0x01);
++ input_report_key(pen_input, BTN_STYLUS, frame[0] & 0x02);
++ input_report_key(pen_input, BTN_STYLUS2, frame[0] & 0x04);
+
+- input_report_key(pen_input, wacom->tool[0], prox);
+- input_event(pen_input, EV_MSC, MSC_SERIAL, wacom->serial[0]);
+- input_report_abs(pen_input, ABS_MISC,
+- wacom_intuos_id_mangle(wacom->id[0])); /* report tool id */
++ input_report_key(pen_input, wacom->tool[0], prox);
++ input_event(pen_input, EV_MSC, MSC_SERIAL, wacom->serial[0]);
++ input_report_abs(pen_input, ABS_MISC,
++ wacom_intuos_id_mangle(wacom->id[0])); /* report tool id */
++ }
+
+ wacom->shared->stylus_in_proximity = prox;
+
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index d18f635a15..c43f7f95f9 100644
--- a/series.conf
+++ b/series.conf
@@ -22479,6 +22479,7 @@
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/HID-wacom-Don-t-report-anything-prior-to-the-tool-en.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