linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Logitech ps2++ scroll wheel + KVM fix (sort of)
@ 2003-07-21 20:43 Joseph Fannin
  0 siblings, 0 replies; only message in thread
From: Joseph Fannin @ 2003-07-21 20:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: vojtech

[-- Attachment #1: Type: text/plain, Size: 6932 bytes --]

    I've found a fix for a problem I was having with the combination
of my Logitech trackball's scrollwheel and my KVM switch.  My scroll
wheel would work until I switched away from my Linux desktop; after
switching back, the evbug module reported no events when turning the
wheel.

    According to Belkin, this is because my KVM switch does not
support the Logitech protocol, only the MS Intellimouse one.  I
noticed that WinXP had no such problems, so I commented out the section
in psmouse_extensions() that detected Logitech mice.  Now my trackball
is detected as a "ImPS/2 Generic Wheel Mouse" and the scroll wheel
always works.

    It would be good to have a parameter that would allow me to force
this mouse to use the ImPS/2 protocol rather than the logitech PS2++; I
probably won't be the last person to have this kind of problem (which
I didn't have with 2.4).

    The following patch makes that parameter: psmouse_imps2.  Will you
consider it applying it, or something like it?
    
diff -urN linux-2.6.0-test1/Documentation/kernel-parameters.txt linux-2.6.0-test1-changed/Documentation/kernel-parameters.txt
--- linux-2.6.0-test1/Documentation/kernel-parameters.txt	2003-07-21 15:27:06.000000000 -0400
+++ linux-2.6.0-test1-changed/Documentation/kernel-parameters.txt	2003-07-21 16:31:16.000000000 -0400
@@ -780,6 +780,8 @@
 
 	psmouse_noext	[HW,MOUSE] Disable probing for PS2 mouse protocol extensions
 
+	psmouse_imps2	[HW,MOUSE] Probe only for Intellimouse PS2 mouse protocol extensions
+
 	pss=		[HW,OSS] Personal Sound System (ECHO ESC614)
 			Format: <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>
 
diff -urN linux-2.6.0-test1/drivers/input/mouse/psmouse-base.c linux-2.6.0-test1-changed/drivers/input/mouse/psmouse-base.c
--- linux-2.6.0-test1/drivers/input/mouse/psmouse-base.c	2003-07-02 16:43:30.000000000 -0400
+++ linux-2.6.0-test1-changed/drivers/input/mouse/psmouse-base.c	2003-07-21 16:05:24.000000000 -0400
@@ -25,6 +25,8 @@
 MODULE_DESCRIPTION("PS/2 mouse driver");
 MODULE_PARM(psmouse_noext, "1i");
 MODULE_PARM_DESC(psmouse_noext, "Disable any protocol extensions. Useful for KVM switches.");
+MODULE_PARM(psmouse_imps2, "1i");
+MODULE_PARM_DESC(psmouse_imps2, "Limit protocol extensions to the Intellimouse protocol.");
 MODULE_PARM(psmouse_resolution, "i");
 MODULE_PARM_DESC(psmouse_resolution, "Resolution, in dpi.");
 MODULE_PARM(psmouse_smartscroll, "i");
@@ -34,6 +36,7 @@
 #define PSMOUSE_LOGITECH_SMARTSCROLL	1
 
 static int psmouse_noext;
+static int psmouse_imps2;
 int psmouse_resolution;
 int psmouse_smartscroll = PSMOUSE_LOGITECH_SMARTSCROLL;
 
@@ -250,66 +253,68 @@
 	if (psmouse_noext)
 		return PSMOUSE_PS2;
 
-/*
- * Try Synaptics TouchPad magic ID
- */
-
-       param[0] = 0;
-       psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-       psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-       psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-       psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-       psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+	if (!psmouse_imps2) {
 
-       if (param[1] == 0x47) {
-		psmouse->vendor = "Synaptics";
-		psmouse->name = "TouchPad";
-		if (!synaptics_init(psmouse))
-			return PSMOUSE_SYNAPTICS;
-		else
-			return PSMOUSE_PS2;
-       }
+		/*
+		 * Try Synaptics TouchPad magic ID
+		 */
 
-/*
- * Try Genius NetMouse magic init.
- */
+		param[0] = 0;
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+		if (param[1] == 0x47) {
+			psmouse->vendor = "Synaptics";
+			psmouse->name = "TouchPad";
+			if (!synaptics_init(psmouse))
+				return PSMOUSE_SYNAPTICS;
+			else
+				return PSMOUSE_PS2;
+		}
 
-	param[0] = 3;
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+		/*
+		 * Try Genius NetMouse magic init.
+		 */
 
-	if (param[0] == 0x00 && param[1] == 0x33 && param[2] == 0x55) {
+		param[0] = 3;
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
 
-		set_bit(BTN_EXTRA, psmouse->dev.keybit);
-		set_bit(BTN_SIDE, psmouse->dev.keybit);
-		set_bit(REL_WHEEL, psmouse->dev.relbit);
+		if (param[0] == 0x00 && param[1] == 0x33 && param[2] == 0x55) {
 
-		psmouse->vendor = "Genius";
-		psmouse->name = "Wheel Mouse";
-		return PSMOUSE_GENPS;
-	}
+			set_bit(BTN_EXTRA, psmouse->dev.keybit);
+			set_bit(BTN_SIDE, psmouse->dev.keybit);
+			set_bit(REL_WHEEL, psmouse->dev.relbit);
 
-/*
- * Try Logitech magic ID.
- */
+			psmouse->vendor = "Genius";
+			psmouse->name = "Wheel Mouse";
+			return PSMOUSE_GENPS;
+		}
 
-	param[0] = 0;
-	psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
-	param[1] = 0;
-	psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+		/*
+		 * Try Logitech magic ID.
+		 */
 
-	if (param[1]) {
-		int type = ps2pp_detect_model(psmouse, param);
-		if (type)
-			return type;
+		param[0] = 0;
+		psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		psmouse_command(psmouse,  NULL, PSMOUSE_CMD_SETSCALE11);
+		param[1] = 0;
+		psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+		if (param[1]) {
+			int type = ps2pp_detect_model(psmouse, param);
+			if (type)
+				return type;
+		}
 	}
-
 /*
  * Try IntelliMouse magic init.
  */
@@ -555,6 +560,12 @@
 	return 1;
 }
 
+static int __init psmouse_imps2_setup(char *str)
+{
+	psmouse_imps2 = 1;
+	return 1;
+}
+
 static int __init psmouse_resolution_setup(char *str)
 {
 	get_option(&str, &psmouse_resolution);
@@ -568,6 +579,7 @@
 }
 
 __setup("psmouse_noext", psmouse_noext_setup);
+__setup("psmouse_imps2", psmouse_imps2_setup);
 __setup("psmouse_resolution=", psmouse_resolution_setup);
 __setup("psmouse_smartscroll=", psmouse_smartscroll_setup);
 
-- 
Joseph Fannin
jhf@rivenstone.net

"Bull in pure form is rare; there is usually some contamination by data."
    -- William Graves Perry Jr.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-21 20:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 20:43 Logitech ps2++ scroll wheel + KVM fix (sort of) Joseph Fannin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).