[kernel/f19] Add support for elantech v7 devices (rhbz 969473)

Josh Boyer jwboyer at fedoraproject.org
Mon Jul 29 12:30:58 UTC 2013


commit afb79ca6239d622c9b929bd9e238d5536292cc41
Author: Josh Boyer <jwboyer at redhat.com>
Date:   Mon Jul 29 08:29:29 2013 -0400

    Add support for elantech v7 devices (rhbz 969473)

 ...antech-fix-for-newer-hardware-versions-v7.patch |   70 ++++++++++++++++++++
 kernel.spec                                        |    9 +++
 2 files changed, 79 insertions(+), 0 deletions(-)
---
diff --git a/Input-elantech-fix-for-newer-hardware-versions-v7.patch b/Input-elantech-fix-for-newer-hardware-versions-v7.patch
new file mode 100644
index 0000000..b9495d7
--- /dev/null
+++ b/Input-elantech-fix-for-newer-hardware-versions-v7.patch
@@ -0,0 +1,70 @@
+From 9eebed7de660c0b5ab129a9de4f89d20b60de68c Mon Sep 17 00:00:00 2001
+From: Matteo Delfino <kendatsuba at gmail.com>
+Date: Sat, 6 Jul 2013 21:52:26 -0700
+Subject: [PATCH] Input: elantech - fix for newer hardware versions (v7)
+
+* Fix version recognition in elantech_set_properties
+
+  The new hardware reports itself as v7 but the packets'
+  structure is unaltered.
+
+* Fix packet type recognition in elantech_packet_check_v4
+
+  The bitmask used for v6 is too wide, only the last three bits of
+  the third byte in a packet (packet[3] & 0x03) are actually used to
+  distinguish between packet types.
+  Starting from v7, additional information (to be interpreted) is
+  stored in the remaining bits (packets[3] & 0x1c).
+  In addition, the value stored in (packet[0] & 0x0c) is no longer
+  a constant but contains additional information yet to be deciphered.
+  This change should be backwards compatible with v6 hardware.
+
+Additional-author: Giovanni Frigione <gio.frigione at gmail.com>
+Signed-off-by: Matteo Delfino <kendatsuba at gmail.com>
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+---
+ drivers/input/mouse/elantech.c | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index 1e8e42f..57b2637 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -694,18 +694,18 @@ static int elantech_packet_check_v3(struct psmouse *psmouse)
+ static int elantech_packet_check_v4(struct psmouse *psmouse)
+ {
+ 	unsigned char *packet = psmouse->packet;
++	unsigned char packet_type = packet[3] & 0x03;
+ 
+-	if ((packet[0] & 0x0c) == 0x04 &&
+-	    (packet[3] & 0x1f) == 0x11)
++	switch (packet_type) {
++	case 0:
++		return PACKET_V4_STATUS;
++
++	case 1:
+ 		return PACKET_V4_HEAD;
+ 
+-	if ((packet[0] & 0x0c) == 0x04 &&
+-	    (packet[3] & 0x1f) == 0x12)
++	case 2:
+ 		return PACKET_V4_MOTION;
+-
+-	if ((packet[0] & 0x0c) == 0x04 &&
+-	    (packet[3] & 0x1f) == 0x10)
+-		return PACKET_V4_STATUS;
++	}
+ 
+ 	return PACKET_UNKNOWN;
+ }
+@@ -1282,6 +1282,7 @@ static int elantech_set_properties(struct elantech_data *etd)
+ 			etd->hw_version = 3;
+ 			break;
+ 		case 6:
++		case 7:
+ 			etd->hw_version = 4;
+ 			break;
+ 		default:
+-- 
+1.8.3.1
+
diff --git a/kernel.spec b/kernel.spec
index 8f533cb..1b68506 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -776,6 +776,9 @@ Patch25065: net_310.mbox
 #rhbz 979581
 Patch25069: iwlwifi-dvm-fix-calling-ieee80211_chswitch_done-with-NULL.patch
 
+#rhbz 969473
+Patch25070: Input-elantech-fix-for-newer-hardware-versions-v7.patch
+
 # END OF PATCH DEFINITIONS
 
 %endif
@@ -1500,6 +1503,9 @@ ApplyPatch net_310.mbox
 #rhbz 979581
 ApplyPatch iwlwifi-dvm-fix-calling-ieee80211_chswitch_done-with-NULL.patch
 
+#rhbz 969473
+ApplyPatch Input-elantech-fix-for-newer-hardware-versions-v7.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2308,6 +2314,9 @@ fi
 # and build.
 
 %changelog
+* Mon Jul 29 2013 Josh Boyer <jwboyer at redhat.com>
+- Add support for elantech v7 devices (rhbz 969473)
+
 * Fri Jul 26 2013 Josh Boyer <jwboyer at redhat.com>
 - Add patch to fix NULL deref in iwlwifi (rhbz 979581)
 


More information about the scm-commits mailing list