This source file includes following definitions.
- elantech_init
1
2
3
4
5
6
7
8
9
10 #ifndef _ELANTECH_H
11 #define _ELANTECH_H
12
13
14
15
16 #define ETP_FW_ID_QUERY 0x00
17 #define ETP_FW_VERSION_QUERY 0x01
18 #define ETP_CAPABILITIES_QUERY 0x02
19 #define ETP_SAMPLE_QUERY 0x03
20 #define ETP_RESOLUTION_QUERY 0x04
21
22
23
24
25 #define ETP_REGISTER_READ 0x10
26 #define ETP_REGISTER_WRITE 0x11
27 #define ETP_REGISTER_READWRITE 0x00
28
29
30
31
32 #define ETP_PS2_CUSTOM_COMMAND 0xf8
33
34
35
36
37 #define ETP_PS2_COMMAND_TRIES 3
38 #define ETP_PS2_COMMAND_DELAY 500
39
40
41
42
43 #define ETP_READ_BACK_TRIES 5
44 #define ETP_READ_BACK_DELAY 2000
45
46
47
48
49 #define ETP_R10_ABSOLUTE_MODE 0x04
50 #define ETP_R11_4_BYTE_MODE 0x02
51
52
53
54
55 #define ETP_CAP_HAS_ROCKER 0x04
56
57
58
59
60
61
62 #define ETP_EDGE_FUZZ_V1 32
63
64 #define ETP_XMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1)
65 #define ETP_XMAX_V1 (576 - ETP_EDGE_FUZZ_V1)
66 #define ETP_YMIN_V1 ( 0 + ETP_EDGE_FUZZ_V1)
67 #define ETP_YMAX_V1 (384 - ETP_EDGE_FUZZ_V1)
68
69
70
71
72
73 #define ETP_XMIN_V2 0
74 #define ETP_XMAX_V2 1152
75 #define ETP_YMIN_V2 0
76 #define ETP_YMAX_V2 768
77
78 #define ETP_PMIN_V2 0
79 #define ETP_PMAX_V2 255
80 #define ETP_WMIN_V2 0
81 #define ETP_WMAX_V2 15
82
83
84
85
86
87 #define PACKET_UNKNOWN 0x01
88 #define PACKET_DEBOUNCE 0x02
89 #define PACKET_V3_HEAD 0x03
90 #define PACKET_V3_TAIL 0x04
91 #define PACKET_V4_HEAD 0x05
92 #define PACKET_V4_MOTION 0x06
93 #define PACKET_V4_STATUS 0x07
94 #define PACKET_TRACKPOINT 0x08
95
96
97
98
99 #define ETP_MAX_FINGERS 5
100
101
102
103
104 #define ETP_WEIGHT_VALUE 5
105
106
107
108
109 #define ETP_BUS_PS2_ONLY 0
110 #define ETP_BUS_SMB_ALERT_ONLY 1
111 #define ETP_BUS_SMB_HST_NTFY_ONLY 2
112 #define ETP_BUS_PS2_SMB_ALERT 3
113 #define ETP_BUS_PS2_SMB_HST_NTFY 4
114
115
116
117
118
119
120
121
122
123
124
125
126 #define ETP_NEW_IC_SMBUS_HOST_NOTIFY(fw_version) \
127 ((((fw_version) & 0x0f2000) == 0x0f2000) && \
128 ((fw_version) & 0x0000ff) > 0)
129
130
131
132
133 struct finger_pos {
134 unsigned int x;
135 unsigned int y;
136 };
137
138 struct elantech_device_info {
139 unsigned char capabilities[3];
140 unsigned char samples[3];
141 unsigned char debug;
142 unsigned char hw_version;
143 unsigned int fw_version;
144 unsigned int x_min;
145 unsigned int y_min;
146 unsigned int x_max;
147 unsigned int y_max;
148 unsigned int x_res;
149 unsigned int y_res;
150 unsigned int x_traces;
151 unsigned int y_traces;
152 unsigned int width;
153 unsigned int bus;
154 bool paritycheck;
155 bool jumpy_cursor;
156 bool reports_pressure;
157 bool crc_enabled;
158 bool set_hw_resolution;
159 bool has_trackpoint;
160 bool has_middle_button;
161 int (*send_cmd)(struct psmouse *psmouse, unsigned char c,
162 unsigned char *param);
163 };
164
165 struct elantech_data {
166 struct input_dev *tp_dev;
167 char tp_phys[32];
168 unsigned char reg_07;
169 unsigned char reg_10;
170 unsigned char reg_11;
171 unsigned char reg_20;
172 unsigned char reg_21;
173 unsigned char reg_22;
174 unsigned char reg_23;
175 unsigned char reg_24;
176 unsigned char reg_25;
177 unsigned char reg_26;
178 unsigned int single_finger_reports;
179 unsigned int y_max;
180 unsigned int width;
181 struct finger_pos mt[ETP_MAX_FINGERS];
182 unsigned char parity[256];
183 struct elantech_device_info info;
184 void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
185 };
186
187 int elantech_detect(struct psmouse *psmouse, bool set_properties);
188 int elantech_init_ps2(struct psmouse *psmouse);
189
190 #ifdef CONFIG_MOUSE_PS2_ELANTECH
191 int elantech_init(struct psmouse *psmouse);
192 #else
193 static inline int elantech_init(struct psmouse *psmouse)
194 {
195 return -ENOSYS;
196 }
197 #endif
198
199 int elantech_init_smbus(struct psmouse *psmouse);
200
201 #endif