Messages in this thread Patch in this message | | | From | Vincent Stemen <> | Date | Thu, 9 Sep 1999 16:50:05 -0600 (MDT) | Subject | PS/2 mouse detection patch |
| |
Hi.
I discovered that the new kernels now always load the psaux driver whether there is a mouse present or not when psaux is turned on. This caused the auto mouse configuration boot scripts I had written to break when I upgraded from the 2.0.36 kernel. Also, when the device gets accessed and there is no PS/2 mouse present, the keyboard locks up.
I saw some comments in the kernel mailing list archives that this was apparently done because some people wanted to be able to hot plug a PS/2 mouse in without rebooting. The problem is, now there is no way to auto configure the mouse from boot up init scripts.
Attatched below is a patch I created that allows one to choose in the kernel configuration whether to require the PS/2 mouse to be present to load the psaux driver. I am in hopes this will be put in the official kernels. The patch was done against version 2.2.12.
Thanks. Vincent
diff -urN linux.orig/Documentation/Configure.help linux/Documentation/Configure.help --- linux.orig/Documentation/Configure.help Wed Aug 25 18:29:45 1999 +++ linux/Documentation/Configure.help Thu Sep 9 14:36:27 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 Wed Sep 8 21:42:13 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 Thu Sep 9 15:26:45 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> @@ -968,6 +972,13 @@ { if (!detect_auxiliary_port()) return -EIO; + +#ifndef CONFIG_ALWAYS_INITIALIZE_PSAUX + 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); | |