Skip to content

Commit

Permalink
HID: wacom: Work around HID descriptor bug in DTK-2451 and DTH-2452
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: 8341720 ("HID: wacom: Queue events with missing type/serial data for later processing")
Cc: [email protected] # v4.16+
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
jigpu authored and Jiri Kosina committed Oct 11, 2018
1 parent 14f3992 commit 11db817
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/hid/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -3335,6 +3335,7 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)

void wacom_setup_device_quirks(struct wacom *wacom)
{
struct wacom_wac *wacom_wac = &wacom->wacom_wac;
struct wacom_features *features = &wacom->wacom_wac.features;

/* The pen and pad share the same interface on most devices */
Expand Down Expand Up @@ -3464,6 +3465,24 @@ void wacom_setup_device_quirks(struct wacom *wacom)

if (features->type == REMOTE)
features->device_type |= WACOM_DEVICETYPE_WL_MONITOR;

/* HID descriptor for DTK-2451 / DTH-2452 claims to report lots
* of things it shouldn't. Lets fix up the damage...
*/
if (wacom->hdev->product == 0x382 || wacom->hdev->product == 0x37d) {
features->quirks &= ~WACOM_QUIRK_TOOLSERIAL;
__clear_bit(BTN_TOOL_BRUSH, wacom_wac->pen_input->keybit);
__clear_bit(BTN_TOOL_PENCIL, wacom_wac->pen_input->keybit);
__clear_bit(BTN_TOOL_AIRBRUSH, wacom_wac->pen_input->keybit);
__clear_bit(ABS_Z, wacom_wac->pen_input->absbit);
__clear_bit(ABS_DISTANCE, wacom_wac->pen_input->absbit);
__clear_bit(ABS_TILT_X, wacom_wac->pen_input->absbit);
__clear_bit(ABS_TILT_Y, wacom_wac->pen_input->absbit);
__clear_bit(ABS_WHEEL, wacom_wac->pen_input->absbit);
__clear_bit(ABS_MISC, wacom_wac->pen_input->absbit);
__clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
__clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
}
}

int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
Expand Down

0 comments on commit 11db817

Please sign in to comment.