Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c63fe0a4 authored by Alexandre Peixoto Ferreira's avatar Alexandre Peixoto Ferreira Committed by Dmitry Torokhov
Browse files

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: default avatarAlexandre Peixoto Ferreira <alexandref75@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent baddf589
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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;

	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;