summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1997-02-07 11:41:45 +0000
committeryokota <yokota@FreeBSD.org>1997-02-07 11:41:45 +0000
commit32b56960eb9d10f9a6c1c6a3ec0e200b10d88c3f (patch)
treeaf3f1c12d30297a3e1020ec72abef8c06a121a4d /sys/i386
parent1a543bf107464272ac2cac3fc3a42101a20804de (diff)
downloadFreeBSD-src-32b56960eb9d10f9a6c1c6a3ec0e200b10d88c3f.zip
FreeBSD-src-32b56960eb9d10f9a6c1c6a3ec0e200b10d88c3f.tar.gz
Fix for the Compaq Armada laptop.
The PS/2 mouse device responds to a reset command with a sequence of ACK(fa), RESULT(aa) and ID(00). Most PS/2 mice immediately returns ACK, but spend sometime before sending RESULT. The Armada takes time before ACK; extra delay is necessary before the call to read ACK. The problem was reported in comp.unix.bsd.freebsd.misc and the patch was tested by the reporter. No PR was filed, by the way.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/isa/kbdio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/isa/kbdio.c b/sys/i386/isa/kbdio.c
index 24c509f..88c3f2b 100644
--- a/sys/i386/isa/kbdio.c
+++ b/sys/i386/isa/kbdio.c
@@ -878,7 +878,13 @@ reset_aux_dev(KBDC p)
if (!write_aux_command(p, PSMC_RESET_DEV))
continue;
emptyq(&kbdcp(p)->aux);
- c = read_aux_data(p);
+ /* NOTE: Compaq Armada laptops require extra delay here. XXX */
+ for (again = KBD_MAXWAIT; again > 0; --again) {
+ DELAY(KBD_RESETDELAY*1000);
+ c = read_aux_data_no_wait(p);
+ if (c != -1)
+ break;
+ }
if (verbose || bootverbose)
log(LOG_DEBUG, "kbdio: RESET_AUX return code:%04x\n", c);
if (c == PSM_ACK) /* aux dev is about to reset... */
@@ -887,10 +893,10 @@ reset_aux_dev(KBDC p)
if (retry < 0)
return FALSE;
- while (again-- > 0) {
+ for (again = KBD_MAXWAIT; again > 0; --again) {
/* wait awhile, well, quite looooooooooooong */
DELAY(KBD_RESETDELAY*1000);
- c = read_aux_data(p); /* RESET_DONE/RESET_FAIL */
+ c = read_aux_data_no_wait(p); /* RESET_DONE/RESET_FAIL */
if (c != -1) /* wait again if the controller is not ready */
break;
}
OpenPOWER on IntegriCloud