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:29 +0200
commit9cca7947fd4eb67c579cfbfb2b775758bef7009b (patch)
treed538c258b84d9d2845f6aaaefb901183c02c549a
parent3422e35252b8cbb825e65ec5953c0862bfe07fae (diff)
HID: wacom: Correct button numbering 2nd-gen Intuos Pro over
Bluetooth (bsc#1051510).
-rw-r--r--patches.drivers/HID-wacom-Correct-button-numbering-2nd-gen-Intuos-Pr.patch73
-rw-r--r--series.conf1
2 files changed, 74 insertions, 0 deletions
diff --git a/patches.drivers/HID-wacom-Correct-button-numbering-2nd-gen-Intuos-Pr.patch b/patches.drivers/HID-wacom-Correct-button-numbering-2nd-gen-Intuos-Pr.patch
new file mode 100644
index 0000000000..fbebaa7dc0
--- /dev/null
+++ b/patches.drivers/HID-wacom-Correct-button-numbering-2nd-gen-Intuos-Pr.patch
@@ -0,0 +1,73 @@
+From 6441fc781c344df61402be1fde582c4491fa35fa Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <jason.gerecke@wacom.com>
+Date: Tue, 7 May 2019 11:53:21 -0700
+Subject: [PATCH] HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth
+Git-commit: 6441fc781c344df61402be1fde582c4491fa35fa
+Patch-mainline: v5.2 or v5.2-rc5 (next release)
+References: bsc#1051510
+
+The button numbering of the 2nd-gen Intuos Pro is not consistent between
+the USB and Bluetooth interfaces. Over USB, the HID_GENERIC codepath
+enumerates the eight ExpressKeys first (BTN_0 - BTN_7) followed by the
+center modeswitch button (BTN_8). The Bluetooth codepath, however, has
+the center modeswitch button as BTN_0 and the the eight ExpressKeys as
+BTN_1 - BTN_8. To ensure userspace button mappings do not change
+depending on how the tablet is connected, modify the Bluetooth codepath
+to report buttons in the same order as USB.
+
+To ensure the mode switch LED continues to toggle in response to the
+mode switch button, the `wacom_is_led_toggled` function also requires
+a small update.
+
+Link: https://github.com/linuxwacom/input-wacom/pull/79
+Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
+Cc: <stable@vger.kernel.org> # 4.11+
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Reviewed-by: Aaron 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 | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
+index af62a630fee9..e848445236d8 100644
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -1383,7 +1383,7 @@ static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)
+ struct input_dev *pad_input = wacom->pad_input;
+ unsigned char *data = wacom->data;
+
+- int buttons = (data[282] << 1) | ((data[281] >> 6) & 0x01);
++ int buttons = data[282] | ((data[281] & 0x40) << 2);
+ int ring = data[285] & 0x7F;
+ bool ringstatus = data[285] & 0x80;
+ bool prox = buttons || ringstatus;
+@@ -3832,7 +3832,7 @@ static void wacom_24hd_update_leds(struct wacom *wacom, int mask, int group)
+ static bool wacom_is_led_toggled(struct wacom *wacom, int button_count,
+ int mask, int group)
+ {
+- int button_per_group;
++ int group_button;
+
+ /*
+ * 21UX2 has LED group 1 to the left and LED group 0
+@@ -3842,9 +3842,12 @@ static bool wacom_is_led_toggled(struct wacom *wacom, int button_count,
+ if (wacom->wacom_wac.features.type == WACOM_21UX2)
+ group = 1 - group;
+
+- button_per_group = button_count/wacom->led.count;
++ group_button = group * (button_count/wacom->led.count);
+
+- return mask & (1 << (group * button_per_group));
++ if (wacom->wacom_wac.features.type == INTUOSP2_BT)
++ group_button = 8;
++
++ return mask & (1 << group_button);
+ }
+
+ static void wacom_update_led(struct wacom *wacom, int button_count, int mask,
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index f78b38a4bf..ea70463f9a 100644
--- a/series.conf
+++ b/series.conf
@@ -22481,6 +22481,7 @@
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/HID-wacom-Send-BTN_TOUCH-in-response-to-INTUOSP2_BT-.patch
+ patches.drivers/HID-wacom-Correct-button-numbering-2nd-gen-Intuos-Pr.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