Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp300/dev Send break signal to reset keyboard state...
details: https://anonhg.NetBSD.org/src/rev/96ed414428d8
branches: trunk
changeset: 352305:96ed414428d8
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Mar 25 01:48:31 2017 +0000
description:
Send break signal to reset keyboard state before keyboard probe.
Now Apollo Domain keyboard is probed properly even after
any keys are typed before boot (i.e. on bootloader prompt).
Tested on 425e and A1630-82001 keyboard
(that were contributed by Miod Vallat).
diffstat:
sys/arch/hp300/dev/dnkbd.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diffs (55 lines):
diff -r dcf7f3db26ce -r 96ed414428d8 sys/arch/hp300/dev/dnkbd.c
--- a/sys/arch/hp300/dev/dnkbd.c Sat Mar 25 01:39:20 2017 +0000
+++ b/sys/arch/hp300/dev/dnkbd.c Sat Mar 25 01:48:31 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dnkbd.c,v 1.7 2014/04/24 12:10:27 tsutsui Exp $ */
+/* $NetBSD: dnkbd.c,v 1.8 2017/03/25 01:48:31 tsutsui Exp $ */
/* $OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $ */
/*
@@ -263,6 +263,7 @@
static void dnkbd_rawrepeat(void *);
#endif
static int dnkbd_send(struct dnkbd_softc *, const uint8_t *, size_t);
+static void dnkbd_break(struct dnkbd_softc *, int);
int
dnkbd_match(device_t parent, cfdata_t cf, void *aux)
@@ -309,6 +310,12 @@
frodo_intr_establish(parent, dnkbd_intr, sc, fa->fa_line, IPL_VM);
+ /* send break to reset keyboard state */
+ dnkbd_break(sc, 1);
+ delay(10 * 1000); /* 10ms for 12 space bits */
+ dnkbd_break(sc, 0);
+ delay(10 * 1000);
+
/* probe for keyboard */
if (dnkbd_probe(sc) != 0) {
aprint_normal("no keyboard\n");
@@ -869,6 +876,24 @@
return 0;
}
+void
+dnkbd_break(struct dnkbd_softc *sc, int onoff)
+{
+ bus_space_tag_t bst;
+ bus_space_handle_t bsh;
+ uint8_t reg;
+
+ bst = sc->sc_bst;
+ bsh = sc->sc_bsh;
+
+ reg = bus_space_read_1(bst, bsh, com_lctl);
+ if (onoff)
+ reg |= LCR_SBREAK;
+ else
+ reg &= ~LCR_SBREAK;
+ bus_space_write_1(bst, bsh, com_lctl, reg);
+}
+
int
dnkbd_intr(void *v)
{
Home |
Main Index |
Thread Index |
Old Index