summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAkio Idehara <zbe64533@gmail.com>2012-02-24 09:33:22 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-02-24 09:46:45 +0100
commit99c90ab31fad855b9da9dee3a5aa6c27f263e9d6 (patch)
treec282083ac7a0aff9105e0bc2df5ced725c8902b6 /drivers
parentInput: i8042 - add Lenovo Ideapad U455 to 'reset' blacklist (diff)
downloadlinux-99c90ab31fad855b9da9dee3a5aa6c27f263e9d6.tar.xz
linux-99c90ab31fad855b9da9dee3a5aa6c27f263e9d6.zip
Input: ALPS - fix touchpad detection when buttons are pressed
ALPS touchpad detection fails if some buttons of ALPS are pressed. The reason is that the "E6" query response byte is different from what is expected. This was tested on a Toshiba Portege R500. Cc: stable <stable@vger.kernel.org> Signed-off-by: Akio Idehara <zbe64533@gmail.com> Tested-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/alps.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index bd87380bd879..4c6a72d3d48c 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -952,7 +952,9 @@ 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 +970,8 @@ 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;
/*