summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-07-29 04:20:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-07-29 04:20:38 +0000
commitbb9476cd0416fad53e76854eea2a348d516f96ea (patch)
tree7d9ab7f1d0e9717bd7604ff0ae48a7a798170b82 /sys/dev
parent68690c5ee08805c2ddd1cd76b913d23c4bc7ccd3 (diff)
Reenable the AUXWRITE dance to try and find the aux port in pckbc(4), based
on an attachment dependent flag; the Tadople SPARCLE needs it. ok kettenis@ deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/pckbc.c37
-rw-r--r--sys/dev/ic/pckbcvar.h3
2 files changed, 22 insertions, 18 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c
index 5a759389e0d..ce6df5bd1ac 100644
--- a/sys/dev/ic/pckbc.c
+++ b/sys/dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc.c,v 1.16 2008/07/16 20:03:22 miod Exp $ */
+/* $OpenBSD: pckbc.c,v 1.17 2008/07/29 04:20:37 miod Exp $ */
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */
/*
@@ -359,25 +359,28 @@ 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 0
- /*
- * The following code is necessary to find the aux port on the
- * oqo-1 machine. However if confuses old (non-ps/2) keyboard
- * controllers.
- */
- 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);
+
+ if (ISSET(t->t_flags, PCKBC_NEED_AUXWRITE)) {
+ /*
+ * The following code is necessary to find the aux port on the
+ * oqo-1 machine, among others. However if confuses old
+ * (non-ps/2) keyboard controllers (at least UMC880x again).
+ */
+ 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);
+ printf("kbc: aux echo: %x\n", res);
#endif
+ }
}
-#endif
+
if (res != -1) {
/*
* In most cases, the 0x5a gets echoed.
diff --git a/sys/dev/ic/pckbcvar.h b/sys/dev/ic/pckbcvar.h
index 75337423671..947f542ce3d 100644
--- a/sys/dev/ic/pckbcvar.h
+++ b/sys/dev/ic/pckbcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbcvar.h,v 1.6 2008/07/16 20:03:22 miod Exp $ */
+/* $OpenBSD: pckbcvar.h,v 1.7 2008/07/29 04:20:37 miod Exp $ */
/* $NetBSD: pckbcvar.h,v 1.4 2000/06/09 04:58:35 soda Exp $ */
/*
@@ -53,6 +53,7 @@ struct pckbc_internal {
int t_flags;
#define PCKBC_CANT_TRANSLATE 0x0001 /* can't translate to XT scancodes */
+#define PCKBC_NEED_AUXWRITE 0x0002 /* need auxwrite command to find aux */
int t_haveaux; /* controller has an aux port */
struct pckbc_slotdata *t_slotdata[PCKBC_NSLOTS];