1
2
3
4
5
6
7
8 #ifndef _TRACKPOINT_H
9 #define _TRACKPOINT_H
10
11
12
13
14
15
16
17
18 #define TP_COMMAND 0xE2
19
20 #define TP_READ_ID 0xE1
21
22
23
24
25
26
27 #define TP_VARIANT_IBM 0x01
28 #define TP_VARIANT_ALPS 0x02
29 #define TP_VARIANT_ELAN 0x03
30 #define TP_VARIANT_NXP 0x04
31
32
33
34
35 #define TP_RECALIB 0x51
36 #define TP_POWER_DOWN 0x44
37 #define TP_EXT_DEV 0x21
38 #define TP_EXT_BTN 0x4B
39 #define TP_POR 0x7F
40 #define TP_POR_RESULTS 0x25
41 #define TP_DISABLE_EXT 0x40
42 #define TP_ENABLE_EXT 0x41
43
44
45
46
47 #define TP_SET_SOFT_TRANS 0x4E
48 #define TP_CANCEL_SOFT_TRANS 0xB9
49 #define TP_SET_HARD_TRANS 0x45
50
51
52
53
54
55 #define TP_WRITE_MEM 0x81
56 #define TP_READ_MEM 0x80
57
58
59
60
61 #define TP_SENS 0x4A
62 #define TP_MB 0x4C
63 #define TP_INERTIA 0x4D
64 #define TP_SPEED 0x60
65 #define TP_REACH 0x57
66 #define TP_DRAGHYS 0x58
67
68
69
70 #define TP_MINDRAG 0x59
71
72
73 #define TP_THRESH 0x5C
74 #define TP_UP_THRESH 0x5A
75 #define TP_Z_TIME 0x5E
76 #define TP_JENKS_CURV 0x5D
77 #define TP_DRIFT_TIME 0x5F
78
79
80
81
82
83
84 #define TP_TOGGLE 0x47
85
86 #define TP_TOGGLE_MB 0x23
87 #define TP_MASK_MB 0x01
88 #define TP_TOGGLE_EXT_DEV 0x23
89 #define TP_MASK_EXT_DEV 0x02
90 #define TP_TOGGLE_DRIFT 0x23
91 #define TP_MASK_DRIFT 0x80
92 #define TP_TOGGLE_BURST 0x28
93 #define TP_MASK_BURST 0x80
94 #define TP_TOGGLE_PTSON 0x2C
95 #define TP_MASK_PTSON 0x01
96 #define TP_TOGGLE_HARD_TRANS 0x2C
97 #define TP_MASK_HARD_TRANS 0x80
98 #define TP_TOGGLE_TWOHAND 0x2D
99 #define TP_MASK_TWOHAND 0x01
100 #define TP_TOGGLE_STICKY_TWO 0x2D
101 #define TP_MASK_STICKY_TWO 0x04
102 #define TP_TOGGLE_SKIPBACK 0x2D
103 #define TP_MASK_SKIPBACK 0x08
104 #define TP_TOGGLE_SOURCE_TAG 0x20
105
106 #define TP_MASK_SOURCE_TAG 0x80
107 #define TP_TOGGLE_EXT_TAG 0x22
108
109 #define TP_MASK_EXT_TAG 0x04
110
111
112
113 #define TP_POR_SUCCESS 0x3B
114
115
116
117
118 #define TP_DEF_SENS 0x80
119 #define TP_DEF_INERTIA 0x06
120 #define TP_DEF_SPEED 0x61
121 #define TP_DEF_REACH 0x0A
122
123 #define TP_DEF_DRAGHYS 0xFF
124 #define TP_DEF_MINDRAG 0x14
125
126 #define TP_DEF_THRESH 0x08
127 #define TP_DEF_UP_THRESH 0xFF
128 #define TP_DEF_Z_TIME 0x26
129 #define TP_DEF_JENKS_CURV 0x87
130 #define TP_DEF_DRIFT_TIME 0x05
131
132
133 #define TP_DEF_MB 0x00
134 #define TP_DEF_PTSON 0x00
135 #define TP_DEF_SKIPBACK 0x00
136 #define TP_DEF_EXT_DEV 0x00
137 #define TP_DEF_TWOHAND 0x00
138 #define TP_DEF_SOURCE_TAG 0x00
139
140 #define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
141
142 struct trackpoint_data {
143 u8 variant_id;
144 u8 firmware_id;
145
146 u8 sensitivity, speed, inertia, reach;
147 u8 draghys, mindrag;
148 u8 thresh, upthresh;
149 u8 ztime, jenks;
150 u8 drift_time;
151
152
153 bool press_to_select;
154 bool skipback;
155 bool ext_dev;
156 };
157
158 int trackpoint_detect(struct psmouse *psmouse, bool set_properties);
159
160 #endif