[PATCH] Input: psmouse - retry getid command in psmouse_probe()

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE4936d

4 messages, 4 authors, 2013-02-19 · open the first message on its own page

[PATCH] Input: psmouse - retry getid command in psmouse_probe()

From: Chung-yih Wang <hidden>
Date: 2012-10-31 10:12:12

As the synaptics device may not respond to the first command in psmouse_probe
when a machine is booting up, the patch gives a second probe if the first
one fails.

Signed-off-by: Chung-yih Wang <redacted>
---
 drivers/input/mouse/psmouse-base.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 22fe254..c4fc5ad 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
  */
 
 	param[0] = 0xa5;
-	if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
-		return -1;
+	if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
+		/*
+		 * Reprobe the device if it did not respond to the GETID
+		 * command. Before retry, additional dummy command is sent
+		 * to clear the 'RESEND' response if exists.
+		 */
+		psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
+		ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
+		if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
+			return -1;
+	}
 
 	if (param[0] != 0x00 && param[0] != 0x03 &&
 	    param[0] != 0x04 && param[0] != 0xff)
-- 
1.7.7.3

Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()

From: li guang <hidden>
Date: 2013-02-18 09:27:10

seems a special change for a special device
so, you may need to place this change with
corresponding CONFIG_xxx_xxx.
generally, if command F2 failed, we will assume
there's no ps2 device, it's normal, 
or do you have some materials(SPEC) to specify
the change you have made?



在 2012-10-31三的 18:11 +0800,Chung-yih Wang写道:
quoted hunk
As the synaptics device may not respond to the first command in psmouse_probe
when a machine is booting up, the patch gives a second probe if the first
one fails.

Signed-off-by: Chung-yih Wang <redacted>
---
 drivers/input/mouse/psmouse-base.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 22fe254..c4fc5ad 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
  */
 
 	param[0] = 0xa5;
-	if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
-		return -1;
+	if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
+		/*
+		 * Reprobe the device if it did not respond to the GETID
+		 * command. Before retry, additional dummy command is sent
+		 * to clear the 'RESEND' response if exists.
+		 */
+		psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
+		ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
+		if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
+			return -1;
+	}
 
 	if (param[0] != 0x00 && param[0] != 0x03 &&
 	    param[0] != 0x04 && param[0] != 0xff)

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

Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()

From: Chung-Yih Wang (王崇懿) <hidden>
Date: 2013-02-18 09:45:31

Yes, I could add CONFIG_MOUSE_PS2_SYNAPTICS for the change as we only
need it for synaptics touchpad/touchpoint on lenovo's machines.


On Mon, Feb 18, 2013 at 5:26 PM, li guang [off-list ref] wrote:
seems a special change for a special device
so, you may need to place this change with
corresponding CONFIG_xxx_xxx.
generally, if command F2 failed, we will assume
there's no ps2 device, it's normal,
or do you have some materials(SPEC) to specify
the change you have made?



在 2012-10-31三的 18:11 +0800,Chung-yih Wang写道:
quoted
As the synaptics device may not respond to the first command in psmouse_probe
when a machine is booting up, the patch gives a second probe if the first
one fails.

Signed-off-by: Chung-yih Wang <redacted>
---
 drivers/input/mouse/psmouse-base.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 22fe254..c4fc5ad 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
  */

      param[0] = 0xa5;
-     if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
-             return -1;
+     if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
+             /*
+              * Reprobe the device if it did not respond to the GETID
+              * command. Before retry, additional dummy command is sent
+              * to clear the 'RESEND' response if exists.
+              */
+             psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
+             ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
+             if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
+                     return -1;
+     }

      if (param[0] != 0x00 && param[0] != 0x03 &&
          param[0] != 0x04 && param[0] != 0xff)

Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-02-19 18:44:29

Hi Chung-yih,

On Mon, Feb 18, 2013 at 05:45:07PM +0800, Chung-Yih Wang (王崇懿) wrote:
Yes, I could add CONFIG_MOUSE_PS2_SYNAPTICS for the change as we only
need it for synaptics touchpad/touchpoint on lenovo's machines.
I do not think it will solve anything as all distributions have
CONFIG_MOUSE_PS2_SYNAPTICS enabled.

Could you tell me what the response is to the initial GETID command that
you see on these laptops?

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help