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