diff options
author | Éric Piel <E.A.B.Piel@tudelft.nl> | 2011-05-17 01:45:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-05-17 01:48:24 -0400 |
commit | 71c6d18859ccb137343017ec995b76d9f62bd9b0 (patch) | |
tree | ec41f95956a7107c65a6322210471e17aae3d89b /Documentation/input | |
parent | 215ef98677c3e43cefd2159d76543f368a7f87b9 (diff) |
Input: elantech - describe further the protocol
For some Dell laptops, Ubuntu had a special version of the elantech
driver with more knowledge on the devices. It can be found there:
http://zinc.ubuntu.com/git?p=mid-team/hardy-netbook.git;a=blob;f=drivers/input/mouse/elantech.c;h=d0e2cafed162428f72e3654f4dda85e08ea486b3;hb=refs/heads/abi-22
By inspecting the source code, and doing some test on a real hardware, I
have completed the protocol specification (especially for the 6 bytes
protocol). It also adds information about the mapping between the
version reported by the device and the protocol to use.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'Documentation/input')
-rw-r--r-- | Documentation/input/elantech.txt | 123 |
1 files changed, 100 insertions, 23 deletions
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt index 56941ae1f5db..db798af5ef98 100644 --- a/Documentation/input/elantech.txt +++ b/Documentation/input/elantech.txt | |||
@@ -34,7 +34,8 @@ Contents | |||
34 | Currently the Linux Elantech touchpad driver is aware of two different | 34 | Currently the Linux Elantech touchpad driver is aware of two different |
35 | hardware versions unimaginatively called version 1 and version 2. Version 1 | 35 | hardware versions unimaginatively called version 1 and version 2. Version 1 |
36 | is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to | 36 | is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to |
37 | be introduced with the EeePC and uses 6 bytes per packet. | 37 | be introduced with the EeePC and uses 6 bytes per packet, and provides |
38 | additional features such as position of two fingers, and width of the touch. | ||
38 | 39 | ||
39 | The driver tries to support both hardware versions and should be compatible | 40 | The driver tries to support both hardware versions and should be compatible |
40 | with the Xorg Synaptics touchpad driver and its graphical configuration | 41 | with the Xorg Synaptics touchpad driver and its graphical configuration |
@@ -94,18 +95,44 @@ Currently the Linux Elantech touchpad driver provides two extra knobs under | |||
94 | can check these bits and reject any packet that appears corrupted. Using | 95 | can check these bits and reject any packet that appears corrupted. Using |
95 | this knob you can bypass that check. | 96 | this knob you can bypass that check. |
96 | 97 | ||
97 | It is not known yet whether hardware version 2 provides the same parity | 98 | Hardware version 2 does not provide the same parity bits. Only some basic |
98 | bits. Hence checking is disabled by default. Currently even turning it on | 99 | data consistency checking can be done. For now checking is disabled by |
99 | will do nothing. | 100 | default. Currently even turning it on will do nothing. |
100 | |||
101 | 101 | ||
102 | ///////////////////////////////////////////////////////////////////////////// | 102 | ///////////////////////////////////////////////////////////////////////////// |
103 | 103 | ||
104 | 3. Differentiating hardware versions | ||
105 | ================================= | ||
106 | |||
107 | To detect the hardware version, read the version number as param[0].param[1].param[2] | ||
108 | |||
109 | 4 bytes version: (after the arrow is the name given in the Dell-provided driver) | ||
110 | 02.00.22 => EF013 | ||
111 | 02.06.00 => EF019 | ||
112 | In the wild, there appear to be more versions, such as 00.01.64, 01.00.21, | ||
113 | 02.00.00, 02.00.04, 02.00.06. | ||
114 | |||
115 | 6 bytes: | ||
116 | 02.00.30 => EF113 | ||
117 | 02.08.00 => EF023 | ||
118 | 02.08.XX => EF123 | ||
119 | 02.0B.00 => EF215 | ||
120 | 04.01.XX => Scroll_EF051 | ||
121 | 04.02.XX => EF051 | ||
122 | In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There | ||
123 | appears to be almost no difference, except for EF113, which does not report | ||
124 | pressure/width and has different data consistency checks. | ||
125 | |||
126 | Probably all the versions with param[0] <= 01 can be considered as | ||
127 | 4 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as | ||
128 | 4 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes. | ||
129 | |||
130 | ///////////////////////////////////////////////////////////////////////////// | ||
104 | 131 | ||
105 | 3. Hardware version 1 | 132 | 4. Hardware version 1 |
106 | ================== | 133 | ================== |
107 | 134 | ||
108 | 3.1 Registers | 135 | 4.1 Registers |
109 | ~~~~~~~~~ | 136 | ~~~~~~~~~ |
110 | 137 | ||
111 | By echoing a hexadecimal value to a register it contents can be altered. | 138 | By echoing a hexadecimal value to a register it contents can be altered. |
@@ -168,7 +195,7 @@ For example: | |||
168 | smart edge activation area width? | 195 | smart edge activation area width? |
169 | 196 | ||
170 | 197 | ||
171 | 3.2 Native relative mode 4 byte packet format | 198 | 4.2 Native relative mode 4 byte packet format |
172 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 199 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
173 | 200 | ||
174 | byte 0: | 201 | byte 0: |
@@ -226,9 +253,13 @@ byte 3: | |||
226 | positive = down | 253 | positive = down |
227 | 254 | ||
228 | 255 | ||
229 | 3.3 Native absolute mode 4 byte packet format | 256 | 4.3 Native absolute mode 4 byte packet format |
230 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 257 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
231 | 258 | ||
259 | EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and | ||
260 | when 1 finger is touching, the first 2 position reports must be discarded. | ||
261 | This counting is reset whenever a different number of fingers is reported. | ||
262 | |||
232 | byte 0: | 263 | byte 0: |
233 | firmware version 1.x: | 264 | firmware version 1.x: |
234 | 265 | ||
@@ -279,11 +310,11 @@ byte 3: | |||
279 | ///////////////////////////////////////////////////////////////////////////// | 310 | ///////////////////////////////////////////////////////////////////////////// |
280 | 311 | ||
281 | 312 | ||
282 | 4. Hardware version 2 | 313 | 5. Hardware version 2 |
283 | ================== | 314 | ================== |
284 | 315 | ||
285 | 316 | ||
286 | 4.1 Registers | 317 | 5.1 Registers |
287 | ~~~~~~~~~ | 318 | ~~~~~~~~~ |
288 | 319 | ||
289 | By echoing a hexadecimal value to a register it contents can be altered. | 320 | By echoing a hexadecimal value to a register it contents can be altered. |
@@ -316,16 +347,41 @@ For example: | |||
316 | 0x7f = never i.e. tap again to release) | 347 | 0x7f = never i.e. tap again to release) |
317 | 348 | ||
318 | 349 | ||
319 | 4.2 Native absolute mode 6 byte packet format | 350 | 5.2 Native absolute mode 6 byte packet format |
320 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 351 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
321 | 352 | 5.2.1 Parity checking and packet re-synchronization | |
322 | 4.2.1 One finger touch | 353 | There is no parity checking, however some consistency checks can be performed. |
354 | |||
355 | For instance for EF113: | ||
356 | SA1= packet[0]; | ||
357 | A1 = packet[1]; | ||
358 | B1 = packet[2]; | ||
359 | SB1= packet[3]; | ||
360 | C1 = packet[4]; | ||
361 | D1 = packet[5]; | ||
362 | if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1 | ||
363 | (((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed) | ||
364 | (((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2 | ||
365 | (((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4 | ||
366 | (((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed) | ||
367 | (((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00)) ) // check Byte 5 | ||
368 | // error detected | ||
369 | |||
370 | For all the other ones, there are just a few constant bits: | ||
371 | if( ((packet[0] & 0x0C) != 0x04) || | ||
372 | ((packet[3] & 0x0f) != 0x02) ) | ||
373 | // error detected | ||
374 | |||
375 | |||
376 | In case an error is detected, all the packets are shifted by one (and packet[0] is discarded). | ||
377 | |||
378 | 5.2.1 One/Three finger touch | ||
323 | ~~~~~~~~~~~~~~~~ | 379 | ~~~~~~~~~~~~~~~~ |
324 | 380 | ||
325 | byte 0: | 381 | byte 0: |
326 | 382 | ||
327 | bit 7 6 5 4 3 2 1 0 | 383 | bit 7 6 5 4 3 2 1 0 |
328 | n1 n0 . . . . R L | 384 | n1 n0 w3 w2 . . R L |
329 | 385 | ||
330 | L, R = 1 when Left, Right mouse button pressed | 386 | L, R = 1 when Left, Right mouse button pressed |
331 | n1..n0 = numbers of fingers on touchpad | 387 | n1..n0 = numbers of fingers on touchpad |
@@ -333,24 +389,40 @@ byte 0: | |||
333 | byte 1: | 389 | byte 1: |
334 | 390 | ||
335 | bit 7 6 5 4 3 2 1 0 | 391 | bit 7 6 5 4 3 2 1 0 |
336 | . . . . . x10 x9 x8 | 392 | p7 p6 p5 p4 . x10 x9 x8 |
337 | 393 | ||
338 | byte 2: | 394 | byte 2: |
339 | 395 | ||
340 | bit 7 6 5 4 3 2 1 0 | 396 | bit 7 6 5 4 3 2 1 0 |
341 | x7 x6 x5 x4 x4 x2 x1 x0 | 397 | x7 x6 x5 x4 x3 x2 x1 x0 |
342 | 398 | ||
343 | x10..x0 = absolute x value (horizontal) | 399 | x10..x0 = absolute x value (horizontal) |
344 | 400 | ||
345 | byte 3: | 401 | byte 3: |
346 | 402 | ||
347 | bit 7 6 5 4 3 2 1 0 | 403 | bit 7 6 5 4 3 2 1 0 |
348 | . . . . . . . . | 404 | n4 vf w1 w0 . . . b2 |
405 | |||
406 | n4 = set if more than 3 fingers (only in 3 fingers mode) | ||
407 | vf = a kind of flag ? (only on EF123, 0 when finger is over one | ||
408 | of the buttons, 1 otherwise) | ||
409 | w3..w0 = width of the finger touch (not EF113) | ||
410 | b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed: | ||
411 | 0 = none | ||
412 | 1 = Left | ||
413 | 2 = Right | ||
414 | 3 = Middle (Left and Right) | ||
415 | 4 = Forward | ||
416 | 5 = Back | ||
417 | 6 = Another one | ||
418 | 7 = Another one | ||
349 | 419 | ||
350 | byte 4: | 420 | byte 4: |
351 | 421 | ||
352 | bit 7 6 5 4 3 2 1 0 | 422 | bit 7 6 5 4 3 2 1 0 |
353 | . . . . . . y9 y8 | 423 | p3 p1 p2 p0 . . y9 y8 |
424 | |||
425 | p7..p0 = pressure (not EF113) | ||
354 | 426 | ||
355 | byte 5: | 427 | byte 5: |
356 | 428 | ||
@@ -363,6 +435,11 @@ byte 5: | |||
363 | 4.2.2 Two finger touch | 435 | 4.2.2 Two finger touch |
364 | ~~~~~~~~~~~~~~~~ | 436 | ~~~~~~~~~~~~~~~~ |
365 | 437 | ||
438 | Note that the two pairs of coordinates are not exactly the coordinates of the | ||
439 | two fingers, but only the pair of the lower-left and upper-right coordinates. | ||
440 | So the actual fingers might be situated on the other diagonal of the square | ||
441 | defined by these two points. | ||
442 | |||
366 | byte 0: | 443 | byte 0: |
367 | 444 | ||
368 | bit 7 6 5 4 3 2 1 0 | 445 | bit 7 6 5 4 3 2 1 0 |
@@ -376,14 +453,14 @@ byte 1: | |||
376 | bit 7 6 5 4 3 2 1 0 | 453 | bit 7 6 5 4 3 2 1 0 |
377 | ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 | 454 | ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 |
378 | 455 | ||
379 | ax8..ax0 = first finger absolute x value | 456 | ax8..ax0 = lower-left finger absolute x value |
380 | 457 | ||
381 | byte 2: | 458 | byte 2: |
382 | 459 | ||
383 | bit 7 6 5 4 3 2 1 0 | 460 | bit 7 6 5 4 3 2 1 0 |
384 | ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 | 461 | ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 |
385 | 462 | ||
386 | ay8..ay0 = first finger absolute y value | 463 | ay8..ay0 = lower-left finger absolute y value |
387 | 464 | ||
388 | byte 3: | 465 | byte 3: |
389 | 466 | ||
@@ -395,11 +472,11 @@ byte 4: | |||
395 | bit 7 6 5 4 3 2 1 0 | 472 | bit 7 6 5 4 3 2 1 0 |
396 | bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 | 473 | bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 |
397 | 474 | ||
398 | bx8..bx0 = second finger absolute x value | 475 | bx8..bx0 = upper-right finger absolute x value |
399 | 476 | ||
400 | byte 5: | 477 | byte 5: |
401 | 478 | ||
402 | bit 7 6 5 4 3 2 1 0 | 479 | bit 7 6 5 4 3 2 1 0 |
403 | by7 by8 by5 by4 by3 by2 by1 by0 | 480 | by7 by8 by5 by4 by3 by2 by1 by0 |
404 | 481 | ||
405 | by8..by0 = second finger absolute y value | 482 | by8..by0 = upper-right finger absolute y value |