diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-07-16 20:03:23 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-07-16 20:03:23 +0000 |
commit | f4c3215d929c4f4e37ecb0c1bc54f824318df42a (patch) | |
tree | afc8cd62bc512c8de5f73dd13808ce7a713558aa /sys/dev | |
parent | 68330ed749561ba61b9cb79efdedd3137e66aaa3 (diff) |
Add a new parameter to pckbc_cnattach(): flags to put in the pckbc bowels.
For now, only one such flag is defined, PCKBC_CANT_TRANSLATE. It hints
pckbc that the device does not behave correctly to the ``set translation''
commands.
Set this flag if we are running on a Tadpole Ultrabook machine, which needs it.
This makes the built-in keyboard work correctly on this laptop (with the
help of the software translation pckbd diff).
tested & ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/pckbc.c | 9 | ||||
-rw-r--r-- | sys/dev/ic/pckbcvar.h | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index b1b798edf3d..5a759389e0d 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.15 2007/11/26 22:45:27 miod Exp $ */ +/* $OpenBSD: pckbc.c,v 1.16 2008/07/16 20:03:22 miod Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -475,7 +475,8 @@ pckbc_xt_translation(self, slot, on) struct pckbc_internal *t = self; int ison; - if (slot != PCKBC_KBD_SLOT) { + if (ISSET(t->t_flags, PCKBC_CANT_TRANSLATE) || + slot != PCKBC_KBD_SLOT) { /* translation only for kbd slot */ if (on) return (0); @@ -998,11 +999,12 @@ pckbcintr_internal(t, sc) } int -pckbc_cnattach(iot, addr, cmd_offset, slot) +pckbc_cnattach(iot, addr, cmd_offset, slot, flags) bus_space_tag_t iot; bus_addr_t addr; bus_size_t cmd_offset; pckbc_slot_t slot; + int flags; { bus_space_handle_t ioh_d, ioh_c; int res = 0; @@ -1018,6 +1020,7 @@ pckbc_cnattach(iot, addr, cmd_offset, slot) pckbc_consdata.t_ioh_d = ioh_d; pckbc_consdata.t_ioh_c = ioh_c; pckbc_consdata.t_addr = addr; + pckbc_consdata.t_flags = flags; timeout_set(&pckbc_consdata.t_cleanup, pckbc_cleanup, &pckbc_consdata); timeout_set(&pckbc_consdata.t_poll, pckbc_poll, &pckbc_consdata); diff --git a/sys/dev/ic/pckbcvar.h b/sys/dev/ic/pckbcvar.h index e5db6e5f54a..75337423671 100644 --- a/sys/dev/ic/pckbcvar.h +++ b/sys/dev/ic/pckbcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbcvar.h,v 1.5 2007/01/31 14:35:51 mickey Exp $ */ +/* $OpenBSD: pckbcvar.h,v 1.6 2008/07/16 20:03:22 miod Exp $ */ /* $NetBSD: pckbcvar.h,v 1.4 2000/06/09 04:58:35 soda Exp $ */ /* @@ -51,7 +51,10 @@ struct pckbc_internal { bus_addr_t t_addr; u_char t_cmdbyte; /* shadow */ + int t_flags; +#define PCKBC_CANT_TRANSLATE 0x0001 /* can't translate to XT scancodes */ int t_haveaux; /* controller has an aux port */ + struct pckbc_slotdata *t_slotdata[PCKBC_NSLOTS]; struct pckbc_softc *t_sc; /* back pointer */ @@ -103,7 +106,7 @@ void pckbc_slot_enable(pckbc_tag_t, pckbc_slot_t, int); void pckbc_attach(struct pckbc_softc *); int pckbc_cnattach(bus_space_tag_t, bus_addr_t, bus_size_t, - pckbc_slot_t); + pckbc_slot_t, int); int pckbc_is_console(bus_space_tag_t, bus_addr_t); int pckbcintr(void *); |