Skip to content

Commit

Permalink
HID: uclogic: Add support for UC-Logic TWHA60 v3
Browse files Browse the repository at this point in the history
Add support for the third version of UC-Logic TWHA60, which has
three interfaces and responds to initialization.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Nikolai Kondrashov authored and Jiri Kosina committed Sep 19, 2016
1 parent 6e02633 commit 3202bb7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/hid/hid-uclogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ static int uclogic_probe(struct hid_device *hdev,
{
int rc;
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
struct usb_device *udev = hid_to_usb_dev(hdev);
struct uclogic_drvdata *drvdata;

/*
Expand Down Expand Up @@ -988,6 +989,28 @@ static int uclogic_probe(struct hid_device *hdev,
drvdata->ignore_pen_usage = true;
}
break;
case USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60:
/*
* If it is the three-interface version, which is known to
* respond to initialization.
*/
if (udev->config->desc.bNumInterfaces == 3) {
/* If it is the pen interface */
if (intf->cur_altsetting->desc.bInterfaceNumber == 0) {
rc = uclogic_tablet_enable(hdev);
if (rc) {
hid_err(hdev, "tablet enabling failed\n");
return rc;
}
drvdata->invert_pen_inrange = true;

rc = uclogic_button_enable(hdev);
drvdata->has_virtual_pad_interface = !rc;
} else {
drvdata->ignore_pen_usage = true;
}
}
break;
}

rc = hid_parse(hdev);
Expand Down

0 comments on commit 3202bb7

Please sign in to comment.