summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-params.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 12:13:58 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 12:00:53 +0100
commit9c17f7353928ddb0ab5ee4cb8b29d7ddf8f8eab7 (patch)
treea3d6041e61368f821d25e701b60686eb4d26ab32 /drivers/hid/hid-uclogic-params.c
parent0c15efe9ef7f2042234485ad3a7b09567b9821f6 (diff)
HID: uclogic: Add support for Ugee M540
Add support for Ugee M540 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/hid-uclogic-params.c')
-rw-r--r--drivers/hid/hid-uclogic-params.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index f57bf2698374..72a073ae454c 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -897,9 +897,29 @@ int uclogic_params_init(struct uclogic_params *params,
break;
case VID_PID(USB_VENDOR_ID_UCLOGIC,
USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U):
- rc = WITH_OPT_DESC(WPXXXXU_ORIG, wp5540u_fixed);
- if (rc != 0)
- goto cleanup;
+ if (hdev->dev_rsize == UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE) {
+ if (bInterfaceNumber == 0) {
+ /* Try to probe v1 pen parameters */
+ rc = uclogic_params_pen_init_v1(&p.pen,
+ &found, hdev);
+ if (rc != 0) {
+ hid_err(hdev,
+ "pen probing failed: %d\n",
+ rc);
+ goto cleanup;
+ }
+ if (!found) {
+ hid_warn(hdev,
+ "pen parameters not found");
+ }
+ } else {
+ uclogic_params_init_invalid(&p);
+ }
+ } else {
+ rc = WITH_OPT_DESC(WPXXXXU_ORIG, wp5540u_fixed);
+ if (rc != 0)
+ goto cleanup;
+ }
break;
case VID_PID(USB_VENDOR_ID_UCLOGIC,
USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U):