aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-uclogic.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index bdda9fd05c1f..94167310e15a 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -627,6 +627,7 @@ struct uclogic_drvdata {
627 __u8 *rdesc; 627 __u8 *rdesc;
628 unsigned int rsize; 628 unsigned int rsize;
629 bool invert_pen_inrange; 629 bool invert_pen_inrange;
630 bool ignore_pen_usage;
630}; 631};
631 632
632static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, 633static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
@@ -719,16 +720,12 @@ static int uclogic_input_mapping(struct hid_device *hdev, struct hid_input *hi,
719 struct hid_field *field, struct hid_usage *usage, 720 struct hid_field *field, struct hid_usage *usage,
720 unsigned long **bit, int *max) 721 unsigned long **bit, int *max)
721{ 722{
722 struct usb_interface *intf; 723 struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
723
724 if (hdev->product == USB_DEVICE_ID_HUION_TABLET) {
725 intf = to_usb_interface(hdev->dev.parent);
726 724
727 /* discard the unused pen interface */ 725 /* discard the unused pen interface */
728 if ((intf->cur_altsetting->desc.bInterfaceNumber != 0) && 726 if ((drvdata->ignore_pen_usage) &&
729 (field->application == HID_DG_PEN)) 727 (field->application == HID_DG_PEN))
730 return -1; 728 return -1;
731 }
732 729
733 /* let hid-core decide what to do */ 730 /* let hid-core decide what to do */
734 return 0; 731 return 0;
@@ -908,6 +905,8 @@ static int uclogic_probe(struct hid_device *hdev,
908 return rc; 905 return rc;
909 } 906 }
910 drvdata->invert_pen_inrange = true; 907 drvdata->invert_pen_inrange = true;
908 } else {
909 drvdata->ignore_pen_usage = true;
911 } 910 }
912 break; 911 break;
913 } 912 }