]> Pileus Git - ~andy/linux/blob - drivers/input/tablet/wacom_wac.h
fd23a3790605070a41ec37f19eff051b0e89be5a
[~andy/linux] / 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        64
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_TPC2FG     14
26 #define WACOM_PKGLEN_BBTOUCH    20
27 #define WACOM_PKGLEN_BBTOUCH3   64
28 #define WACOM_PKGLEN_BBPEN      10
29 #define WACOM_PKGLEN_WIRELESS   32
30 #define WACOM_PKGLEN_MTOUCH     62
31 #define WACOM_PKGLEN_MTTPC      40
32
33 /* wacom data size per MT contact */
34 #define WACOM_BYTES_PER_MT_PACKET       11
35 #define WACOM_BYTES_PER_24HDT_PACKET    14
36
37 /* device IDs */
38 #define STYLUS_DEVICE_ID        0x02
39 #define TOUCH_DEVICE_ID         0x03
40 #define CURSOR_DEVICE_ID        0x06
41 #define ERASER_DEVICE_ID        0x0A
42 #define PAD_DEVICE_ID           0x0F
43
44 /* wacom data packet report IDs */
45 #define WACOM_REPORT_PENABLED           2
46 #define WACOM_REPORT_INTUOSREAD         5
47 #define WACOM_REPORT_INTUOSWRITE        6
48 #define WACOM_REPORT_INTUOSPAD          12
49 #define WACOM_REPORT_INTUOS5PAD         3
50 #define WACOM_REPORT_TPC1FG             6
51 #define WACOM_REPORT_TPC2FG             13
52 #define WACOM_REPORT_TPCMT              13
53 #define WACOM_REPORT_TPCHID             15
54 #define WACOM_REPORT_TPCST              16
55 #define WACOM_REPORT_TPC1FGE            18
56 #define WACOM_REPORT_24HDT              1
57
58 /* device quirks */
59 #define WACOM_QUIRK_MULTI_INPUT         0x0001
60 #define WACOM_QUIRK_BBTOUCH_LOWRES      0x0002
61 #define WACOM_QUIRK_NO_INPUT            0x0004
62 #define WACOM_QUIRK_MONITOR             0x0008
63
64 enum {
65         PENPARTNER = 0,
66         GRAPHIRE,
67         WACOM_G4,
68         PTU,
69         PL,
70         DTU,
71         INTUOS,
72         INTUOS3S,
73         INTUOS3,
74         INTUOS3L,
75         INTUOS4S,
76         INTUOS4,
77         INTUOS4L,
78         INTUOS5S,
79         INTUOS5,
80         INTUOS5L,
81         INTUOSPS,
82         INTUOSPM,
83         INTUOSPL,
84         WACOM_21UX2,
85         WACOM_22HD,
86         DTK,
87         WACOM_24HD,
88         CINTIQ_HYBRID,
89         CINTIQ,
90         WACOM_BEE,
91         WACOM_13HD,
92         WACOM_MO,
93         WIRELESS,
94         BAMBOO_PT,
95         WACOM_24HDT,
96         TABLETPC,   /* add new TPC below */
97         TABLETPCE,
98         TABLETPC2FG,
99         MTSCREEN,
100         MTTPC,
101         MAX_TYPE
102 };
103
104 struct wacom_features {
105         const char *name;
106         int pktlen;
107         int x_max;
108         int y_max;
109         int pressure_max;
110         int distance_max;
111         int type;
112         int x_resolution;
113         int y_resolution;
114         int device_type;
115         int x_phy;
116         int y_phy;
117         unsigned char unit;
118         unsigned char unitExpo;
119         int x_fuzz;
120         int y_fuzz;
121         int pressure_fuzz;
122         int distance_fuzz;
123         unsigned quirks;
124         unsigned touch_max;
125         int oVid;
126         int oPid;
127 };
128
129 struct wacom_shared {
130         bool stylus_in_proximity;
131         bool touch_down;
132 };
133
134 struct wacom_wac {
135         char name[WACOM_NAME_MAX];
136         unsigned char *data;
137         int tool[2];
138         int id[2];
139         __u32 serial[2];
140         struct wacom_features features;
141         struct wacom_shared *shared;
142         struct input_dev *input;
143         int pid;
144         int battery_capacity;
145         int num_contacts_left;
146 };
147
148 #endif