Skip to content

Commit 487b6d0

Browse files
author
Jiri Kosina
committed
Merge branch 'for-5.1/hid-uclogic' into for-linus
hid-uclogic driver revamp, in order to support wider range of Huion tablets, from Nikolai Kondrashov
2 parents 7ff6dae + 24b2f66 commit 487b6d0

File tree

11 files changed

+2412
-558
lines changed

11 files changed

+2412
-558
lines changed

drivers/hid/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@ config HID_WALTOP
412412
---help---
413413
Support for Waltop tablets.
414414

415+
config HID_VIEWSONIC
416+
tristate "ViewSonic/Signotec"
417+
depends on HID
418+
help
419+
Support for ViewSonic/Signotec PD1011 signature pad.
420+
415421
config HID_GYRATION
416422
tristate "Gyration remote control"
417423
depends on HID

drivers/hid/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,16 @@ obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
109109
obj-$(CONFIG_HID_TIVO) += hid-tivo.o
110110
obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
111111
obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
112+
hid-uclogic-objs := hid-uclogic-core.o \
113+
hid-uclogic-rdesc.o \
114+
hid-uclogic-params.o
112115
obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
113116
obj-$(CONFIG_HID_UDRAW_PS3) += hid-udraw-ps3.o
114117
obj-$(CONFIG_HID_LED) += hid-led.o
115118
obj-$(CONFIG_HID_XINMO) += hid-xinmo.o
116119
obj-$(CONFIG_HID_ZEROPLUS) += hid-zpff.o
117120
obj-$(CONFIG_HID_ZYDACRON) += hid-zydacron.o
121+
obj-$(CONFIG_HID_VIEWSONIC) += hid-viewsonic.o
118122

119123
wacom-objs := wacom_wac.o wacom_sys.o
120124
obj-$(CONFIG_HID_WACOM) += wacom.o

drivers/hid/hid-ids.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@
663663
#define USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2 0x501a
664664
#define USB_DEVICE_ID_KYE_EASYPEN_M610X 0x5013
665665
#define USB_DEVICE_ID_KYE_PENSKETCH_M912 0x5015
666+
#define USB_DEVICE_ID_KYE_EASYPEN_M406XE 0x5019
666667

667668
#define USB_VENDOR_ID_LABTEC 0x1020
668669
#define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006
@@ -1138,11 +1139,16 @@
11381139
#define USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850 0x0522
11391140
#define USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60 0x0781
11401141
#define USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3 0x3031
1141-
#define USB_DEVICE_ID_UGEE_TABLET_81 0x0081
1142-
#define USB_DEVICE_ID_UGEE_TABLET_45 0x0045
1142+
#define USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_81 0x0081
1143+
#define USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_45 0x0045
1144+
#define USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_47 0x0047
11431145
#define USB_DEVICE_ID_YIYNOVA_TABLET 0x004d
11441146

11451147
#define USB_VENDOR_ID_UGEE 0x28bd
1148+
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540 0x0075
1149+
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 0x0094
1150+
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01 0x0042
1151+
#define USB_DEVICE_ID_UGEE_TABLET_G5 0x0074
11461152
#define USB_DEVICE_ID_UGEE_TABLET_EX07S 0x0071
11471153

11481154
#define USB_VENDOR_ID_UNITEC 0x227d
@@ -1244,4 +1250,10 @@
12441250
#define USB_VENDOR_ID_UGTIZER 0x2179
12451251
#define USB_DEVICE_ID_UGTIZER_TABLET_GP0610 0x0053
12461252

1253+
#define USB_VENDOR_ID_VIEWSONIC 0x0543
1254+
#define USB_DEVICE_ID_VIEWSONIC_PD1011 0xe621
1255+
1256+
#define USB_VENDOR_ID_SIGNOTEC 0x2133
1257+
#define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018
1258+
12471259
#endif

drivers/hid/hid-kye.c

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,80 @@ static __u8 pensketch_m912_rdesc_fixed[] = {
483483
0xC0 /* End Collection */
484484
};
485485

