]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/input/tablet/wacom_wac.h
Merge tag 'v3.15-rc5' into next
[karo-tx-linux.git] / drivers / input / tablet / wacom_wac.h
1 /*
2  * drivers/input/tablet/wacom_wac.h
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  */
9 #ifndef WACOM_WAC_H
10 #define WACOM_WAC_H
11
12 #include <linux/types.h>
13
14 /* maximum packet length for USB devices */
15 #define WACOM_PKGLEN_MAX        68
16
17 #define WACOM_NAME_MAX          64
18
19 /* packet length for individual models */
20 #define WACOM_PKGLEN_PENPRTN     7
21 #define WACOM_PKGLEN_GRAPHIRE    8
22 #define WACOM_PKGLEN_BBFUN       9
23 #define WACOM_PKGLEN_INTUOS     10
24 #define WACOM_PKGLEN_TPC1FG      5
25 #define WACOM_PKGLEN_TPC1FG_B   10
26 #define WACOM_PKGLEN_TPC2FG     14
27 #define WACOM_PKGLEN_BBTOUCH    20
28 #define WACOM_PKGLEN_BBTOUCH3   64
29 #define WACOM_PKGLEN_BBPEN      10
30 #define WACOM_PKGLEN_WIRELESS   32
31 #define WACOM_PKGLEN_MTOUCH     62
32 #define WACOM_PKGLEN_MTTPC      40
33 #define WACOM_PKGLEN_DTUS       68
34
35 /* wacom data size per MT contact */
36 #define WACOM_BYTES_PER_MT_PACKET       11
37 #define WACOM_BYTES_PER_24HDT_PACKET    14
38
39 /* device IDs */
40 #define STYLUS_DEVICE_ID        0x02
41 #define TOUCH_DEVICE_ID         0x03
42 #define CURSOR_DEVICE_ID        0x06
43 #define ERASER_DEVICE_ID        0x0A
44 #define PAD_DEVICE_ID           0x0F
45
46 /* wacom data packet report IDs */
47 #define WACOM_REPORT_PENABLED           2
48 #define WACOM_REPORT_INTUOSREAD         5
49 #define WACOM_REPORT_INTUOSWRITE        6
50 #define WACOM_REPORT_INTUOSPAD          12
51 #define WACOM_REPORT_INTUOS5PAD         3
52 #define WACOM_REPORT_DTUSPAD            21
53 #define WACOM_REPORT_TPC1FG             6
54 #define WACOM_REPORT_TPC2FG             13
55 #define WACOM_REPORT_TPCMT              13
56 #define WACOM_REPORT_TPCHID             15
57 #define WACOM_REPORT_TPCST              16
58 #define WACOM_REPORT_DTUS               17
59 #define WACOM_REPORT_TPC1FGE            18
60 #define WACOM_REPORT_24HDT              1
61 #define WACOM_REPORT_WL                 128
62 #define WACOM_REPORT_USB                192
63
64 /* device quirks */
65 #define WACOM_QUIRK_MULTI_INPUT         0x0001
66 #define WACOM_QUIRK_BBTOUCH_LOWRES      0x0002
67 #define WACOM_QUIRK_NO_INPUT            0x0004
68 #define WACOM_QUIRK_MONITOR             0x0008
69
70 enum {
71         PENPARTNER = 0,
72         GRAPHIRE,
73         WACOM_G4,
74         PTU,
75         PL,
76         DTU,
77         DTUS,
78         INTUOS,
79         INTUOS3S,
80         INTUOS3,
81         INTUOS3L,
82         INTUOS4S,
83         INTUOS4,
84         INTUOS4L,
85         INTUOS5S,
86         INTUOS5,
87         INTUOS5L,
88         INTUOSPS,
89         INTUOSPM,
90         INTUOSPL,
91         INTUOSHT,
92         WACOM_21UX2,
93         WACOM_22HD,
94         DTK,
95         WACOM_24HD,
96         CINTIQ_HYBRID,
97         CINTIQ,
98         WACOM_BEE,
99         WACOM_13HD,
100         WACOM_MO,
101         WIRELESS,
102         BAMBOO_PT,
103         WACOM_24HDT,
104         TABLETPC,   /* add new TPC below */
105         TABLETPCE,
106         TABLETPC2FG,
107         MTSCREEN,
108         MTTPC,
109         MAX_TYPE
110 };
111
112 struct wacom_features {
113         const char *name;
114         int pktlen;
115         int x_max;
116         int y_max;
117         int pressure_max;
118         int distance_max;
119         int type;
120         int x_resolution;
121         int y_resolution;
122         int device_type;
123         int x_phy;
124         int y_phy;
125         unsigned char unit;
126         unsigned char unitExpo;
127         int x_fuzz;
128         int y_fuzz;
129         int pressure_fuzz;
130         int distance_fuzz;
131         unsigned quirks;
132         unsigned touch_max;
133         int oVid;
134         int oPid;
135 };
136
137 struct wacom_shared {
138         bool stylus_in_proximity;
139         bool touch_down;
140         /* for wireless device to access USB interfaces */
141         unsigned touch_max;
142         int type;
143         struct input_dev *touch_input;
144 };
145
146 struct wacom_wac {
147         char name[WACOM_NAME_MAX];
148         unsigned char *data;
149         int tool[2];
150         int id[2];
151         __u32 serial[2];
152         struct wacom_features features;
153         struct wacom_shared *shared;
154         struct input_dev *input;
155         int pid;
156         int battery_capacity;
157         int num_contacts_left;
158 };
159
160 #endif