PS/2 mouse rate setting
Subsystems (2)
PATCH 1/1 PS/2 mouse rate setting
My KVM doesn't like the new default of psmouse_rate=200. The mouse felt very "jumpy" and was unconvenient to use.
Unfortunately the setting could be only changed when the mouse driver was a module. But I tend to have the mouse driver compiled in. This patch fixes this by adding an __setup for it too.
Also it fixes an off by one bug to make sure that psmouse_rate=60 really gives 60 samples per second and not 40.
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.
-Andi
drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +8 -1
@@ -454,7 +454,7 @@unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 };int i =0 ; -while (rates[i] > psmouse_rate) i++; +while (rates[i] >= psmouse_rate) i++;psmouse_command (psmouse, rates + i,PSMOUSE_CMD_SETRATE ); }
@@ -651,10 +651,17 @@ return 1; } +static int __init psmouse_rate_setup (char *str) +{ +get_option (&str, &psmouse_rate); +return 1 ; +} +__setup ("psmouse_noext" , psmouse_noext_setup);__setup ("psmouse_resolution=" , psmouse_resolution_setup);__setup ("psmouse_smartscroll=" , psmouse_smartscroll_setup);__setup ("psmouse_resetafter=" , psmouse_resetafter_setup); +__setup ("psmouse_rate=" , psmouse_rate_setup);#endif
Quoted 5 lines · Andi Kleen
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (
psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.
I agree. The keyboard driver has also deteriorated, I think.
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
Linus
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Andi Kleen
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (
psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.
Quoted 5 lines
I agree. The keyboard driver has also deteriorated, I think.
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
Here's the new patch with this change.
-Andi
-------------------------------------------------------------
Add an psmouse_rate option for the kernel command line.
Don't set the psmouse sample rate unless the user specified a value.
Make rates[] array static
drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +13 -3
@@ -40,7 +40,7 @@static int psmouse_noext;int psmouse_resolution; -unsigned int psmouse_rate =60 ; +unsigned int psmouse_rate =0 ;int psmouse_smartscroll =PSMOUSE_LOGITECH_SMARTSCROLL ;unsigned int psmouse_resetafter;
@@ -451,10 +451,13 @@static void psmouse_set_rate (struct psmouse *psmouse) { -unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 }; +static unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 };int i =0 ; -while (rates[i] > psmouse_rate) i++; +if (!psmouse_rate) +return ; + +while (rates[i] >= psmouse_rate) i++;psmouse_command (psmouse, rates + i,PSMOUSE_CMD_SETRATE ); }
@@ -651,10 +654,17 @@ return 1; } +static int __init psmouse_rate_setup (char *str) +{ +get_option (&str, &psmouse_rate); +return 1 ; +} +__setup ("psmouse_noext" , psmouse_noext_setup);__setup ("psmouse_resolution=" , psmouse_resolution_setup);__setup ("psmouse_smartscroll=" , psmouse_smartscroll_setup);__setup ("psmouse_resetafter=" , psmouse_resetafter_setup); +__setup ("psmouse_rate=" , psmouse_rate_setup);#endif
drivers/input/mouse/psmouse-base.c line 460
Quoted 11 lines · Andi Kleen
static void
psmouse_set_rate(struct psmouse *psmouse){drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +5
-2-unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 }; +static unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 };int i =0 ; -while (rates[i] > psmouse_rate) i++; +if (!psmouse_rate) +return ; + +while (rates[i] >= psmouse_rate) i++;
Ok, explain that ">=" to me. It looked more right the way it used to be.
In particular, if you want a rate of 200, you will now make "i" be _1_, so we send a command to set the rate to 100.
Which makes no sense.
Linus
Quoted 2 lines · Linus Torvalds
Which makes no sense.
Ok new patch with this fixed.
---------------------------
Only set PS/2 mouse rate when the user specified a value.
Allow specifying it from the command line when the driver is compiled in.
Make rates[] static.
drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +12 -2
@@ -40,7 +40,7 @@static int psmouse_noext;int psmouse_resolution; -unsigned int psmouse_rate =60 ; +unsigned int psmouse_rate =0 ;int psmouse_smartscroll =PSMOUSE_LOGITECH_SMARTSCROLL ;unsigned int psmouse_resetafter;
@@ -451,9 +451,12 @@static void psmouse_set_rate (struct psmouse *psmouse) { -unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 }; +static unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 };int i =0 ; +if (!psmouse_rate) +return ; +while (rates[i] > psmouse_rate) i++;psmouse_command (psmouse, rates + i,PSMOUSE_CMD_SETRATE ); }
@@ -651,10 +654,17 @@ return 1; } +static int __init psmouse_rate_setup (char *str) +{ +get_option (&str, &psmouse_rate); +return 1 ; +} +__setup ("psmouse_noext" , psmouse_noext_setup);__setup ("psmouse_resolution=" , psmouse_resolution_setup);__setup ("psmouse_smartscroll=" , psmouse_smartscroll_setup);__setup ("psmouse_resetafter=" , psmouse_resetafter_setup); +__setup ("psmouse_rate=" , psmouse_rate_setup);#endif
drivers/input/mouse/psmouse-base.c
Quoted 12 lines · Andi Kleen
Quoted 3 lines · Linus Torvalds
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
Here's the new patch with this change.
drivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +2
-1-unsigned int psmouse_rate =60 ; +unsigned int psmouse_rate =0 ; +__setup ("psmouse_rate=" , psmouse_rate_setup);
Hmm. I hate this.
Linus, please - don't ask for such things.
Our kernel does not need twelve thousand boot parameters.
Mouse rate is of no importance during boot. Ergo, there is no reason to have it a boot parameter.
Doing the default thing is good enough, I agree.
And if the user wants something else, userspace should take care.
Andries
Quoted 1 line · Andries Brouwer
Ergo, there is no reason to have it a boot parameter.
I'd agree. I don't really see the point of setting rate/resolution at _all_. But we've done it in 2.5.x, and somebody may have a valid reason for it, so when disabling it by default, leaving the option to specialize is probably a good idea.
Linus
Quoted 5 lines · Andi Kleen
Quoted 2 lines · Linus Torvalds
Which makes no sense.
Ok new patch with this fixed.
Thanks, this one is good.
Quoted 53 lines
---------------------------
Only set PS/2 mouse rate when the user specified a value.
Allow specifying it from the command line when the driver is compiled in.
Make rates[] static.
diff -u linux-2.6.0test9-averell/drivers/input/mouse/psmouse-base.c-o
linux-2.6.0test9-averell/drivers/input/mouse/psmouse-base.cdrivers/input/mouse/psmouse-base.c renamed from drivers/input/mouse/psmouse-base.c-o +12
-2@@ -40,7 +40,7 @@static int psmouse_noext;int psmouse_resolution; -unsigned int psmouse_rate =60 ; +unsigned int psmouse_rate =0 ;int psmouse_smartscroll =PSMOUSE_LOGITECH_SMARTSCROLL ;unsigned int psmouse_resetafter;@@ -451,9 +451,12 @@static void psmouse_set_rate (struct psmouse *psmouse) { -unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 }; +static unsigned char rates[] = {200 ,100 ,80 ,60 ,40 ,20 ,10 ,0 };int i =0 ; +if (!psmouse_rate) +return ; +while (rates[i] > psmouse_rate) i++;psmouse_command (psmouse, rates + i,PSMOUSE_CMD_SETRATE ); }@@ -651,10 +654,17 @@ return 1; } +static int __init psmouse_rate_setup (char *str) +{ +get_option (&str, &psmouse_rate); +return 1 ; +} +__setup ("psmouse_noext" , psmouse_noext_setup);__setup ("psmouse_resolution=" , psmouse_resolution_setup);__setup ("psmouse_smartscroll=" , psmouse_smartscroll_setup);__setup ("psmouse_resetafter=" , psmouse_resetafter_setup); +__setup ("psmouse_rate=" , psmouse_rate_setup);#endif
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Quoted 2 lines · Vojtech Pavlik
Thanks, this one is good.
Note that the final one that made it into the kernel was slightly different, in that I worry about the fact that "psmouse_command" can change the source array, so I didn't do the "static" part (I know, I know, I looked up PSMOUSE_CMD_SETRATE and it has zero result bytes, but I decided to keep the patch minimal).
I also did the test for not-set in the caller, rather than change the rate setting itself.
Linus
Quoted 5 lines · Linus Torvalds
Quoted 2 lines · Vojtech Pavlik
Thanks, this one is good.
Quoted 8 lines
Note that the final one that made it into the kernel was slightly different, in that I worry about the fact that "
psmouse_command" can change the source array, so I didn't do the "static" part (I know, I know, I looked upPSMOUSE_CMD_SETRATEand it has zero result bytes, but I decided to keep the patch minimal).I also did the test for not-set in the caller, rather than change the rate setting itself.
Fine with me, too. I'll be sending you a bunch of small fixes for atkbd.c tomorrow, including one that's the 'bigger surgery' (it in reality doesn't look that big) that's mentioned in Andries's last patch.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Andi Kleen
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (
psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.
Quoted 6 lines
I agree. The keyboard driver has also deteriorated, I think.
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
I need this patch to use the scroll wheel on my Logitech mouse
with my Belkin KVM switch in 2.6. This patch was in -mm for a while before some changes there broke the diff, and I got some mail from people who said it was helpful. I didn't hear about any problems.
Linus, will you please consider applying it?
The new mouse autodetection sets my mouse up to use the Logitech
ps2++ protocol, but Belkin KVMs speak only the Microsoft Intellimouse protocol and plain ps2. In 2.4, with X and GPM set up to use the imps2 protocol, things work fine -- my mouse also speaks imps2 -- but in 2.6 I don't get a choice.
One person also used it to disable the Synaptic touchpad driver at
runtime without disabling the scroll wheel on their external mouse. I think the parameter this patch adds should cover most regressions that have to do with the mouse autodetection, since the Intellimouse protocol seems to be kind of a lowest common denominator because Windows supports it out of the box.
Unfortunately, I was unable to get any sort of comment from
Vojtech Pavlik about this patch.
Signature · 4 lines
Joseph Fannin [email protected] "That's all I have to say about that." -- Forrest Gump.
Quoted 16 lines · On Mon, Oct 27, 2003 at 10:52:44PM -0500, I wrote:
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Andi Kleen
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (
psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.Quoted 6 lines
I agree. The keyboard driver has also deteriorated, I think.
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
Quoted 6 lines
I need this patch to use the scroll wheel on my Logitech mouse
with my Belkin KVM switch in 2.6. This patch was in -mm for a while before some changes there broke the diff, and I got some mail from people who said it was helpful. I didn't hear about any problems.Linus, will you please consider applying it?
D'oh, forgot the patch. This is the same patch that was in -mm,
rediffed against -test9 and tested to compile. I've been running this same patch on vanilla and -mm kernels for months now.
Signature · 6 lines
Joseph Fannin [email protected] Rothchild's Rule -- "For every phenomenon, however complex, someone will eventually come up with a simple and elegant theory. This theory will be wrong."
Documentation/kernel-parameters.txt +2 -0
@@ -790,6 +790,8 @@ before loading. See Documentation/ramdisk.txt. + psmouse_imps2 [HW,MOUSE] Probe only for Intellimouse PS2 mouse protocol extensions + psmouse_noext [HW,MOUSE] Disable probing for PS2 mouse protocol extensions psmouse_resetafter=
drivers/input/mouse/psmouse-base.c +62 -50
152 lines not on this page · raw message
Quoted 17 lines · On Mon, Oct 27, 2003 at 10:56:25PM -0500, [email protected] wrote:
Quoted 16 lines · On Mon, Oct 27, 2003 at 10:52:44PM -0500, I wrote:
Quoted 14 lines · Linus Torvalds
Quoted 5 lines · Andi Kleen
Overall as KVM user I must say I'm not very happy with the 2.6 mouse driver. 2.4 pretty much worked out of the box, but 2.6 needs lots of strange options (
psmouse_noext, psmouse_rate=80) because it does things very differently out of the box.I agree. The keyboard driver has also deteriorated, I think.
I'd suggest we _not_ set the rate by default at all (and let the default thing just happen). And only set the rate if the user _asks_ for it with your setup thing. Mind sending me that kind of patch?
Quoted 6 lines
Quoted 6 lines
I need this patch to use the scroll wheel on my Logitech mouse
with my Belkin KVM switch in 2.6. This patch was in -mm for a while before some changes there broke the diff, and I got some mail from people who said it was helpful. I didn't hear about any problems.Linus, will you please consider applying it?
Plase not in this shape. I don't want yet another option to the driver. Dmitry said he'll whip up a patch that with a single option can limit the maximum protocol of the PS/2 mouse to either PS/2, IMPS/2 or ImExPS/2, possibly more, "psmouse_proto=". That's a better solution.
Quoted 184 lines
D'oh, forgot the patch. This is the same patch that was in -mm,
rediffed against -test9 and tested to compile. I've been running this same patch on vanilla and -mm kernels for months now.Signature · 8 lines
Joseph Fannin [email protected] Rothchild's Rule -- "For every phenomenon, however complex, someone will eventually come up with a simple and elegant theory. This theory will be wrong." diff -aur linux-2.6.0-test9_orig/Documentation/kernel-parameters.txt linux-2.6.0-test9/Documentation/kernel-parameters.txtDocumentation/kernel-parameters.txt +2
-0@@ -790,6 +790,8 @@ before loading. See Documentation/ramdisk.txt. + psmouse_imps2 [HW,MOUSE] Probe only for Intellimouse PS2 mouse protocol extensions + psmouse_noext [HW,MOUSE] Disable probing for PS2 mouse protocol extensions psmouse_resetafter=diff -aur
linux-2.6.0-test9_orig/drivers/input/mouse/psmouse-base.clinux-2.6.0-test9/drivers/input/mouse/psmouse-base.cdrivers/input/mouse/psmouse-base.c +62
-50@@ -24,6 +24,8 @@MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>" );MODULE_DESCRIPTION ("PS/2 mouse driver" ); +MODULE_PARM (psmouse_imps2,"1i" ); +MODULE_PARM_DESC (psmouse_imps2,"Limit protocol extensions to the Intellimouse protocol." );MODULE_PARM (psmouse_noext,"1i" );MODULE_PARM_DESC (psmouse_noext,"Disable any protocol extensions. Useful for KVM switches." );MODULE_PARM (psmouse_resolution,"i" );@@ -38,6 +40,7 @@#define PSMOUSE_LOGITECH_SMARTSCROLL 1 +static int psmouse_imps2;static int psmouse_noext;int psmouse_resolution;unsigned int psmouse_rate =60 ;@@ -275,66 +278,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. */ @@ -627,6 +632,12 @@ };#ifndef MODULE +static int __init psmouse_imps2_setup (char *str) +{ + psmouse_imps2 =1 ; +return 1 ; +} +static int __init psmouse_noext_setup (char *str) { psmouse_noext =1 ;@@ -651,6 +662,7 @@return 1 ; } +__setup ("psmouse_imps2" , psmouse_imps2_setup);__setup ("psmouse_noext" , psmouse_noext_setup);__setup ("psmouse_resolution=" , psmouse_resolution_setup);__setup ("psmouse_smartscroll=" , psmouse_smartscroll_setup);
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Quoted 5 lines · Vojtech Pavlik
Quoted 5 lines
Quoted 5 lines
I need this patch to use the scroll wheel on my Logitech mouse
with my Belkin KVM switch in 2.6. This patch was in -mm for a while before some changes there broke the diff, and I got some mail from people who said it was helpful. I didn't hear about any problems.
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Linus, will you please consider applying it?
Plase not in this shape. I don't want yet another option to the driver. Dmitry said he'll whip up a patch that with a single option can limit the maximum protocol of the PS/2 mouse to either PS/2, IMPS/2 or ImExPS/2, possibly more, "psmouse_proto=". That's a better solution.
Here it is... New parameter psmouse_proto={bare|imps|exps}. I don't think we should bother with providing options for the rest of the protocols as these 3 are most generic ones.
I marked psmouse_noext deprecated and psmouse will emit a warning if it is used, if you think we can still remove it completely at this time just let me know.
I also changed the parameter processing to module_param as it is much easier.
Dmitry
===================================================================
[email protected], 2003-10-29 01:24:15-05:00, [email protected]
Input: New parameter psmouse_maxproto to replace psmouse_noext.
Allows to specify highest PS/2 protocol extension that kernel has permission to negotiate (bare|imps|exps).
psmouse_noext marked as deprecated and emits a warning when used.
Parameter parsing converted to the new scheme.
Documentation/kernel-parameters.txt | 3 drivers/input/mouse/logips2pp.c | 21 +++ drivers/input/mouse/logips2pp.h | 2 drivers/input/mouse/psmouse-base.c | 227 ++++++++++++++++-------------------- drivers/input/mouse/synaptics.c | 19 ++- drivers/input/mouse/synaptics.h | 1 6 files changed, 146 insertions(+), 127 deletions(-)
Documentation/kernel-parameters.txt +2 -1
@@ -790,7 +790,8 @@ before loading. See Documentation/ramdisk.txt. - psmouse_noext [HW,MOUSE] Disable probing for PS2 mouse protocol extensions + psmouse_proto= [HW,MOUSE] Highest PS2 mouse protocol extension to + probe for (bare|imps|exps). psmouse_resetafter= [HW,MOUSE] Try to reset Synaptics Touchpad after so many
drivers/input/mouse/logips2pp.c +20 -1
@@ -142,7 +142,7 @@* touchpad. */ -int ps2pp_detect_model (struct psmouse *psmouse,unsigned char *param) +static int ps2pp_detect_model (struct psmouse *psmouse,unsigned char *param) {int i;static int logitech_4btn[] = {12 ,40 ,41 ,42 ,43 ,52 ,73 ,80 ,-1 };
@@ -226,3 +226,22 @@return 0 ; } + +/* +* Logitech magic init. +*/ +int ps2pp_detect (struct psmouse *psmouse) +{ +unsigned char param[4 ]; + + 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 ); + +return param[1 ] !=0 ?ps2pp_detect_model (psmouse, param) :0 ; +} +
drivers/input/mouse/logips2pp.h +1 -1
@@ -13,5 +13,5 @@struct psmouse ;void ps2pp_process_packet (struct psmouse *psmouse);void ps2pp_set_800dpi (struct psmouse *psmouse); -int ps2pp_detect_model (struct psmouse *psmouse,unsigned char *param); +int ps2pp_detect (struct psmouse *psmouse);#endif
drivers/input/mouse/psmouse-base.c +107 -120
296 lines not on this page · raw message
drivers/input/mouse/synaptics.c +15 -4
@@ -371,13 +371,24 @@clear_bit (REL_Y , dev->relbit); } +int synaptics_detect (struct psmouse *psmouse) +{ +unsigned char param[4 ]; + + 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 ); + +return param[1 ] ==0x47 ; +} +int synaptics_init (struct psmouse *psmouse) {struct synaptics_data *priv; - -#ifndef CONFIG_MOUSE_PS2_SYNAPTICS -return -1 ; -#endif psmouse->private = priv =kmalloc (sizeof (struct synaptics_data ),GFP_KERNEL );if (!priv)
drivers/input/mouse/synaptics.h +1 -0
@@ -11,6 +11,7 @@extern void synaptics_process_byte (struct psmouse *psmouse,struct pt_regs *regs); +extern int synaptics_detect (struct psmouse *psmouse);extern int synaptics_init (struct psmouse *psmouse);extern int synaptics_pt_init (struct psmouse *psmouse);extern void synaptics_disconnect (struct psmouse *psmouse);
===================================================================
This BitKeeper patch contains the following changesets:
1.1381
## Wrapped with gzip_uu ##
M'XL( 'M=GS\ ]U:;7/:2!+^C'[%K%.W,8D-,Z-7[',NCF$=*MBFP+GD*DY1 M0AHLG86DDH2Q[]C_?CTC(23 9.X[NJR6R%(H^Z>[J>[GQ[Q"GV.6714L9,@ M&EA!Q*17Z&,0)T<5<\PB-V&64_-9 E=[00!7ZY,XJL>150_C<3")F01WNF9B M.>B>1?%1A=3D_$KR&+*C2J]U_KESVI.DDQ-TYIC^+>NS!)V<2*#QWO3L^+V9 M.%[@UY+(].,Q2\R:%8QG^=(9Q9C"?RK19:QJ,Z)A19]9Q";$5 BS,54,35E( M<X(QJP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M,\;[P+47XQ1/A53-/K]1Y8\"B0%_:%"5EFJ.&$JR(A+!_N_V/[5ZEX,OI[W+ M]N4YVLO6':'7I2=>HR#DM!FYQ5^K@#,\!D,9_TW*X@%ARNL;?Z]:P%-I EE. MK::F\G=6;4V#[email protected])( _$TH*_]DAE_@_'#EZ#P NA>Y-N2YF_ \+F]:K,FP M!I=_@^Y@C<.5489/*7M5@;#-5E>8!YO^D3@^[FPACH-Q*WE\<-I*7NOK7%YZ M$+\(<ZO7*X1XXM_YP=1?E$J1A*__$O/@'90]7,T"!23:@$#I5-"&-1#D[Y3F ;OW>#@<ZZBR?CDZ$YLG0R;$C_ 8XFF\9>)P
Quoted 18 lines · Dmitry Torokhov
Quoted 5 lines · Vojtech Pavlik
Quoted 5 lines
Quoted 5 lines
I need this patch to use the scroll wheel on my Logitech mouse
with my Belkin KVM switch in 2.6. This patch was in -mm for a while before some changes there broke the diff, and I got some mail from people who said it was helpful. I didn't hear about any problems.Quoted 7 lines
Quoted 1 line
Quoted 1 line
Linus, will you please consider applying it?
Plase not in this shape. I don't want yet another option to the driver. Dmitry said he'll whip up a patch that with a single option can limit the maximum protocol of the PS/2 mouse to either PS/2, IMPS/2 or ImExPS/2, possibly more, "psmouse_proto=". That's a better solution.
Here it is... New parameter psmouse_proto={bare|imps|exps}. I don't think we should bother with providing options for the rest of the protocols as these 3 are most generic ones.
Quoted 6 lines
I marked
psmouse_noextdeprecated and psmouse will emit a warning if it is used, if you think we can still remove it completely at this time just let me know.I also changed the parameter processing to
module_paramas it is much easier.
Thanks!
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR