[merged] input-elantechc-make-sure-touchpad-is-really-in-absolute-mode.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     input: elantech.c make sure touchpad is really in absolute mode
has been removed from the -mm tree.  Its filename was
     input-elantechc-make-sure-touchpad-is-really-in-absolute-mode.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: input: elantech.c make sure touchpad is really in absolute mode
From: Arjan Opmeer <arjan@xxxxxxxxxx>

There exist laptops with Elantech touchpads where switching to absolute
mode does not happen, although writing the configuration register succeeds
without error.  Reading back the register afterwards reveils that the
absolute mode bit is not set as if masked out by the touchpad firmware.

Always read back register 0x10, make sure that for hardware version 1 the
absolute mode bit is actually set and fail otherwise.  This prevents the
case where the touchpad is claimed by the Elantech driver but is
nonetheless not working.

Signed-off-by: Arjan Opmeer <arjan@xxxxxxxxxx>
Cc: Dmitry Torokhov <dtor@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/input/mouse/elantech.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff -puN drivers/input/mouse/elantech.c~input-elantechc-make-sure-touchpad-is-really-in-absolute-mode drivers/input/mouse/elantech.c
--- a/drivers/input/mouse/elantech.c~input-elantechc-make-sure-touchpad-is-really-in-absolute-mode
+++ a/drivers/input/mouse/elantech.c
@@ -375,9 +375,14 @@ static int elantech_set_absolute_mode(st
 			rc = -1;
 			break;
 		}
+	}
+
+	if (rc == 0) {
 		/*
-		 * Read back reg 0x10. The touchpad is probably initalising
-		 * and not ready until we read back the value we just wrote.
+		 * Read back reg 0x10. For hardware version 1 we must make
+		 * sure the absolute mode bit is set. For hardware version 2
+		 * the touchpad is probably initalising and not ready until
+		 * we read back the value we just wrote.
 		 */
 		do {
 			rc = elantech_read_reg(psmouse, 0x10, &val);
@@ -388,9 +393,17 @@ static int elantech_set_absolute_mode(st
 				tries);
 			msleep(ETP_READ_BACK_DELAY);
 		} while (tries > 0);
-		if (rc)
+
+		if (rc) {
 			pr_err("elantech.c: failed to read back register 0x10.\n");
-		break;
+		} else {
+			if (etd->hw_version == 1 &&
+			    val & ETP_R10_ABSOLUTE_MODE == 0) {
+				pr_err("elantech.c: touchpad refuses "
+					"to have absolute mode bit set\n");
+				rc = -1;
+			}
+		}
 	}
 
 	if (rc)
_

Patches currently in -mm which might be from arjan@xxxxxxxxxx are

linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux