Thread (74 messages) 74 messages, 10 authors, 2011-09-07

Re: [PATCH 6/6] Input: elantech - add v3 hardware support

From: JJ Ding <hidden>
Date: 2011-08-18 05:37:28
Also in: linux-input

Hi Daniel,

On Thu, 18 Aug 2011 10:57:57 +0800, Daniel Kurtz [off-list ref] wrote:
On Thu, Aug 18, 2011 at 9:57 AM, JJ Ding [off-list ref] wrote:
quoted
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: JJ Ding <redacted>
---
 Documentation/input/elantech.txt |  104 ++++++++++++++++--
 drivers/input/mouse/elantech.c   |  218 ++++++++++++++++++++++++++++++++++---
 drivers/input/mouse/elantech.h   |   11 ++
 3 files changed, 303 insertions(+), 30 deletions(-)

+/*
+ * firmware tells us there's noise.
+ */
+static inline int debounce(unsigned int x, unsigned int y)
+{
+       return (x == 0xfff) && (y == 0xfff);
Perhaps you could document this behavior in the elantech.txt.
OK, I will do that.
quoted
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index 4b7447e..4f01fc6 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -16,6 +16,7 @@
 /*
 * Command values for Synaptics style queries
 */
+#define ETP_FW_ID_QUERY                        0x00
One tab too many?
quoted
 #define ETP_FW_VERSION_QUERY           0x01
 #define ETP_CAPABILITIES_QUERY         0x02
@@ -24,6 +25,7 @@
 */
 #define ETP_REGISTER_READ              0x10
 #define ETP_REGISTER_WRITE             0x11
+#define ETP_REGISTER_READWRITE         0x00

 /*
 * Hardware version 2 custom PS/2 command value
@@ -93,6 +95,13 @@
 #define ETP_2FT_YMIN                   (  0 + ETP_2FT_FUZZ)
 #define ETP_2FT_YMAX                   (192 - ETP_2FT_FUZZ)

+/*
+ * v3 hardware has 2 kinds of packet types.
+ */
+#define PACKET_UNKNOWN                 0x01
+#define PACKET_V3_HEAD                 0x02
+#define PACKET_V3_TAIL                 0x03
+
 struct elantech_data {
       unsigned char reg_10;
       unsigned char reg_11;
@@ -113,6 +122,8 @@ struct elantech_data {
       unsigned int single_finger_reports;
       unsigned int y_max;
       unsigned int y_2ft_max;
+       unsigned int prev_x;
+       unsigned int prev_y;
       unsigned char parity[256];
 };

--
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help