]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Input: synaptics - retry failed resets when reconnecting
authorAlexandre Peixoto Ferreira <alexandref75@gmail.com>
Sat, 29 Jan 2011 06:05:14 +0000 (22:05 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 29 Jan 2011 06:32:07 +0000 (22:32 -0800)
On some machines, like Dell Studio XPS 16 (1640), touchpad fails to
respond to the standard query after first reset but may start
responding later, so let's repeat reset sequence several (3) times.

Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/synaptics.c

index fdf089c0c707b4be6718a3ae1e141719b8453080..aa186cf6c514526fec46d40d4d5a47bbe38af0e9 100644 (file)
@@ -755,12 +755,21 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 {
        struct synaptics_data *priv = psmouse->private;
        struct synaptics_data old_priv = *priv;
+       int retry = 0;
+       int error;
 
-       psmouse_reset(psmouse);
+       do {
+               psmouse_reset(psmouse);
+               error = synaptics_detect(psmouse, 0);
+       } while (error && ++retry < 3);
 
-       if (synaptics_detect(psmouse, 0))
+       if (error)
                return -1;
 
+       if (retry > 1)
+               printk(KERN_DEBUG "Synaptics reconnected after %d tries\n",
+                       retry);
+
        if (synaptics_query_hardware(psmouse)) {
                printk(KERN_ERR "Unable to query Synaptics hardware.\n");
                return -1;