486+
/* Original EasyPen M406XE report descriptor size */
487+
#define EASYPEN_M406XE_RDESC_ORIG_SIZE 476
488+
489+
/* Fixed EasyPen M406XE report descriptor */
490+
static __u8 easypen_m406xe_rdesc_fixed[] = {
491+
0x05, 0x01, /* Usage Page (Desktop), */
492+
0x09, 0x01, /* Usage (01h), */
493+
0xA1, 0x01, /* Collection (Application), */
494+
0x85, 0x05, /* Report ID (5), */
495+
0x09, 0x01, /* Usage (01h), */
496+
0x15, 0x80, /* Logical Minimum (-128), */
497+
0x25, 0x7F, /* Logical Maximum (127), */
498+
0x75, 0x08, /* Report Size (8), */
499+
0x95, 0x07, /* Report Count (7), */
500+
0xB1, 0x02, /* Feature (Variable), */
501+
0xC0, /* End Collection, */
502+
0x05, 0x0D, /* Usage Page (Digitizer), */
503+
0x09, 0x02, /* Usage (Pen), */
504+
0xA1, 0x01, /* Collection (Application), */
505+
0x85, 0x10, /* Report ID (16), */
506+
0x09, 0x20, /* Usage (Stylus), */
507+
0xA0, /* Collection (Physical), */
508+
0x14, /* Logical Minimum (0), */
509+
0x25, 0x01, /* Logical Maximum (1), */
510+
0x75, 0x01, /* Report Size (1), */
511+
0x09, 0x42, /* Usage (Tip Switch), */
512+
0x09, 0x44, /* Usage (Barrel Switch), */
513+
0x09, 0x46, /* Usage (Tablet Pick), */
514+
0x95, 0x03, /* Report Count (3), */
515+
0x81, 0x02, /* Input (Variable), */
516+
0x95, 0x04, /* Report Count (4), */
517+
0x81, 0x03, /* Input (Constant, Variable), */
518+
0x09, 0x32, /* Usage (In Range), */
519+
0x95, 0x01, /* Report Count (1), */
520+
0x81, 0x02, /* Input (Variable), */
521+
0x75, 0x10, /* Report Size (16), */
522+
0x95, 0x01, /* Report Count (1), */
523+
0xA4, /* Push, */
524+
0x05, 0x01, /* Usage Page (Desktop), */
525+
0x55, 0xFD, /* Unit Exponent (-3), */
526+
0x65, 0x13, /* Unit (Inch), */
527+
0x34, /* Physical Minimum (0), */
528+
0x09, 0x30, /* Usage (X), */
529+
0x46, 0x70, 0x17, /* Physical Maximum (6000), */
530+
0x26, 0x00, 0x3C, /* Logical Maximum (15360), */
531+
0x81, 0x02, /* Input (Variable), */
532+
0x09, 0x31, /* Usage (Y), */
533+
0x46, 0xA0, 0x0F, /* Physical Maximum (4000), */
534+
0x26, 0x00, 0x28, /* Logical Maximum (10240), */
535+
0x81, 0x02, /* Input (Variable), */
536+
0xB4, /* Pop, */
537+
0x09, 0x30, /* Usage (Tip Pressure), */
538+
0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
539+
0x81, 0x02, /* Input (Variable), */
540+
0xC0, /* End Collection, */
541+
0xC0, /* End Collection */
542+
0x05, 0x0C, /* Usage Page (Consumer), */
543+
0x09, 0x01, /* Usage (Consumer Control), */
544+
0xA1, 0x01, /* Collection (Application), */
545+
0x85, 0x12, /* Report ID (18), */
546+
0x14, /* Logical Minimum (0), */
547+
0x25, 0x01, /* Logical Maximum (1), */
548+
0x75, 0x01, /* Report Size (1), */
549+
0x95, 0x04, /* Report Count (4), */
550+
0x0A, 0x79, 0x02, /* Usage (AC Redo Or Repeat), */
551+
0x0A, 0x1A, 0x02, /* Usage (AC Undo), */
552+
0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
553+
0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
554+
0x81, 0x02, /* Input (Variable), */
555+
0x95, 0x34, /* Report Count (52), */
556+
0x81, 0x03, /* Input (Constant, Variable), */
557+
0xC0 /* End Collection */
558+
};
559+
486560
static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc,
487561
unsigned int *rsize, int offset, const char *device_name) {
488562
/*
@@ -555,6 +629,12 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
555629
*rsize = sizeof(easypen_m610x_rdesc_fixed);
556630
}
557631
break;
632+
case USB_DEVICE_ID_KYE_EASYPEN_M406XE:
633+
if (*rsize == EASYPEN_M406XE_RDESC_ORIG_SIZE) {
634+
rdesc = easypen_m406xe_rdesc_fixed;
635+
*rsize = sizeof(easypen_m406xe_rdesc_fixed);
636+
}
637+
break;
558638
case USB_DEVICE_ID_KYE_PENSKETCH_M912:
559639
if (*rsize == PENSKETCH_M912_RDESC_ORIG_SIZE) {
560640
rdesc = pensketch_m912_rdesc_fixed;
@@ -644,6 +724,7 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
644724
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
645725
case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2:
646726
case USB_DEVICE_ID_KYE_EASYPEN_M610X:
727+
case USB_DEVICE_ID_KYE_EASYPEN_M406XE:
647728
case USB_DEVICE_ID_KYE_PENSKETCH_M912:
648729
ret = kye_tablet_enable(hdev);
649730
if (ret) {
@@ -678,6 +759,8 @@ static const struct hid_device_id kye_devices[] = {
678759
USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2) },
679760
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
680761
USB_DEVICE_ID_KYE_EASYPEN_M610X) },
762+
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
763+
USB_DEVICE_ID_KYE_EASYPEN_M406XE) },
681764
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
682765
USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
683766
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,

drivers/hid/hid-quirks.c

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static const struct hid_device_id hid_quirks[] = {
9999
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X), HID_QUIRK_MULTI_INPUT },
100100
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2), HID_QUIRK_MULTI_INPUT },
101101
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912), HID_QUIRK_MULTI_INPUT },
102+
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M406XE), HID_QUIRK_MULTI_INPUT },
102103
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_PIXART_USB_OPTICAL_MOUSE_ID2), HID_QUIRK_ALWAYS_POLL },
103104
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C007), HID_QUIRK_ALWAYS_POLL },
104105
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C077), HID_QUIRK_ALWAYS_POLL },
@@ -411,11 +412,6 @@ static const struct hid_device_id hid_have_special_driver[] = {
411412
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_MANTICORE) },
412413
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
413414
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
414-
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
415-
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
416-
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2) },
417-
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
418-
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },
419415
#endif
420416
#if IS_ENABLED(CONFIG_HID_LCPOWER)
421417
{ HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000) },
@@ -674,35 +670,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
674670
#if IS_ENABLED(CONFIG_HID_TWINHAN)
675671
{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
676672
#endif
677-
#if IS_ENABLED(CONFIG_HID_UCLOGIC)
678-
{ HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
679-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_HUION_TABLET) },
680-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
681-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
682-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
683-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) },
684-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
685-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) },
686-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) },
687-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_YIYNOVA_TABLET) },
688-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_81) },
689-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_45) },
690-
{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) },
691-
{ HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_TABLET_EX07S) },
692-
{ HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_GP0610) },
693-
#endif
694673
#if IS_ENABLED(CONFIG_HID_UDRAW_PS3)
695674
{ HID_USB_DEVICE(USB_VENDOR_ID_THQ, USB_DEVICE_ID_THQ_PS3_UDRAW) },
696675
#endif
697-
#if IS_ENABLED(CONFIG_HID_WALTOP)
698-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
699-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
700-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },
701-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_PID_0038) },
702-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
703-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
704-
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET) },
705-
#endif
706676
#if IS_ENABLED(CONFIG_HID_XINMO)
707677
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE) },
708678
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_THT_2P_ARCADE) },

0 commit comments

Comments
 (0)