Commit 28f49616 authored by JJ Ding's avatar JJ Ding Committed by Dmitry Torokhov

Input: elantech - add v3 hardware support

v3 hardware's packet format is almost identical to v2 (one/three finger touch),
except when sensing two finger touch, the hardware sends 12 bytes of data.
Signed-off-by: default avatarJJ Ding <jj_ding@emc.com.tw>
Acked-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
Acked-by: default avatarÉric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 3c8bbb95
...@@ -16,15 +16,22 @@ Contents ...@@ -16,15 +16,22 @@ Contents
1. Introduction 1. Introduction
2. Extra knobs 2. Extra knobs
3. Hardware version 1 3. Differentiating hardware versions
3.1 Registers 4. Hardware version 1
3.2 Native relative mode 4 byte packet format
3.3 Native absolute mode 4 byte packet format
4. Hardware version 2
4.1 Registers 4.1 Registers
4.2 Native absolute mode 6 byte packet format 4.2 Native relative mode 4 byte packet format
4.2.1 One finger touch 4.3 Native absolute mode 4 byte packet format
4.2.2 Two finger touch 5. Hardware version 2
5.1 Registers
5.2 Native absolute mode 6 byte packet format
5.2.1 Parity checking and packet re-synchronization
5.2.2 One/Three finger touch
5.2.3 Two finger touch
6. Hardware version 3
6.1 Registers
6.2 Native absolute mode 6 byte packet format
6.2.1 One/Three finger touch
6.2.2 Two finger touch
...@@ -375,7 +382,7 @@ For all the other ones, there are just a few constant bits: ...@@ -375,7 +382,7 @@ For all the other ones, there are just a few constant bits:
In case an error is detected, all the packets are shifted by one (and packet[0] is discarded). In case an error is detected, all the packets are shifted by one (and packet[0] is discarded).
5.2.1 One/Three finger touch 5.2.2 One/Three finger touch
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
byte 0: byte 0:
...@@ -384,7 +391,7 @@ byte 0: ...@@ -384,7 +391,7 @@ byte 0:
n1 n0 w3 w2 . . R L n1 n0 w3 w2 . . R L
L, R = 1 when Left, Right mouse button pressed L, R = 1 when Left, Right mouse button pressed
n1..n0 = numbers of fingers on touchpad n1..n0 = number of fingers on touchpad
byte 1: byte 1:
...@@ -432,7 +439,7 @@ byte 5: ...@@ -432,7 +439,7 @@ byte 5:
y11..y0 = absolute y value (vertical) y11..y0 = absolute y value (vertical)
4.2.2 Two finger touch 5.2.3 Two finger touch
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
Note that the two pairs of coordinates are not exactly the coordinates of the Note that the two pairs of coordinates are not exactly the coordinates of the
...@@ -446,7 +453,7 @@ byte 0: ...@@ -446,7 +453,7 @@ byte 0:
n1 n0 ay8 ax8 . . R L n1 n0 ay8 ax8 . . R L
L, R = 1 when Left, Right mouse button pressed L, R = 1 when Left, Right mouse button pressed
n1..n0 = numbers of fingers on touchpad n1..n0 = number of fingers on touchpad
byte 1: byte 1:
...@@ -480,3 +487,89 @@ byte 5: ...@@ -480,3 +487,89 @@ byte 5:
by7 by8 by5 by4 by3 by2 by1 by0 by7 by8 by5 by4 by3 by2 by1 by0
by8..by0 = upper-right finger absolute y value by8..by0 = upper-right finger absolute y value
/////////////////////////////////////////////////////////////////////////////
6. Hardware version 3
==================
6.1 Registers
~~~~~~~~~
* reg_10
bit 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 A
A: 1 = enable absolute tracking
6.2 Native absolute mode 6 byte packet format
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 and 3 finger touch shares the same 6-byte packet format, except that
3 finger touch only reports the position of the center of all three fingers.
Firmware would send 12 bytes of data for 2 finger touch.
Note on debounce:
In case the box has unstable power supply or other electricity issues, or
when number of finger changes, F/W would send "debounce packet" to inform
driver that the hardware is in debounce status.
The debouce packet has the following signature:
byte 0: 0xc4
byte 1: 0xff
byte 2: 0xff
byte 3: 0x02
byte 4: 0xff
byte 5: 0xff
When we encounter this kind of packet, we just ignore it.
6.2.1 One/Three finger touch
~~~~~~~~~~~~~~~~~~~~~~
byte 0:
bit 7 6 5 4 3 2 1 0
n1 n0 w3 w2 0 1 R L
L, R = 1 when Left, Right mouse button pressed
n1..n0 = number of fingers on touchpad
byte 1:
bit 7 6 5 4 3 2 1 0
p7 p6 p5 p4 x11 x10 x9 x8
byte 2:
bit 7 6 5 4 3 2 1 0
x7 x6 x5 x4 x3 x2 x1 x0
x11..x0 = absolute x value (horizontal)
byte 3:
bit 7 6 5 4 3 2 1 0
0 0 w1 w0 0 0 1 0
w3..w0 = width of the finger touch
byte 4:
bit 7 6 5 4 3 2 1 0
p3 p1 p2 p0 y11 y10 y9 y8
p7..p0 = pressure
byte 5:
bit 7 6 5 4 3 2 1 0
y7 y6 y5 y4 y3 y2 y1 y0
y11..y0 = absolute y value (vertical)
6.2.2 Two finger touch
~~~~~~~~~~~~~~~~
The packet format is exactly the same for two finger touch, except the hardware
sends two 6 byte packets. The first packet contains data for the first finger,
the second packet has data for the second finger. So for two finger touch a
total of 12 bytes are sent.
This diff is collapsed.
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
/* /*
* Command values for Synaptics style queries * Command values for Synaptics style queries
*/ */
#define ETP_FW_ID_QUERY 0x00
#define ETP_FW_VERSION_QUERY 0x01 #define ETP_FW_VERSION_QUERY 0x01
#define ETP_CAPABILITIES_QUERY 0x02 #define ETP_CAPABILITIES_QUERY 0x02
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
*/ */
#define ETP_REGISTER_READ 0x10 #define ETP_REGISTER_READ 0x10
#define ETP_REGISTER_WRITE 0x11 #define ETP_REGISTER_WRITE 0x11
#define ETP_REGISTER_READWRITE 0x00
/* /*
* Hardware version 2 custom PS/2 command value * Hardware version 2 custom PS/2 command value
...@@ -79,6 +81,14 @@ ...@@ -79,6 +81,14 @@
#define ETP_WMIN_V2 0 #define ETP_WMIN_V2 0
#define ETP_WMAX_V2 15 #define ETP_WMAX_V2 15
/*
* v3 hardware has 2 kinds of packet types.
*/
#define PACKET_UNKNOWN 0x01
#define PACKET_DEBOUNCE 0x02
#define PACKET_V3_HEAD 0x03
#define PACKET_V3_TAIL 0x04
struct elantech_data { struct elantech_data {
unsigned char reg_10; unsigned char reg_10;
unsigned char reg_11; unsigned char reg_11;
...@@ -98,6 +108,8 @@ struct elantech_data { ...@@ -98,6 +108,8 @@ struct elantech_data {
unsigned int fw_version; unsigned int fw_version;
unsigned int single_finger_reports; unsigned int single_finger_reports;
unsigned int y_max; unsigned int y_max;
unsigned int prev_x;
unsigned int prev_y;
unsigned char parity[256]; unsigned char parity[256];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment