diff options
author | Alexandre Peixoto Ferreira <alexandref75@gmail.com> | 2011-01-28 22:05:14 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-01-28 22:32:07 -0800 |
commit | c63fe0a41fd2374be0ebe93c053820a0eed9cefe (patch) | |
tree | dd9e365dc6579b698fbc89e08df8a10c994917df /drivers/input/mouse | |
parent | baddf58963241307b29e027a9fb28dfe55939db8 (diff) | |
download | kernel_samsung_smdk4412-c63fe0a41fd2374be0ebe93c053820a0eed9cefe.zip kernel_samsung_smdk4412-c63fe0a41fd2374be0ebe93c053820a0eed9cefe.tar.gz kernel_samsung_smdk4412-c63fe0a41fd2374be0ebe93c053820a0eed9cefe.tar.bz2 |
Input: synaptics - retry failed resets when reconnecting
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>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/synaptics.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index fdf089c..aa186cf 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -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; |