提交 99c90ab3 编写于 作者: A Akio Idehara 提交者: Dmitry Torokhov

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: NAkio Idehara <zbe64533@gmail.com>
Tested-by: NSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 82b982c9
...@@ -13,7 +13,8 @@ Detection ...@@ -13,7 +13,8 @@ Detection
All ALPS touchpads should respond to the "E6 report" command sequence: 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 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 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 report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is
......
...@@ -952,7 +952,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int ...@@ -952,7 +952,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int
/* /*
* First try "E6 report". * 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; param[0] = 0;
if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || 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 ...@@ -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", psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x",
param[0], param[1], param[2]); 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; return NULL;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册