Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: uclogic: Add support for Ugee G5

Add support for Ugee G5 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

authored by

Nikolai Kondrashov and committed by
Benjamin Tissoires
e902ed93 8a47670c

+104
+1
drivers/hid/hid-ids.h
··· 1144 1144 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540 0x0075 1145 1145 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 0x0094 1146 1146 #define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01 0x0042 1147 + #define USB_DEVICE_ID_UGEE_TABLET_G5 0x0074 1147 1148 #define USB_DEVICE_ID_UGEE_TABLET_EX07S 0x0071 1148 1149 1149 1150 #define USB_VENDOR_ID_UNITEC 0x227d
+2
drivers/hid/hid-uclogic-core.c
··· 384 384 { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, 385 385 USB_DEVICE_ID_UGTIZER_TABLET_GP0610) }, 386 386 { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, 387 + USB_DEVICE_ID_UGEE_TABLET_G5) }, 388 + { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, 387 389 USB_DEVICE_ID_UGEE_TABLET_EX07S) }, 388 390 { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, 389 391 USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540) },
+34
drivers/hid/hid-uclogic-params.c
··· 1042 1042 } 1043 1043 break; 1044 1044 case VID_PID(USB_VENDOR_ID_UGEE, 1045 + USB_DEVICE_ID_UGEE_TABLET_G5): 1046 + /* Ignore non-pen interfaces */ 1047 + if (bInterfaceNumber != 1) { 1048 + uclogic_params_init_invalid(&p); 1049 + break; 1050 + } 1051 + 1052 + rc = uclogic_params_pen_init_v1(&p.pen, &found, hdev); 1053 + if (rc != 0) { 1054 + hid_err(hdev, "pen probing failed: %d\n", rc); 1055 + goto cleanup; 1056 + } else if (found) { 1057 + rc = uclogic_params_frame_init_with_desc( 1058 + &p.frame, 1059 + uclogic_rdesc_ugee_g5_frame_arr, 1060 + uclogic_rdesc_ugee_g5_frame_size, 1061 + UCLOGIC_RDESC_UGEE_G5_FRAME_ID); 1062 + if (rc != 0) { 1063 + hid_err(hdev, 1064 + "failed creating buttonpad parameters: %d\n", 1065 + rc); 1066 + goto cleanup; 1067 + } 1068 + p.frame.re_lsb = 1069 + UCLOGIC_RDESC_UGEE_G5_FRAME_RE_LSB; 1070 + p.frame.dev_id_byte = 1071 + UCLOGIC_RDESC_UGEE_G5_FRAME_DEV_ID_BYTE; 1072 + } else { 1073 + hid_warn(hdev, "pen parameters not found"); 1074 + uclogic_params_init_invalid(&p); 1075 + } 1076 + 1077 + break; 1078 + case VID_PID(USB_VENDOR_ID_UGEE, 1045 1079 USB_DEVICE_ID_UGEE_TABLET_EX07S): 1046 1080 /* Ignore non-pen interfaces */ 1047 1081 if (bInterfaceNumber != 1) {
+54
drivers/hid/hid-uclogic-rdesc.c
··· 728 728 const size_t uclogic_rdesc_ugee_ex07_buttonpad_size = 729 729 sizeof(uclogic_rdesc_ugee_ex07_buttonpad_arr); 730 730 731 + /* Fixed report descriptor for Ugee G5 frame controls */ 732 + const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = { 733 + 0x05, 0x01, /* Usage Page (Desktop), */ 734 + 0x09, 0x07, /* Usage (Keypad), */ 735 + 0xA1, 0x01, /* Collection (Application), */ 736 + 0x85, 0x06, /* Report ID (6), */ 737 + 0x05, 0x0D, /* Usage Page (Digitizer), */ 738 + 0x09, 0x39, /* Usage (Tablet Function Keys), */ 739 + 0xA0, /* Collection (Physical), */ 740 + 0x14, /* Logical Minimum (0), */ 741 + 0x25, 0x01, /* Logical Maximum (1), */ 742 + 0x05, 0x01, /* Usage Page (Desktop), */ 743 + 0x05, 0x09, /* Usage Page (Button), */ 744 + 0x19, 0x01, /* Usage Minimum (01h), */ 745 + 0x29, 0x05, /* Usage Maximum (05h), */ 746 + 0x75, 0x01, /* Report Size (1), */ 747 + 0x95, 0x05, /* Report Count (5), */ 748 + 0x81, 0x02, /* Input (Variable), */ 749 + 0x75, 0x01, /* Report Size (1), */ 750 + 0x95, 0x03, /* Report Count (3), */ 751 + 0x81, 0x01, /* Input (Constant), */ 752 + 0x05, 0x0D, /* Usage Page (Digitizer), */ 753 + 0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */ 754 + 0x26, 0xFF, 0x00, /* Logical Maximum (255), */ 755 + 0x75, 0x08, /* Report Size (8), */ 756 + 0x95, 0x01, /* Report Count (1), */ 757 + 0x81, 0x02, /* Input (Variable), */ 758 + 0x25, 0x01, /* Logical Maximum (1), */ 759 + 0x09, 0x44, /* Usage (Barrel Switch), */ 760 + 0x75, 0x01, /* Report Size (1), */ 761 + 0x95, 0x01, /* Report Count (1), */ 762 + 0x81, 0x02, /* Input (Variable), */ 763 + 0x05, 0x01, /* Usage Page (Desktop), */ 764 + 0x09, 0x30, /* Usage (X), */ 765 + 0x09, 0x31, /* Usage (Y), */ 766 + 0x75, 0x01, /* Report Size (1), */ 767 + 0x95, 0x02, /* Report Count (2), */ 768 + 0x81, 0x02, /* Input (Variable), */ 769 + 0x75, 0x01, /* Report Size (1), */ 770 + 0x95, 0x0B, /* Report Count (11), */ 771 + 0x81, 0x01, /* Input (Constant), */ 772 + 0x05, 0x01, /* Usage Page (Desktop), */ 773 + 0x09, 0x38, /* Usage (Wheel), */ 774 + 0x15, 0xFF, /* Logical Minimum (-1), */ 775 + 0x25, 0x01, /* Logical Maximum (1), */ 776 + 0x75, 0x02, /* Report Size (2), */ 777 + 0x95, 0x01, /* Report Count (1), */ 778 + 0x81, 0x06, /* Input (Variable, Relative), */ 779 + 0xC0, /* End Collection, */ 780 + 0xC0 /* End Collection */ 781 + }; 782 + const size_t uclogic_rdesc_ugee_g5_frame_size = 783 + sizeof(uclogic_rdesc_ugee_g5_frame_arr); 784 + 731 785 /* Fixed report descriptor for XP-Pen Deco 01 frame controls */ 732 786 const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = { 733 787 0x05, 0x01, /* Usage Page (Desktop), */
+13
drivers/hid/hid-uclogic-rdesc.h
··· 139 139 extern const __u8 uclogic_rdesc_xppen_deco01_frame_arr[]; 140 140 extern const size_t uclogic_rdesc_xppen_deco01_frame_size; 141 141 142 + /* Fixed report descriptor for Ugee G5 frame controls */ 143 + extern const __u8 uclogic_rdesc_ugee_g5_frame_arr[]; 144 + extern const size_t uclogic_rdesc_ugee_g5_frame_size; 145 + 146 + /* Report ID of Ugee G5 frame control reports */ 147 + #define UCLOGIC_RDESC_UGEE_G5_FRAME_ID 0x06 148 + 149 + /* Device ID byte offset in Ugee G5 frame report */ 150 + #define UCLOGIC_RDESC_UGEE_G5_FRAME_DEV_ID_BYTE 0x2 151 + 152 + /* Least-significant bit of Ugee G5 frame rotary encoder state */ 153 + #define UCLOGIC_RDESC_UGEE_G5_FRAME_RE_LSB 38 154 + 142 155 #endif /* _HID_UCLOGIC_RDESC_H */