-/* $OpenBSD: pckbc_ebus.c,v 1.9 2008/07/16 20:03:22 miod Exp $ */
+/* $OpenBSD: pckbc_ebus.c,v 1.10 2008/07/29 04:20:35 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
char model[128];
OF_getprop(ea->ea_node, "model", &model, sizeof model);
if (strcmp(model, "INTC,80c42") == 0)
- flags = PCKBC_CANT_TRANSLATE;
+ flags = PCKBC_CANT_TRANSLATE | PCKBC_NEED_AUXWRITE;
}
if (console) {
-/* $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 $ */
/*
}
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.
-/* $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 $ */
/*
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];