Re: PS/2 Mouse not being detected in 2.2.12

Vincent Stemen (vstemen@crel.com)
Tue, 28 Sep 1999 02:02:27 -0600 (MDT)


tim.leeuwvander@nl.unisys.com writes:
> I've encountered the problem too; basically it's due to the different ways in
> which the 2.2.x kernels detect the mouse vs the 2.0.x kernels.
>
> To work around the problem, apply this patch for now:
>
> --- drivers/char/pc_keyb.c~ Tue Aug 10 22:17:55 1999
> +++ drivers/char/pc_keyb.c Wed Aug 18 21:52:22 1999
> @@ -966,7 +966,7 @@
>
> static int __init psaux_init(void)
> {
> - if (!detect_auxiliary_port())
> + if (1 || !detect_auxiliary_port())
> return -EIO;
>
> misc_register(&psaux_mouse);
>
> (credits to Alan Cox, my own version of the workaround is a bit more convoluted)
>
> I should get off my lazy bum and look more active into a 'real' fix or providing
> a boot-time option for it!
>
> --Tim

I am not sure I understand the patch above. It looks like it will
always return -EIO without registering the psaux device. My
understanding is that the new psaux port detection does not always
work on all hardware. However, the BIOS seems to always know the
mouse is there upon boot. The patch below is one I posted earlier
that I am hoping will be put in the official kernel but have not seen
any responses indicating it will be yet. It adds an option to the
kernel config menu that defaults to using the BIOS detection like the
old kernel but can be configured to behave like the 2.2.x kernels
currently do. It was created from 2.2.12. I created it because the
new kernels left no way to do auto mouse configuration upon boot like
we were doing with 2.0.x kernels. So far this patch has worked fine
for us.

Hope this helps.

---- Patch below ----

--- linux.orig/Documentation/Configure.help Wed Aug 25 18:29:45 1999
+++ linux/Documentation/Configure.help Fri Sep 10 20:38:47 1999
@@ -8426,6 +8426,15 @@
ftp://metalab.unc.edu/pub/Linux/system/Daemons) solves this
problem, or you can get the "mconv" utility also from metalab.

+Initialize the psaux driver even if a PS/2 mouse is not connected
+CONFIG_ALWAYS_INITIALIZE_PSAUX
+ If set to yes, the PS/2 auxiliary device driver will be loaded if
+ there is a PS/2 Mouse Port on your computer whether there is a mouse
+ connected to it or not. Normally this is set to no. This way boot up
+ init scripts can attempt to auto-configure the mouse, assuming there
+ is no PS/2 mouse if there is no psaux device. If set to no the PS/2
+ mouse must be plugged in at boot time to enable it.
+
C&T 82C710 mouse port support (as on TI Travelmate)
CONFIG_82C710_MOUSE
This is a certain kind of PS/2 mouse used on the TI Travelmate. If
diff -urN linux.orig/drivers/char/Config.in linux/drivers/char/Config.in
--- linux.orig/drivers/char/Config.in Wed Aug 25 18:29:46 1999
+++ linux/drivers/char/Config.in Fri Sep 10 20:37:32 1999
@@ -69,6 +69,9 @@
tristate 'Logitech busmouse support' CONFIG_BUSMOUSE
tristate 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE
bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
+ if [ "$CONFIG_PSMOUSE" = "y" ]; then
+ bool 'Initialize the psaux driver even if a PS/2 mouse is not connected' CONFIG_ALWAYS_INITIALIZE_PSAUX
+ fi
tristate 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE
tristate 'PC110 digitizer pad support' CONFIG_PC110_PAD
endmenu
diff -urN linux.orig/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
--- linux.orig/drivers/char/pc_keyb.c Mon Aug 9 13:04:39 1999
+++ linux/drivers/char/pc_keyb.c Fri Sep 10 21:55:23 1999
@@ -13,6 +13,10 @@
* Code fixes to handle mouse ACKs properly.
* C. Scott Ananian <cananian@alumni.princeton.edu> 1999-01-29.
*
+ * Added #ifndef CONFIG_ALWAYS_INITIALIZE_PSAUX code to optionally load
+ * the psaux driver if a PS/2 mouse is not connected.
+ * 1999-09-09 Vincent Stemen <vstemen@crel.com>
+ *
*/

#include <linux/config.h>
@@ -731,6 +735,10 @@
int loops = 10;
int retval = 0;

+ /* Check if the BIOS detected a device on the auxiliary port. */
+ if (aux_device_present == 0xaa)
+ return 1;
+
spin_lock_irqsave(&kbd_controller_lock, flags);

/* Put the value 0x5A in the output buffer using the "Write
@@ -968,6 +976,14 @@
{
if (!detect_auxiliary_port())
return -EIO;
+
+#ifndef CONFIG_ALWAYS_INITIALIZE_PSAUX
+ /* Check if the BIOS detected a device on the auxiliary port. */
+ if (aux_device_present != 0xaa)
+ return -EIO;
+ else
+ printk(KERN_INFO "PS/2 auxiliary pointing device detected -- driver installed.\n");
+#endif

misc_register(&psaux_mouse);
queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/