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:06 +0200
commitf9af2b5d6ef888db74e9d796d4cdf4dfcf48a13e (patch)
tree0733528b43039244e5073a7af688853043f9a8fe
parent9c8c33cc842b5685d3e314e60e66afa7a8db70cb (diff)
HID: wacom: Move HID fix for AES serial number into
wacom_hid_usage_quirk (bsc#1051510).
-rw-r--r--patches.drivers/HID-wacom-Move-HID-fix-for-AES-serial-number-into-wa.patch102
-rw-r--r--series.conf1
2 files changed, 103 insertions, 0 deletions
diff --git a/patches.drivers/HID-wacom-Move-HID-fix-for-AES-serial-number-into-wa.patch b/patches.drivers/HID-wacom-Move-HID-fix-for-AES-serial-number-into-wa.patch
new file mode 100644
index 0000000000..0d96f77b0a
--- /dev/null
+++ b/patches.drivers/HID-wacom-Move-HID-fix-for-AES-serial-number-into-wa.patch
@@ -0,0 +1,102 @@
+From e9fe0d4921ee07d934d839d8e418f83dded48aa7 Mon Sep 17 00:00:00 2001
+From: Jason Gerecke <killertofu@gmail.com>
+Date: Thu, 24 Jan 2019 11:09:44 -0800
+Subject: [PATCH] HID: wacom: Move HID fix for AES serial number into wacom_hid_usage_quirk
+Git-commit: e9fe0d4921ee07d934d839d8e418f83dded48aa7
+Patch-mainline: v5.1-rc1
+References: bsc#1051510
+
+The 'wacom_hid_usage_quirk' function is the intended home for fixing
+up descriptors that are buggy or that don't quite fit the mold. Commit
+578325120e was supposed to move all of these quirks but it missed the
+code to handle fixup the serial number usages for AES pens. Lets move
+this code out of 'wacom_wac_pen_usage_mapping' where it was previously
+lurking and put it into the same place as the others.
+
+Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/hid/wacom_sys.c | 32 ++++++++++++++++++++++++++++++++
+ drivers/hid/wacom_wac.c | 21 ---------------------
+ 2 files changed, 32 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
+index 0bdd85d486fe..a8633b1437b2 100644
+--- a/drivers/hid/wacom_sys.c
++++ b/drivers/hid/wacom_sys.c
+@@ -252,6 +252,38 @@ static void wacom_hid_usage_quirk(struct hid_device *hdev,
+ }
+ }
+
++ /*
++ * Wacom's AES devices use different vendor-defined usages to
++ * report serial number information compared to their branded
++ * hardware. The usages are also sometimes ill-defined and do
++ * not have the correct logical min/max values set. Lets patch
++ * the descriptor to use the branded usage convention and fix
++ * the errors.
++ */
++ if (usage->hid == WACOM_HID_WT_SERIALNUMBER &&
++ field->report_size == 16 &&
++ field->index + 2 < field->report->maxfield) {
++ struct hid_field *a = field->report->field[field->index + 1];
++ struct hid_field *b = field->report->field[field->index + 2];
++
++ if (a->maxusage > 0 &&
++ a->usage[0].hid == HID_DG_TOOLSERIALNUMBER &&
++ a->report_size == 32 &&
++ b->maxusage > 0 &&
++ b->usage[0].hid == 0xFF000000 &&
++ b->report_size == 8) {
++ features->quirks |= WACOM_QUIRK_AESPEN;
++ usage->hid = WACOM_HID_WD_TOOLTYPE;
++ field->logical_minimum = S16_MIN;
++ field->logical_maximum = S16_MAX;
++ a->logical_minimum = S32_MIN;
++ a->logical_maximum = S32_MAX;
++ b->usage[0].hid = WACOM_HID_WD_SERIALHI;
++ b->logical_minimum = 0;
++ b->logical_maximum = U8_MAX;
++ }
++ }
++
+ /* 2nd-generation Intuos Pro Large has incorrect Y maximum */
+ if (hdev->vendor == USB_VENDOR_ID_WACOM &&
+ hdev->product == 0x0358 &&
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
+index 5dd3a8245f0f..72477e872324 100644
+--- a/drivers/hid/wacom_wac.c
++++ b/drivers/hid/wacom_wac.c
+@@ -2159,27 +2159,6 @@ static void wacom_wac_pen_usage_mapping(struct hid_device *hdev,
+ case HID_DG_TOOLSERIALNUMBER:
+ features->quirks |= WACOM_QUIRK_TOOLSERIAL;
+ wacom_map_usage(input, usage, field, EV_MSC, MSC_SERIAL, 0);
+-
+- /* Adjust AES usages to match modern convention */
+- if (usage->hid == WACOM_HID_WT_SERIALNUMBER && field->report_size == 16) {
+- if (field->index + 2 < field->report->maxfield) {
+- struct hid_field *a = field->report->field[field->index + 1];
+- struct hid_field *b = field->report->field[field->index + 2];
+-
+- if (a->maxusage > 0 && a->usage[0].hid == HID_DG_TOOLSERIALNUMBER && a->report_size == 32 &&
+- b->maxusage > 0 && b->usage[0].hid == 0xFF000000 && b->report_size == 8) {
+- features->quirks |= WACOM_QUIRK_AESPEN;
+- usage->hid = WACOM_HID_WD_TOOLTYPE;
+- field->logical_minimum = S16_MIN;
+- field->logical_maximum = S16_MAX;
+- a->logical_minimum = S32_MIN;
+- a->logical_maximum = S32_MAX;
+- b->usage[0].hid = WACOM_HID_WD_SERIALHI;
+- b->logical_minimum = 0;
+- b->logical_maximum = U8_MAX;
+- }
+- }
+- }
+ break;
+ case WACOM_HID_WD_SENSE:
+ features->quirks |= WACOM_QUIRK_SENSE;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 043c4917b3..155c1e8f92 100644
--- a/series.conf
+++ b/series.conf
@@ -21576,6 +21576,7 @@
patches.drivers/HID-intel-ish-ipc-handle-PIMR-before-ish_wakeup-also.patch
patches.drivers/HID-i2c-hid-Ignore-input-report-if-there-s-no-data-p.patch
patches.drivers/HID-intel-ish-hid-avoid-binding-wrong-ishtp_cl_devic.patch
+ patches.drivers/HID-wacom-Move-HID-fix-for-AES-serial-number-into-wa.patch
patches.arch/x86-mce-amd-edac-mce_amd-add-new-mp5-nbio-and-pcie-smca-bank-types.patch
patches.arch/x86-mce-amd-edac-mce_amd-add-new-mcatypes-for-cs-psp-and-smu-units.patch
patches.arch/x86-mce-amd-edac-mce_amd-add-new-error-descriptions-for-some-smca-bank-types.patch