diff options
author | joshua stein <jcs@cvs.openbsd.org> | 2005-08-06 19:49:20 +0000 |
---|---|---|
committer | joshua stein <jcs@cvs.openbsd.org> | 2005-08-06 19:49:20 +0000 |
commit | 9f36dcaaddbb3cb52a01409a14c2f52efd1287d8 (patch) | |
tree | 359d38c9a9f9f40e02f72d58548d3cb35116345a | |
parent | 52ab601dade5c95d578f3f615e453606585cb589 (diff) |
while checking for an aux port, if we timeout waiting for our test
data to echo back, send KBC_AUXWRITE and send the test again
required to find the aux port on the oqo model 01
ok mickey@ and miod@
-rw-r--r-- | sys/dev/ic/pckbc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 60fab5c4b94..ae82e0c34d5 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.9 2004/11/02 21:21:00 miod Exp $ */ +/* $OpenBSD: pckbc.c,v 1.10 2005/08/06 19:49:19 jcs Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -355,6 +355,18 @@ pckbc_attach(sc) } bus_space_write_1(iot, ioh_d, 0, 0x5a); /* a random value */ res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_AUX_SLOT, 1); + if (res == -1) { + /* Read of aux echo timed out, try again */ + if (!pckbc_send_cmd(iot, ioh_c, KBC_AUXWRITE)) + goto nomouse; + if (!pckbc_wait_output(iot, ioh_c)) + goto nomouse; + bus_space_write_1(iot, ioh_d, 0, 0x5a); + res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_AUX_SLOT, 1); +#ifdef PCKBCDEBUG + printf("kbc: aux echo: %x\n", res); +#endif + } if (res != -1) { /* * In most cases, the 0x5a gets echoed. |