[Bug 46415] Re: PS2 Mouse: Missing patch from 2.6.16

Rafael de Pelegrini Soares rafael at rps.eng.br
Wed May 24 17:49:47 UTC 2006


It follows the patch I used:

Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
---

Index: linux/drivers/input/mouse/psmouse-base.c
===================================================================
--- linux.orig/drivers/input/mouse/psmouse-base.c
+++ linux/drivers/input/mouse/psmouse-base.c
@@ -527,11 +527,20 @@ static int psmouse_extensions(struct psm
 	if (max_proto > PSMOUSE_IMEX && ps2pp_init(psmouse, set_properties) == 0)
 		return PSMOUSE_PS2PP;
 
+	if (max_proto > PSMOUSE_IMEX && trackpoint_detect(psmouse, set_properties) == 0)
+		return PSMOUSE_TRACKPOINT;
+
 /*
  * Reset to defaults in case the device got confused by extended
- * protocol probes.
+ * protocol probes. Note that we do full reset becuase some mice
+ * put themselves to sleep when see PSMOUSE_RESET_DIS.
+ */
+	psmouse_reset(psmouse);
+/*
+ * Additionally issue GETID command to restore "classic" protocol
+ * detection sequence.
  */
-	ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
+	ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_GETID);
 
 	if (max_proto >= PSMOUSE_IMEX && im_explorer_detect(psmouse, set_properties) == 0)
 		return PSMOUSE_IMEX;
@@ -540,12 +549,6 @@ static int psmouse_extensions(struct psm
 		return PSMOUSE_IMPS;
 
 /*
- * Try to initialize the IBM TrackPoint
- */
-	if (max_proto > PSMOUSE_IMEX && trackpoint_detect(psmouse, set_properties) == 0)
-		return PSMOUSE_TRACKPOINT;
-
-/*
  * Okay, all failed, we have a standard mouse here. The number of the buttons
  * is still a question, though. We assume 3.
  */
@@ -559,7 +562,6 @@ static int psmouse_extensions(struct psm
  * extensions.
  */
 		psmouse_reset(psmouse);
-		ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
 	}
 
 	return PSMOUSE_PS2;

-- 
PS2 Mouse: Missing patch from 2.6.16
https://launchpad.net/bugs/46415




More information about the kernel-bugs mailing list