Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  *  HID driver for UC-Logic devices not fully compliant with HID standard
0004  *  - original and fixed report descriptors
0005  *
0006  *  Copyright (c) 2010-2018 Nikolai Kondrashov
0007  *  Copyright (c) 2013 Martin Rusko
0008  */
0009 
0010 /*
0011  * This program is free software; you can redistribute it and/or modify it
0012  * under the terms of the GNU General Public License as published by the Free
0013  * Software Foundation; either version 2 of the License, or (at your option)
0014  * any later version.
0015  */
0016 
0017 #ifndef _HID_UCLOGIC_RDESC_H
0018 #define _HID_UCLOGIC_RDESC_H
0019 
0020 #include <linux/usb.h>
0021 
0022 /* Size of the original descriptor of WPXXXXU tablets */
0023 #define UCLOGIC_RDESC_WPXXXXU_ORIG_SIZE     212
0024 
0025 /* Fixed WP4030U report descriptor */
0026 extern __u8 uclogic_rdesc_wp4030u_fixed_arr[];
0027 extern const size_t uclogic_rdesc_wp4030u_fixed_size;
0028 
0029 /* Fixed WP5540U report descriptor */
0030 extern __u8 uclogic_rdesc_wp5540u_fixed_arr[];
0031 extern const size_t uclogic_rdesc_wp5540u_fixed_size;
0032 
0033 /* Fixed WP8060U report descriptor */
0034 extern __u8 uclogic_rdesc_wp8060u_fixed_arr[];
0035 extern const size_t uclogic_rdesc_wp8060u_fixed_size;
0036 
0037 /* Size of the original descriptor of the new WP5540U tablet */
0038 #define UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE  232
0039 
0040 /* Size of the original descriptor of WP1062 tablet */
0041 #define UCLOGIC_RDESC_WP1062_ORIG_SIZE      254
0042 
0043 /* Fixed WP1062 report descriptor */
0044 extern __u8 uclogic_rdesc_wp1062_fixed_arr[];
0045 extern const size_t uclogic_rdesc_wp1062_fixed_size;
0046 
0047 /* Size of the original descriptor of PF1209 tablet */
0048 #define UCLOGIC_RDESC_PF1209_ORIG_SIZE      234
0049 
0050 /* Fixed PF1209 report descriptor */
0051 extern __u8 uclogic_rdesc_pf1209_fixed_arr[];
0052 extern const size_t uclogic_rdesc_pf1209_fixed_size;
0053 
0054 /* Size of the original descriptors of TWHL850 tablet */
0055 #define UCLOGIC_RDESC_TWHL850_ORIG0_SIZE    182
0056 #define UCLOGIC_RDESC_TWHL850_ORIG1_SIZE    161
0057 #define UCLOGIC_RDESC_TWHL850_ORIG2_SIZE    92
0058 
0059 /* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
0060 extern __u8 uclogic_rdesc_twhl850_fixed0_arr[];
0061 extern const size_t uclogic_rdesc_twhl850_fixed0_size;
0062 
0063 /* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
0064 extern __u8 uclogic_rdesc_twhl850_fixed1_arr[];
0065 extern const size_t uclogic_rdesc_twhl850_fixed1_size;
0066 
0067 /* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
0068 extern __u8 uclogic_rdesc_twhl850_fixed2_arr[];
0069 extern const size_t uclogic_rdesc_twhl850_fixed2_size;
0070 
0071 /* Size of the original descriptors of TWHA60 tablet */
0072 #define UCLOGIC_RDESC_TWHA60_ORIG0_SIZE     254
0073 #define UCLOGIC_RDESC_TWHA60_ORIG1_SIZE     139
0074 
0075 /* Fixed TWHA60 report descriptor, interface 0 (stylus) */
0076 extern __u8 uclogic_rdesc_twha60_fixed0_arr[];
0077 extern const size_t uclogic_rdesc_twha60_fixed0_size;
0078 
0079 /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
0080 extern __u8 uclogic_rdesc_twha60_fixed1_arr[];
0081 extern const size_t uclogic_rdesc_twha60_fixed1_size;
0082 
0083 /* Report descriptor template placeholder head */
0084 #define UCLOGIC_RDESC_PEN_PH_HEAD   0xFE, 0xED, 0x1D
0085 #define UCLOGIC_RDESC_FRAME_PH_BTN_HEAD 0xFE, 0xED
0086 
0087 /* Apply report descriptor parameters to a report descriptor template */
0088 extern __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
0089                       size_t template_size,
0090                       const s32 *param_list,
0091                       size_t param_num);
0092 
0093 /* Report descriptor template placeholder IDs */
0094 enum uclogic_rdesc_ph_id {
0095     UCLOGIC_RDESC_PEN_PH_ID_X_LM,
0096     UCLOGIC_RDESC_PEN_PH_ID_X_PM,
0097     UCLOGIC_RDESC_PEN_PH_ID_Y_LM,
0098     UCLOGIC_RDESC_PEN_PH_ID_Y_PM,
0099     UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM,
0100     UCLOGIC_RDESC_FRAME_PH_ID_UM,
0101     UCLOGIC_RDESC_PH_ID_NUM
0102 };
0103 
0104 /* Report descriptor pen template placeholder */
0105 #define UCLOGIC_RDESC_PEN_PH(_ID) \
0106     UCLOGIC_RDESC_PEN_PH_HEAD, UCLOGIC_RDESC_PEN_PH_ID_##_ID
0107 
0108 /* Report descriptor frame buttons template placeholder */
0109 #define UCLOGIC_RDESC_FRAME_PH_BTN \
0110     UCLOGIC_RDESC_FRAME_PH_BTN_HEAD, UCLOGIC_RDESC_FRAME_PH_ID_UM
0111 
0112 /* Report ID for v1 pen reports */
0113 #define UCLOGIC_RDESC_V1_PEN_ID 0x07
0114 
0115 /* Fixed report descriptor template for (tweaked) v1 pen reports */
0116 extern const __u8 uclogic_rdesc_v1_pen_template_arr[];
0117 extern const size_t uclogic_rdesc_v1_pen_template_size;
0118 
0119 /* Report ID for v2 pen reports */
0120 #define UCLOGIC_RDESC_V2_PEN_ID 0x08
0121 
0122 /* Fixed report descriptor template for (tweaked) v2 pen reports */
0123 extern const __u8 uclogic_rdesc_v2_pen_template_arr[];
0124 extern const size_t uclogic_rdesc_v2_pen_template_size;
0125 
0126 /* Report ID for tweaked v1 frame reports */
0127 #define UCLOGIC_RDESC_V1_FRAME_ID 0xf7
0128 
0129 /* Fixed report descriptor for (tweaked) v1 frame reports */
0130 extern const __u8 uclogic_rdesc_v1_frame_arr[];
0131 extern const size_t uclogic_rdesc_v1_frame_size;
0132 
0133 /* Report ID for tweaked v2 frame button reports */
0134 #define UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID 0xf7
0135 
0136 /* Fixed report descriptor for (tweaked) v2 frame button reports */
0137 extern const __u8 uclogic_rdesc_v2_frame_buttons_arr[];
0138 extern const size_t uclogic_rdesc_v2_frame_buttons_size;
0139 
0140 /* Report ID for tweaked v2 frame touch ring/strip reports */
0141 #define UCLOGIC_RDESC_V2_FRAME_TOUCH_ID 0xf8
0142 
0143 /* Fixed report descriptor for (tweaked) v2 frame touch ring reports */
0144 extern const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[];
0145 extern const size_t uclogic_rdesc_v2_frame_touch_ring_size;
0146 
0147 /* Fixed report descriptor for (tweaked) v2 frame touch strip reports */
0148 extern const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[];
0149 extern const size_t uclogic_rdesc_v2_frame_touch_strip_size;
0150 
0151 /* Device ID byte offset in v2 frame touch ring/strip reports */
0152 #define UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE    0x4
0153 
0154 /* Report ID for tweaked v2 frame dial reports */
0155 #define UCLOGIC_RDESC_V2_FRAME_DIAL_ID 0xf9
0156 
0157 /* Fixed report descriptor for (tweaked) v2 frame dial reports */
0158 extern const __u8 uclogic_rdesc_v2_frame_dial_arr[];
0159 extern const size_t uclogic_rdesc_v2_frame_dial_size;
0160 
0161 /* Device ID byte offset in v2 frame dial reports */
0162 #define UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE 0x4
0163 
0164 /* Fixed report descriptor template for UGEE v2 pen reports */
0165 extern const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[];
0166 extern const size_t uclogic_rdesc_ugee_v2_pen_template_size;
0167 
0168 /* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */
0169 extern const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[];
0170 extern const size_t uclogic_rdesc_ugee_v2_frame_btn_template_size;
0171 
0172 /* Fixed report descriptor for Ugee EX07 frame */
0173 extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[];
0174 extern const size_t uclogic_rdesc_ugee_ex07_frame_size;
0175 
0176 /* Fixed report descriptor for XP-Pen Deco 01 frame controls */
0177 extern const __u8 uclogic_rdesc_xppen_deco01_frame_arr[];
0178 extern const size_t uclogic_rdesc_xppen_deco01_frame_size;
0179 
0180 /* Fixed report descriptor for Ugee G5 frame controls */
0181 extern const __u8 uclogic_rdesc_ugee_g5_frame_arr[];
0182 extern const size_t uclogic_rdesc_ugee_g5_frame_size;
0183 
0184 /* Report ID of Ugee G5 frame control reports */
0185 #define UCLOGIC_RDESC_UGEE_G5_FRAME_ID 0x06
0186 
0187 /* Device ID byte offset in Ugee G5 frame report */
0188 #define UCLOGIC_RDESC_UGEE_G5_FRAME_DEV_ID_BYTE 0x2
0189 
0190 /* Least-significant bit of Ugee G5 frame rotary encoder state */
0191 #define UCLOGIC_RDESC_UGEE_G5_FRAME_RE_LSB 38
0192 
0193 #endif /* _HID_UCLOGIC_RDESC_H */