[PATCH] Fix ALPS touchpad detection

Subsystems: alps ps/2 touchpad driver, documentation, input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE5283d

3 messages, 2 authors, 2012-02-16 · open the first message on its own page

[PATCH] Fix ALPS touchpad detection

From: Akio Idehara <hidden>
Date: 2012-02-15 12:58:29

ALPS touchpad detection fails if some buttons of ALPS are pressed.
The reason is that the query response byte is different from what is expected.
This was tested on a Toshiba Portege R500.

Signed-off-by: Akio Idehara <redacted>
---
  Documentation/input/alps.txt |    3 ++-
  drivers/input/mouse/alps.c   |    5 +++--
  2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/input/alps.txt b/Documentation/input/alps.txt
index f274c28..2f95308 100644
--- a/Documentation/input/alps.txt
+++ b/Documentation/input/alps.txt
@@ -13,7 +13,8 @@ Detection

  All ALPS touchpads should respond to the "E6 report" command sequence:
  E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or
-00-00-64.
+00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s
+if some buttons are pressed.

  If the E6 report is successful, the touchpad model is identified using the "E7
  report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index bd87380..d161831 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -952,7 +952,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int

  	/*
  	 * First try "E6 report".
-	 * ALPS should return 0,0,10 or 0,0,100
+	 * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
+	 * The bits 0-2 of the first byte will be 1s if some buttons are pressed.
  	 */
  	param[0] = 0;
  	if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
@@ -968,7 +969,7 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
  	psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
  		    param[0], param[1], param[2]);

-	if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100))
+	if ((param[0] & 0xf8) != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100))
  		return NULL;

  	/*
-- 
1.7.9

Re: [PATCH] Fix ALPS touchpad detection

From: Seth Forshee <hidden>
Date: 2012-02-15 16:19:01

On Wed, Feb 15, 2012 at 09:58:25PM +0900, Akio Idehara wrote:
ALPS touchpad detection fails if some buttons of ALPS are pressed.
The reason is that the query response byte is different from what is expected.
This was tested on a Toshiba Portege R500.
I've reproduced the problem and confirmed that your approach fixes it.

However, your patch seems to be malformed as it won't apply cleanly for
me. For the comment you're modifying you should also keep the line
length under 80 characters.

This fix seems like a good candidate for stable as well.

Seth

Re: [PATCH] Fix ALPS touchpad detection

From: Akio Idehara <hidden>
Date: 2012-02-16 12:47:55

Thank you for commenting.
I'll send the new one.

Seth Forshee wrote:
On Wed, Feb 15, 2012 at 09:58:25PM +0900, Akio Idehara wrote:
quoted
ALPS touchpad detection fails if some buttons of ALPS are pressed.
The reason is that the query response byte is different from what is expected.
This was tested on a Toshiba Portege R500.
I've reproduced the problem and confirmed that your approach fixes it.

However, your patch seems to be malformed as it won't apply cleanly for
me. For the comment you're modifying you should also keep the line
length under 80 characters.

This fix seems like a good candidate for stable as well.

Seth

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