浏览代码

Input: psmouse - reset all types of mice before reconnecting

Synaptics hardware requires resetting device after suspend to ram
in order for the device to be operational. The reset lives in
synaptics-specific reconnect handler, but it is not being invoked
if synaptics support is disabled and the device is handled as a
standard PS/2 device (bare or IntelliMouse protocol).

Let's add reset into generic reconnect handler as well.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov 15 年之前
父节点
当前提交
ef110b24e2
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 10 4
      drivers/input/mouse/psmouse-base.c

+ 10 - 4
drivers/input/mouse/psmouse-base.c

@@ -1394,6 +1394,7 @@ static int psmouse_reconnect(struct serio *serio)
 	struct psmouse *psmouse = serio_get_drvdata(serio);
 	struct psmouse *psmouse = serio_get_drvdata(serio);
 	struct psmouse *parent = NULL;
 	struct psmouse *parent = NULL;
 	struct serio_driver *drv = serio->drv;
 	struct serio_driver *drv = serio->drv;
+	unsigned char type;
 	int rc = -1;
 	int rc = -1;
 
 
 	if (!drv || !psmouse) {
 	if (!drv || !psmouse) {
@@ -1413,10 +1414,15 @@ static int psmouse_reconnect(struct serio *serio)
 	if (psmouse->reconnect) {
 	if (psmouse->reconnect) {
 		if (psmouse->reconnect(psmouse))
 		if (psmouse->reconnect(psmouse))
 			goto out;
 			goto out;
-	} else if (psmouse_probe(psmouse) < 0 ||
-		   psmouse->type != psmouse_extensions(psmouse,
-						psmouse_max_proto, false)) {
-		goto out;
+	} else {
+		psmouse_reset(psmouse);
+
+		if (psmouse_probe(psmouse) < 0)
+			goto out;
+
+		type = psmouse_extensions(psmouse, psmouse_max_proto, false);
+		if (psmouse->type != type)
+			goto out;
 	}
 	}
 
 
 	/* ok, the device type (and capabilities) match the old one,
 	/* ok, the device type (and capabilities) match the old one,