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

From
Chung-Yih Wang (王崇懿) <hidden>
Date
2013-02-18 08:21:58
Also in
lkml
Hi Dmitry and other maintainers,

  Not sure if you have any comment on the patch? As this patch tries
to help some platforms (especially for lenovo's machines) to rescan
the touchpad device after resuming from suspend if the first probe
fails.

Thanks,
Chung-yih

On Mon, Feb 18, 2013 at 4:17 PM, Chung-Yih Wang (王崇懿)
[off-list ref] wrote:
Hi Dmitry and other maintainers,

  Not sure if you have any comment on the patch? As this patch tries to help
some platforms (especially for lenovo's machines) to rescan the touchpad
device after resuming from suspend if the first probe fails.

Thanks,
Chung-yih


On Wed, Oct 31, 2012 at 6:11 PM, Chung-yih Wang [off-list ref] wrote:
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)
--
1.7.7.3
--
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
Thread (1 message) 1 message, 1 author, last reply 2013-02-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help