[PATCH 1/1] psmouse/synaptics: ensure we reset the device on resume

From: Andy Whitcroft
Date: Mon Feb 02 2009 - 11:32:25 EST


When resuming from suspend newer Synaptics touchpads do not recover
correctly. Analysis of the resume sequence as applied in Linux was
compared to that of other operating systems. This indicated that the
other OSs were resetting the mouse before attempting to detect it (for
all Synaptics touchpads, old and new). Applying this same modification
fixes these newer Synaptics touchpads and brings the driver into line
with common OS reset behaviour.

This patch adds this reset by default providing a module option to
restore the previous non-reset behaviour:

psmouse.synaptics_resume_reset=N

Also a message is emmitted on resume hinting as to how to fix a broken
touchpad.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxxx>
---
drivers/input/mouse/synaptics.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index d349c4a..5b01c14 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -60,11 +60,21 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
return 0;
}

+static int synaptics_resume_reset = 1;
+module_param(synaptics_resume_reset, bool, 0);
+MODULE_PARM_DESC(synaptics_resume_reset,
+ "Enable reset on resume for Synaptics");
+
int synaptics_detect(struct psmouse *psmouse, int set_properties)
{
struct ps2dev *ps2dev = &psmouse->ps2dev;
unsigned char param[4];

+ if (synaptics_resume_reset) {
+ printk(KERN_CRIT "WARNING: synaptics was reset on resume, see synaptics_resume_reset if you have trouble on resume\n");
+ psmouse_reset(psmouse);
+ }
+
param[0] = 0;

ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
--
1.6.1.2.419.g0d87e
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/