aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2018-10-10 16:40:26 -0400
committerJiri Kosina <jkosina@suse.cz>2018-10-11 08:32:01 -0400
commit11db8173dbab7a94cf5ba5225fcedbfc0f3b7e54 (patch)
tree730cbdfdd394e42c10ee407b5a45450f4b2f80a6
parent14f39921c906357391d634864d627c7bf8a18c30 (diff)
HID: wacom: Work around HID descriptor bug in DTK-2451 and DTH-2452
The DTK-2451 and DTH-2452 have a buggy HID descriptor which incorrectly contains a Cintiq-like report, complete with pen tilt, rotation, twist, serial number, etc. The hardware doesn't actually support this data but our driver duitifully sets up the device as though it does. To ensure userspace has a correct view of devices without updated firmware, we clean up this incorrect data in wacom_setup_device_quirks. We're also careful to clear the WACOM_QUIRK_TOOLSERIAL flag since its presence causes the driver to wait for serial number information (via wacom_wac_pen_serial_enforce) that never comes, resulting in the pen being non-responsive. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Fixes: 8341720642 ("HID: wacom: Queue events with missing type/serial data for later processing") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/wacom_wac.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index e0a06be5ef5c..5dd3a8245f0f 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3335,6 +3335,7 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
3335 3335
3336void wacom_setup_device_quirks(struct wacom *wacom) 3336void wacom_setup_device_quirks(struct wacom *wacom)
3337{ 3337{
3338 struct wacom_wac *wacom_wac = &wacom->wacom_wac;
3338 struct wacom_features *features = &wacom->wacom_wac.features; 3339 struct wacom_features *features = &wacom->wacom_wac.features;
3339 3340
3340 /* The pen and pad share the same interface on most devices */ 3341 /* The pen and pad share the same interface on most devices */
@@ -3464,6 +3465,24 @@ void wacom_setup_device_quirks(struct wacom *wacom)
3464 3465
3465 if (features->type == REMOTE) 3466 if (features->type == REMOTE)
3466 features->device_type |= WACOM_DEVICETYPE_WL_MONITOR; 3467 features->device_type |= WACOM_DEVICETYPE_WL_MONITOR;
3468
3469 /* HID descriptor for DTK-2451 / DTH-2452 claims to report lots
3470 * of things it shouldn't. Lets fix up the damage...
3471 */
3472 if (wacom->hdev->product == 0x382 || wacom->hdev->product == 0x37d) {
3473 features->quirks &= ~WACOM_QUIRK_TOOLSERIAL;
3474 __clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit);
3475 __clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit);
3476 __clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit);
3477 __clear_bit(ABS_Z, wacom_wac->pen_input->absbit);
3478 __clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit);
3479 __clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit);
3480 __clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit);
3481 __clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit);
3482 __clear_bit(ABS_MISC, wacom_wac->pen_input->absbit);
3483 __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
3484 __clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
3485 }
3467} 3486}
3468 3487
3469int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, 3488int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,