Skip to content

Commit e2d3d98

Browse files
committed
uclogic: Ignore fake pen usages on TWHA60
1 parent 61b26ac commit e2d3d98

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

hid-uclogic.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,17 +1036,21 @@ static int uclogic_probe(struct hid_device *hdev,
10361036
break;
10371037
case USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60:
10381038
/*
1039-
* If it is the pen interface of the three-interface version,
1040-
* which is known to respond to initialization.
1039+
* If it is the three-interface version, which is known to
1040+
* respond to initialization.
10411041
*/
1042-
if (udev->config->desc.bNumInterfaces == 3 &&
1043-
intf->cur_altsetting->desc.bInterfaceNumber == 0) {
1044-
rc = uclogic_tablet_enable(hdev);
1045-
if (rc) {
1046-
hid_err(hdev, "tablet enabling failed\n");
1047-
return rc;
1042+
if (udev->config->desc.bNumInterfaces == 3) {
1043+
/* If it is the pen interface */
1044+
if (intf->cur_altsetting->desc.bInterfaceNumber == 0) {
1045+
rc = uclogic_tablet_enable(hdev);
1046+
if (rc) {
1047+
hid_err(hdev, "tablet enabling failed\n");
1048+
return rc;
1049+
}
1050+
drvdata->invert_pen_inrange = true;
1051+
} else {
1052+
drvdata->ignore_pen_usage = true;
10481053
}
1049-
drvdata->invert_pen_inrange = true;
10501054
}
10511055
break;
10521056
}

0 commit comments

Comments
 (0)