summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r--drivers/hid/wacom_sys.c32
1 files changed, 32 insertions, 0 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 &&