diff options
author | Nikolai Kondrashov <spbnick@gmail.com> | 2016-09-14 21:38:20 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-09-19 14:32:24 +0200 |
commit | 3202bb7fb021e81dc988735a8b5f42f82aa912f3 (patch) | |
tree | dd662ccc0c151296147da39a7763fbe0cc084f31 /drivers/hid/hid-uclogic.c | |
parent | 6e0263346321372e5494d0e5d74a700b0829776d (diff) |
HID: uclogic: Add support for UC-Logic TWHA60 v3
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>
Diffstat (limited to 'drivers/hid/hid-uclogic.c')
-rw-r--r-- | drivers/hid/hid-uclogic.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c index 64abd8d73125..1509d7287ff3 100644 --- a/drivers/hid/hid-uclogic.c +++ b/drivers/hid/hid-uclogic.c @@ -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; /* @@ -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); |