[patch] Updated PS/2 mouse detection patch

Vincent Stemen (vstemen@crel.com)
Sat, 11 Sep 1999 14:41:35 -0600 (MDT)


Johan Myreen suggested that I modify the patch I posted earlier to skip
the auxiliary port detection logic if the BIOS detected a PS/2 mouse
connected because the port detection logic did not always work on all
machines. Here is an updated patch with that change.

--- 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/