Skip to content

Commit 349409f

Browse files
github-user-2017gregkh
authored andcommitted
Input: ALPS - fix touchpad detection when buttons are pressed
commit 99c90ab upstream. 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. Signed-off-by: Akio Idehara <zbe64533@gmail.com> Tested-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d6bc693 commit 349409f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/input/mouse/alps.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
421421

422422
/*
423423
* First try "E6 report".
424-
* ALPS should return 0,0,10 or 0,0,100
424+
* ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed.
425+
* The bits 0-2 of the first byte will be 1s if some buttons are
426+
* pressed.
425427
*/
426428
param[0] = 0;
427429
if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) ||
@@ -437,7 +439,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
437439
psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
438440
param[0], param[1], param[2]);
439441

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

443446
/*

0 commit comments

Comments
 (0)