blob: f205254a733c034b6d225d80905e8ed4990ce592 [file] [log] [blame]
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * HID driver for UC-Logic devices not fully compliant with HID standard
4 * - original and fixed report descriptors
5 *
6 * Copyright (c) 2010-2018 Nikolai Kondrashov
7 * Copyright (c) 2013 Martin Rusko
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation; either version 2 of the License, or (at your option)
14 * any later version.
15 */
16
17#ifndef _HID_UCLOGIC_RDESC_H
18#define _HID_UCLOGIC_RDESC_H
19
20#include <linux/usb.h>
21
22/* Size of the original descriptor of WPXXXXU tablets */
23#define UCLOGIC_RDESC_WPXXXXU_ORIG_SIZE 212
24
25/* Fixed WP4030U report descriptor */
26extern __u8 uclogic_rdesc_wp4030u_fixed_arr[];
27extern const size_t uclogic_rdesc_wp4030u_fixed_size;
28
29/* Fixed WP5540U report descriptor */
30extern __u8 uclogic_rdesc_wp5540u_fixed_arr[];
31extern const size_t uclogic_rdesc_wp5540u_fixed_size;
32
33/* Fixed WP8060U report descriptor */
34extern __u8 uclogic_rdesc_wp8060u_fixed_arr[];
35extern const size_t uclogic_rdesc_wp8060u_fixed_size;
36
37/* Size of the original descriptor of WP1062 tablet */
38#define UCLOGIC_RDESC_WP1062_ORIG_SIZE 254
39
40/* Fixed WP1062 report descriptor */
41extern __u8 uclogic_rdesc_wp1062_fixed_arr[];
42extern const size_t uclogic_rdesc_wp1062_fixed_size;
43
44/* Size of the original descriptor of PF1209 tablet */
45#define UCLOGIC_RDESC_PF1209_ORIG_SIZE 234
46
47/* Fixed PF1209 report descriptor */
48extern __u8 uclogic_rdesc_pf1209_fixed_arr[];
49extern const size_t uclogic_rdesc_pf1209_fixed_size;
50
51/* Size of the original descriptors of TWHL850 tablet */
52#define UCLOGIC_RDESC_TWHL850_ORIG0_SIZE 182
53#define UCLOGIC_RDESC_TWHL850_ORIG1_SIZE 161
54#define UCLOGIC_RDESC_TWHL850_ORIG2_SIZE 92
55
56/* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */
57extern __u8 uclogic_rdesc_twhl850_fixed0_arr[];
58extern const size_t uclogic_rdesc_twhl850_fixed0_size;
59
60/* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */
61extern __u8 uclogic_rdesc_twhl850_fixed1_arr[];
62extern const size_t uclogic_rdesc_twhl850_fixed1_size;
63
64/* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */
65extern __u8 uclogic_rdesc_twhl850_fixed2_arr[];
66extern const size_t uclogic_rdesc_twhl850_fixed2_size;
67
68/* Size of the original descriptors of TWHA60 tablet */
69#define UCLOGIC_RDESC_TWHA60_ORIG0_SIZE 254
70#define UCLOGIC_RDESC_TWHA60_ORIG1_SIZE 139
71
72/* Fixed TWHA60 report descriptor, interface 0 (stylus) */
73extern __u8 uclogic_rdesc_twha60_fixed0_arr[];
74extern const size_t uclogic_rdesc_twha60_fixed0_size;
75
76/* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */
77extern __u8 uclogic_rdesc_twha60_fixed1_arr[];
78extern const size_t uclogic_rdesc_twha60_fixed1_size;
79
80/* Report descriptor template placeholder head */
81#define UCLOGIC_RDESC_PH_HEAD 0xFE, 0xED, 0x1D
82
83/* Apply report descriptor parameters to a report descriptor template */
84extern __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr,
85 size_t template_size,
86 const s32 *param_list,
87 size_t param_num);
88
89/* Pen report descriptor template placeholder IDs */
90enum uclogic_rdesc_pen_ph_id {
91 UCLOGIC_RDESC_PEN_PH_ID_X_LM,
92 UCLOGIC_RDESC_PEN_PH_ID_X_PM,
93 UCLOGIC_RDESC_PEN_PH_ID_Y_LM,
94 UCLOGIC_RDESC_PEN_PH_ID_Y_PM,
95 UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM,
96 UCLOGIC_RDESC_PEN_PH_ID_NUM
97};
98
99/* Report descriptor pen template placeholder */
100#define UCLOGIC_RDESC_PEN_PH(_ID) \
101 UCLOGIC_RDESC_PH_HEAD, UCLOGIC_RDESC_PEN_PH_ID_##_ID
102
Nikolai Kondrashoveecb5b82019-02-10 12:13:53 +0200103/* Report ID for v1 pen reports */
104#define UCLOGIC_RDESC_PEN_V1_ID 0x07
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +0200105
Nikolai Kondrashoveecb5b82019-02-10 12:13:53 +0200106/* Fixed report descriptor template for (tweaked) v1 pen reports */
107extern const __u8 uclogic_rdesc_pen_v1_template_arr[];
108extern const size_t uclogic_rdesc_pen_v1_template_size;
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +0200109
Nikolai Kondrashov2c3a88c2019-02-10 12:13:56 +0200110/* Report ID for v2 pen reports */
111#define UCLOGIC_RDESC_PEN_V2_ID 0x08
112
113/* Fixed report descriptor template for (tweaked) v2 pen reports */
114extern const __u8 uclogic_rdesc_pen_v2_template_arr[];
115extern const size_t uclogic_rdesc_pen_v2_template_size;
116
Nikolai Kondrashoveecb5b82019-02-10 12:13:53 +0200117/* Fixed report descriptor for (tweaked) v1 buttonpad reports */
118extern const __u8 uclogic_rdesc_buttonpad_v1_arr[];
119extern const size_t uclogic_rdesc_buttonpad_v1_size;
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +0200120
Nikolai Kondrashoveecb5b82019-02-10 12:13:53 +0200121/* Report ID for tweaked v1 buttonpad reports */
122#define UCLOGIC_RDESC_BUTTONPAD_V1_ID 0xf7
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +0200123
Nikolai Kondrashov2c3a88c2019-02-10 12:13:56 +0200124/* Fixed report descriptor for (tweaked) v2 buttonpad reports */
125extern const __u8 uclogic_rdesc_buttonpad_v2_arr[];
126extern const size_t uclogic_rdesc_buttonpad_v2_size;
127
128/* Report ID for tweaked v2 buttonpad reports */
129#define UCLOGIC_RDESC_BUTTONPAD_V2_ID 0xf7
130
Nikolai Kondrashovff0c13d2019-02-10 12:13:50 +0200131#endif /* _HID_UCLOGIC_RDESC_H */