[kernel] r17018 - in dists/squeeze/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Mon Mar 7 01:51:30 UTC 2011


Author: benh
Date: Mon Mar  7 01:51:28 2011
New Revision: 17018

Log:
psmouse/elantech: Fix detection and decoding for newer Elantech touchpads (Closes: #613335)

Added:
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0001-Input-elantech-do-not-advertise-relative-events.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0003-Input-elantech-fix-firmware-version-check.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0004-Input-elantech-allow-forcing-Elantech-protocol.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0005-Input-elantech-ignore-high-bits-in-the-position-coor.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0006-Input-elantech-use-all-3-bytes-when-checking-version.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0008-Input-elantech-relax-signature-checks.patch
   dists/squeeze/linux-2.6/debian/patches/bugfix/all/0009-Input-elantech-discard-the-first-2-positions-on-some.patch
Modified:
   dists/squeeze/linux-2.6/debian/changelog
   dists/squeeze/linux-2.6/debian/patches/series/31

Modified: dists/squeeze/linux-2.6/debian/changelog
==============================================================================
--- dists/squeeze/linux-2.6/debian/changelog	Mon Mar  7 01:26:50 2011	(r17017)
+++ dists/squeeze/linux-2.6/debian/changelog	Mon Mar  7 01:51:28 2011	(r17018)
@@ -46,6 +46,8 @@
     firmware-linux-nonfree 0.28+squeeze1) (Closes: #568454)
   * usbfs: Show correct speed for SuperSpeed USB devices (Closes: #613531)
   * drm/i915: Add pipe A force quirk for some laptops (Closes: #608148)
+  * psmouse/elantech: Fix detection and decoding for newer Elantech
+    touchpads (Closes: #613335)
 
   [ dann frazier ]
   * xfs: Fix information leak using stale NFS handle (CVE-2010-2943)

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0001-Input-elantech-do-not-advertise-relative-events.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0001-Input-elantech-do-not-advertise-relative-events.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,29 @@
+From: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+Date: Mon, 16 Nov 2009 22:12:21 -0800
+Subject: [PATCH 01/11] Input: elantech - do not advertise relative events
+
+commit c7a1f3ccfc2f99427f2e1545b3171e98539c3c95 upstream.
+
+Elantech touchpads work in absolute mode and do not generate relative
+events so they should not be advertising them.
+
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+---
+ drivers/input/mouse/elantech.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index fda35e6..b27684f 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -420,6 +420,7 @@ static void elantech_set_input_params(struct psmouse *psmouse)
+ 
+ 	__set_bit(EV_KEY, dev->evbit);
+ 	__set_bit(EV_ABS, dev->evbit);
++	__clear_bit(EV_REL, dev->evbit);
+ 
+ 	__set_bit(BTN_LEFT, dev->keybit);
+ 	__set_bit(BTN_RIGHT, dev->keybit);
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0003-Input-elantech-fix-firmware-version-check.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0003-Input-elantech-fix-firmware-version-check.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,34 @@
+From: Florian Ragwitz <rafl at debian.org>
+Date: Tue, 27 Apr 2010 00:45:10 -0700
+Subject: [PATCH 03/11] Input: elantech - fix firmware version check
+
+commit 225c61aad38b12924b3df5f4ef43150c0d6bae8c upstream.
+
+The check determining whether device should use 4- or 6-byte packets
+was trying to compare firmware with 2.48, but was failing on majors
+greater than 2. The new check ensures that versions like 4.1 are
+checked properly.
+
+Signed-off-by: Florian Ragwitz <rafl at debian.org>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+---
+ drivers/input/mouse/elantech.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index b27684f..28eba48 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -665,7 +665,8 @@ int elantech_init(struct psmouse *psmouse)
+ 	 * Assume every version greater than this is new EeePC style
+ 	 * hardware with 6 byte packets
+ 	 */
+-	if (etd->fw_version_maj >= 0x02 && etd->fw_version_min >= 0x30) {
++	if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) ||
++	    etd->fw_version_maj > 0x02) {
+ 		etd->hw_version = 2;
+ 		/* For now show extra debug information */
+ 		etd->debug = 1;
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0004-Input-elantech-allow-forcing-Elantech-protocol.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0004-Input-elantech-allow-forcing-Elantech-protocol.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,49 @@
+From: Florian Ragwitz <rafl at debian.org>
+Date: Tue, 27 Apr 2010 00:47:04 -0700
+Subject: [PATCH 04/11] Input: elantech - allow forcing Elantech protocol
+
+commit f81bc788ff91d4efd4baf88b2c29713838caa8e5 upstream.
+
+Apparently hardware vendors now ship elantech touchpads with different version
+magic. This options allows for them to be tested easier with the current driver
+in order to add their magic to the whitelist later.
+
+Signed-off-by: Florian Ragwitz <rafl at debian.org>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+---
+ drivers/input/mouse/elantech.c |   12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index 28eba48..095bd38 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -24,6 +24,10 @@
+ 			printk(KERN_DEBUG format, ##arg);	\
+ 	} while (0)
+ 
++static bool force_elantech;
++module_param_named(force_elantech, force_elantech, bool, 0644);
++MODULE_PARM_DESC(force_elantech, "Force the Elantech PS/2 protocol extension to be used, 1 = enabled, 0 = disabled (default).");
++
+ /*
+  * Send a Synaptics style sliced query command
+  */
+@@ -595,8 +599,12 @@ int elantech_detect(struct psmouse *psmouse, bool set_properties)
+ 		 param[0], param[1], param[2]);
+ 
+ 	if (param[0] == 0 || param[1] != 0) {
+-		pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+-		return -1;
++		if (!force_elantech) {
++			pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
++			return -1;
++		}
++
++		pr_debug("elantech.c: Probably not a real Elantech touchpad. Enabling anyway due to force_elantech.\n");
+ 	}
+ 
+ 	if (set_properties) {
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0005-Input-elantech-ignore-high-bits-in-the-position-coor.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0005-Input-elantech-ignore-high-bits-in-the-position-coor.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,131 @@
+From: Florian Ragwitz <rafl at debian.org>
+Date: Mon, 3 May 2010 23:29:37 -0700
+Subject: [PATCH 05/11] Input: elantech - ignore high bits in the position coordinates
+
+commit e938fbfd4a7ac829d48b767c4dc365535d5c4f97 upstream.
+
+In older versions of the elantech hardware/firmware those bits always
+were unset, so it didn't actually matter, but newer versions seem to
+use those high bits for something else, screwing up the coordinates
+we report to the input layer for those devices.
+
+Signed-off-by: Florian Ragwitz <rafl at debian.org>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+---
+ drivers/input/mouse/elantech.c |   69 +++++++++++++++++++++++++--------------
+ 1 files changed, 44 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index 095bd38..2cbf3fc 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -185,13 +185,17 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	static int old_fingers;
+ 
+ 	if (etd->fw_version_maj == 0x01) {
+-		/* byte 0:  D   U  p1  p2   1  p3   R   L
+-		   byte 1:  f   0  th  tw  x9  x8  y9  y8 */
++		/*
++		 * byte 0:  D   U  p1  p2   1  p3   R   L
++		 * byte 1:  f   0  th  tw  x9  x8  y9  y8
++		 */
+ 		fingers = ((packet[1] & 0x80) >> 7) +
+ 				((packet[1] & 0x30) >> 4);
+ 	} else {
+-		/* byte 0: n1  n0  p2  p1   1  p3   R   L
+-		   byte 1:  0   0   0   0  x9  x8  y9  y8 */
++		/*
++		 * byte 0: n1  n0  p2  p1   1  p3   R   L
++		 * byte 1:  0   0   0   0  x9  x8  y9  y8
++		 */
+ 		fingers = (packet[0] & 0xc0) >> 6;
+ 	}
+ 
+@@ -205,13 +209,15 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 
+ 	input_report_key(dev, BTN_TOUCH, fingers != 0);
+ 
+-	/* byte 2: x7  x6  x5  x4  x3  x2  x1  x0
+-	   byte 3: y7  y6  y5  y4  y3  y2  y1  y0 */
++	/*
++	 * byte 2: x7  x6  x5  x4  x3  x2  x1  x0
++	 * byte 3: y7  y6  y5  y4  y3  y2  y1  y0
++	 */
+ 	if (fingers) {
+ 		input_report_abs(dev, ABS_X,
+ 			((packet[1] & 0x0c) << 6) | packet[2]);
+-		input_report_abs(dev, ABS_Y, ETP_YMAX_V1 -
+-			(((packet[1] & 0x03) << 8) | packet[3]));
++		input_report_abs(dev, ABS_Y,
++			ETP_YMAX_V1 - (((packet[1] & 0x03) << 8) | packet[3]));
+ 	}
+ 
+ 	input_report_key(dev, BTN_TOOL_FINGER, fingers == 1);
+@@ -250,34 +256,47 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse)
+ 
+ 	switch (fingers) {
+ 	case 1:
+-		/* byte 1: x15 x14 x13 x12 x11 x10 x9  x8
+-		   byte 2: x7  x6  x5  x4  x4  x2  x1  x0 */
+-		input_report_abs(dev, ABS_X, (packet[1] << 8) | packet[2]);
+-		/* byte 4: y15 y14 y13 y12 y11 y10 y8  y8
+-		   byte 5: y7  y6  y5  y4  y3  y2  y1  y0 */
+-		input_report_abs(dev, ABS_Y, ETP_YMAX_V2 -
+-			((packet[4] << 8) | packet[5]));
++		/*
++		 * byte 1:  .   .   .   .   .  x10 x9  x8
++		 * byte 2: x7  x6  x5  x4  x4  x2  x1  x0
++		 */
++		input_report_abs(dev, ABS_X,
++			((packet[1] & 0x07) << 8) | packet[2]);
++		/*
++		 * byte 4:  .   .   .   .   .   .  y9  y8
++		 * byte 5: y7  y6  y5  y4  y3  y2  y1  y0
++		 */
++		input_report_abs(dev, ABS_Y,
++			ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5]));
+ 		break;
+ 
+ 	case 2:
+-		/* The coordinate of each finger is reported separately with
+-		   a lower resolution for two finger touches */
+-		/* byte 0:  .   .  ay8 ax8  .   .   .   .
+-		   byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 */
++		/*
++		 * The coordinate of each finger is reported separately
++		 * with a lower resolution for two finger touches:
++		 * byte 0:  .   .  ay8 ax8  .   .   .   .
++		 * byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
++		 */
+ 		x1 = ((packet[0] & 0x10) << 4) | packet[1];
+ 		/* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */
+ 		y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]);
+-		/* byte 3:  .   .  by8 bx8  .   .   .   .
+-		   byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 */
++		/*
++		 * byte 3:  .   .  by8 bx8  .   .   .   .
++		 * byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
++		 */
+ 		x2 = ((packet[3] & 0x10) << 4) | packet[4];
+ 		/* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */
+ 		y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]);
+-		/* For compatibility with the X Synaptics driver scale up one
+-		   coordinate and report as ordinary mouse movent */
++		/*
++		 * For compatibility with the X Synaptics driver scale up
++		 * one coordinate and report as ordinary mouse movent
++		 */
+ 		input_report_abs(dev, ABS_X, x1 << 2);
+ 		input_report_abs(dev, ABS_Y, y1 << 2);
+-		/* For compatibility with the proprietary X Elantech driver
+-		   report both coordinates as hat coordinates */
++		/*
++		 * For compatibility with the proprietary X Elantech driver
++		 * report both coordinates as hat coordinates
++		 */
+ 		input_report_abs(dev, ABS_HAT0X, x1);
+ 		input_report_abs(dev, ABS_HAT0Y, y1);
+ 		input_report_abs(dev, ABS_HAT1X, x2);
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0006-Input-elantech-use-all-3-bytes-when-checking-version.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0006-Input-elantech-use-all-3-bytes-when-checking-version.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,119 @@
+From: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+Date: Thu, 13 May 2010 00:41:15 -0700
+Subject: [PATCH 06/11] Input: elantech - use all 3 bytes when checking version
+
+commit 504e8beed161bd11a2c6cbb8aaf352c14d39b5bb upstream.
+
+Apparently all 3 bytes returned by ETP_FW_VERSION_QUERY are significant
+and should be taken into account when matching hardware version/features.
+
+Tested-by: Eric Piel <eric.piel at tremplin-utc.net>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+---
+ drivers/input/mouse/elantech.c |   24 ++++++++++++------------
+ drivers/input/mouse/elantech.h |    5 ++---
+ 2 files changed, 14 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
+index 2cbf3fc..1ac12f7 100644
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -184,7 +184,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	int fingers;
+ 	static int old_fingers;
+ 
+-	if (etd->fw_version_maj == 0x01) {
++	if (etd->fw_version < 0x020000) {
+ 		/*
+ 		 * byte 0:  D   U  p1  p2   1  p3   R   L
+ 		 * byte 1:  f   0  th  tw  x9  x8  y9  y8
+@@ -226,7 +226,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
+ 	input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
+ 
+-	if ((etd->fw_version_maj == 0x01) &&
++	if (etd->fw_version < 0x020000 &&
+ 	    (etd->capabilities & ETP_CAP_HAS_ROCKER)) {
+ 		/* rocker up */
+ 		input_report_key(dev, BTN_FORWARD, packet[0] & 0x40);
+@@ -320,7 +320,7 @@ static int elantech_check_parity_v1(struct psmouse *psmouse)
+ 	unsigned char p1, p2, p3;
+ 
+ 	/* Parity bits are placed differently */
+-	if (etd->fw_version_maj == 0x01) {
++	if (etd->fw_version < 0x020000) {
+ 		/* byte 0:  D   U  p1  p2   1  p3   R   L */
+ 		p1 = (packet[0] & 0x20) >> 5;
+ 		p2 = (packet[0] & 0x10) >> 4;
+@@ -456,7 +456,7 @@ static void elantech_set_input_params(struct psmouse *psmouse)
+ 	switch (etd->hw_version) {
+ 	case 1:
+ 		/* Rocker button */
+-		if ((etd->fw_version_maj == 0x01) &&
++		if (etd->fw_version < 0x020000 &&
+ 		    (etd->capabilities & ETP_CAP_HAS_ROCKER)) {
+ 			__set_bit(BTN_FORWARD, dev->keybit);
+ 			__set_bit(BTN_BACK, dev->keybit);
+@@ -685,15 +685,14 @@ int elantech_init(struct psmouse *psmouse)
+ 		pr_err("elantech.c: failed to query firmware version.\n");
+ 		goto init_fail;
+ 	}
+-	etd->fw_version_maj = param[0];
+-	etd->fw_version_min = param[2];
++
++	etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
+ 
+ 	/*
+ 	 * Assume every version greater than this is new EeePC style
+ 	 * hardware with 6 byte packets
+ 	 */
+-	if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) ||
+-	    etd->fw_version_maj > 0x02) {
++	if (etd->fw_version >= 0x020030) {
+ 		etd->hw_version = 2;
+ 		/* For now show extra debug information */
+ 		etd->debug = 1;
+@@ -703,8 +702,9 @@ int elantech_init(struct psmouse *psmouse)
+ 		etd->hw_version = 1;
+ 		etd->paritycheck = 1;
+ 	}
+-	pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d\n",
+-		etd->hw_version, etd->fw_version_maj, etd->fw_version_min);
++
++	pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d.%d\n",
++		etd->hw_version, param[0], param[1], param[2]);
+ 
+ 	if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) {
+ 		pr_err("elantech.c: failed to query capabilities.\n");
+@@ -719,8 +719,8 @@ int elantech_init(struct psmouse *psmouse)
+ 	 * a touch action starts causing the mouse cursor or scrolled page
+ 	 * to jump. Enable a workaround.
+ 	 */
+-	if (etd->fw_version_maj == 0x02 && etd->fw_version_min == 0x22) {
+-		pr_info("elantech.c: firmware version 2.34 detected, "
++	if (etd->fw_version == 0x020022) {
++		pr_info("elantech.c: firmware version 2.0.34 detected, "
+ 			"enabling jumpy cursor workaround\n");
+ 		etd->jumpy_cursor = 1;
+ 	}
+diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
+index feac5f7..ac57bde 100644
+--- a/drivers/input/mouse/elantech.h
++++ b/drivers/input/mouse/elantech.h
+@@ -100,11 +100,10 @@ struct elantech_data {
+ 	unsigned char reg_26;
+ 	unsigned char debug;
+ 	unsigned char capabilities;
+-	unsigned char fw_version_maj;
+-	unsigned char fw_version_min;
+-	unsigned char hw_version;
+ 	unsigned char paritycheck;
+ 	unsigned char jumpy_cursor;
++	unsigned char hw_version;
++	unsigned int  fw_version;
+ 	unsigned char parity[256];
+ };
+ 
+-- 
+1.7.4.1
+

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0008-Input-elantech-relax-signature-checks.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0008-Input-elantech-relax-signature-checks.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,51 @@
+From: Dmitry Torokhov <dmitry.torokhov at gmail.com>
+Date: Wed, 19 May 2010 10:11:13 -0700
+Subject: [PATCH 08/11] Input: elantech - relax signature checks
+
+commit a083632eaf6231162b33e40561cfec6a9c156945 upstream.
+
+Apparently there are Elantech touchpads that report non-zero in the 2nd byte
+of their signature. Adjust the detection routine so that if 2nd byte is
+zero and 3rd byte contains value that is not a valid report rate, we still
+assume that signature is valid.
+
+Tested-by: Eric Piel <eric.piel at tremplin-utc.net>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+[bwh: Adjust context for 2.6.32]
+---
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -575,6 +575,24 @@ static struct attribute_group elantech_attr_group = {
+ 	.attrs = elantech_attrs,
+ };
+ 
++static bool elantech_is_signature_valid(const unsigned char *param)
++{
++	static const unsigned char rates[] = { 200, 100, 80, 60, 40, 20, 10 };
++	int i;
++
++	if (param[0] == 0)
++		return false;
++
++	if (param[1] == 0)
++		return true;
++
++	for (i = 0; i < ARRAY_SIZE(rates); i++)
++		if (param[2] == rates[i])
++			return false;
++
++	return true;
++}
++
+ /*
+  * Use magic knock to detect Elantech touchpad
+  */
+@@ -617,7 +635,7 @@ int elantech_detect(struct psmouse *psmouse, bool set_properties)
+ 	pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
+ 		 param[0], param[1], param[2]);
+ 
+-	if (param[0] == 0 || param[1] != 0) {
++	if (!elantech_is_signature_valid(param)) {
+ 		if (!force_elantech) {
+ 			pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
+ 			return -1;

Added: dists/squeeze/linux-2.6/debian/patches/bugfix/all/0009-Input-elantech-discard-the-first-2-positions-on-some.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/squeeze/linux-2.6/debian/patches/bugfix/all/0009-Input-elantech-discard-the-first-2-positions-on-some.patch	Mon Mar  7 01:51:28 2011	(r17018)
@@ -0,0 +1,94 @@
+From: =?UTF-8?q?=C3=89ric=20Piel?= <E.A.B.Piel at tudelft.nl>
+Date: Thu, 5 Aug 2010 23:51:49 -0700
+Subject: [PATCH 09/11] Input: elantech - discard the first 2 positions on some firmwares
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 7f29f17b57255b6395046805a98bc663ded63fb8 upstream.
+
+According to the Dell/Ubuntu driver, what was previously observed as
+"jumpy cursor" corresponds to the hardware sending incorrect data for
+the first two reports of a one touch finger. So let's use the same
+workaround as in the other driver. Also, detect another firmware
+version with the same behaviour, as in the other driver.
+
+Signed-off-by: Éric Piel <eric.piel at tremplin-utc.net>
+Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
+[bwh: Adjust for 2.6.32]
+---
+--- a/drivers/input/mouse/elantech.c
++++ b/drivers/input/mouse/elantech.c
+@@ -185,7 +185,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	struct elantech_data *etd = psmouse->private;
+ 	unsigned char *packet = psmouse->packet;
+ 	int fingers;
+-	static int old_fingers;
+ 
+ 	if (etd->fw_version < 0x020000) {
+ 		/*
+@@ -203,10 +202,13 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	}
+ 
+ 	if (etd->jumpy_cursor) {
+-		/* Discard packets that are likely to have bogus coordinates */
+-		if (fingers > old_fingers) {
++		if (fingers != 1) {
++			etd->single_finger_reports = 0;
++		} else if (etd->single_finger_reports < 2) {
++			/* Discard first 2 reports of one finger, bogus */
++			etd->single_finger_reports++;
+ 			elantech_debug("elantech.c: discarding packet\n");
+-			goto discard_packet_v1;
++			return;
+ 		}
+ 	}
+ 
+@@ -238,9 +240,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
+ 	}
+ 
+ 	input_sync(dev);
+-
+- discard_packet_v1:
+-	old_fingers = fingers;
+ }
+ 
+ /*
+@@ -733,14 +732,14 @@ int elantech_init(struct psmouse *psmouse)
+ 	etd->capabilities = param[0];
+ 
+ 	/*
+-	 * This firmware seems to suffer from misreporting coordinates when
++	 * This firmware suffers from misreporting coordinates when
+ 	 * a touch action starts causing the mouse cursor or scrolled page
+ 	 * to jump. Enable a workaround.
+ 	 */
+-	if (etd->fw_version == 0x020022) {
+-		pr_info("elantech.c: firmware version 2.0.34 detected, "
++	if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) {
++		pr_info("elantech.c: firmware version 2.0.34/2.6.0 detected, "
+ 			"enabling jumpy cursor workaround\n");
+-		etd->jumpy_cursor = 1;
++		etd->jumpy_cursor = true;
+ 	}
+ 
+ 	if (elantech_set_absolute_mode(psmouse)) {
+diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
+index ac57bde..aa4aac5 100644
+--- a/drivers/input/mouse/elantech.h
++++ b/drivers/input/mouse/elantech.h
+@@ -100,10 +100,11 @@ struct elantech_data {
+ 	unsigned char reg_26;
+ 	unsigned char debug;
+ 	unsigned char capabilities;
+-	unsigned char paritycheck;
+-	unsigned char jumpy_cursor;
++	bool paritycheck;
++	bool jumpy_cursor;
+ 	unsigned char hw_version;
+-	unsigned int  fw_version;
++	unsigned int fw_version;
++	unsigned int single_finger_reports;
+ 	unsigned char parity[256];
+ };
+ 

Modified: dists/squeeze/linux-2.6/debian/patches/series/31
==============================================================================
--- dists/squeeze/linux-2.6/debian/patches/series/31	Mon Mar  7 01:26:50 2011	(r17017)
+++ dists/squeeze/linux-2.6/debian/patches/series/31	Mon Mar  7 01:51:28 2011	(r17018)
@@ -57,3 +57,10 @@
 + features/all/vt6656-Use-request_firmware-to-load-firmware.patch
 + bugfix/all/usb_superspeed_devices_spd.patch
 + bugfix/x86/drm-i915-add-pipe-A-force-quirks-to-i915-driver.patch
++ bugfix/all/0001-Input-elantech-do-not-advertise-relative-events.patch
++ bugfix/all/0003-Input-elantech-fix-firmware-version-check.patch
++ bugfix/all/0004-Input-elantech-allow-forcing-Elantech-protocol.patch
++ bugfix/all/0005-Input-elantech-ignore-high-bits-in-the-position-coor.patch
++ bugfix/all/0006-Input-elantech-use-all-3-bytes-when-checking-version.patch
++ bugfix/all/0008-Input-elantech-relax-signature-checks.patch
++ bugfix/all/0009-Input-elantech-discard-the-first-2-positions-on-some.patch



More information about the Kernel-svn-changes mailing list