diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-11 16:44:52 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-11 16:44:52 +0000 |
commit | 2f7c83ece2fc2aa97beb6917f7f68ef1300b129c (patch) | |
tree | 6c56290ba1fe10208f2a5dee6b0bef42390e97ed | |
parent | 00b7f38eb00ccedca808a52fa3c2983a6cfa9c68 (diff) |
Enable or disable keyclick on attach, based upon the PROM keyboard-click?
property.
Tested with type 3 and type 4 keyboards.
-rw-r--r-- | sys/arch/sparc/dev/z8530kbd.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/comkbd_ebus.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/z8530kbd.c | 8 | ||||
-rw-r--r-- | sys/dev/sun/sunkbd.c | 16 | ||||
-rw-r--r-- | sys/dev/sun/sunkbdvar.h | 3 |
5 files changed, 31 insertions, 8 deletions
diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c index 8fae7e15eaf..e3406ba96c5 100644 --- a/sys/arch/sparc/dev/z8530kbd.c +++ b/sys/arch/sparc/dev/z8530kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530kbd.c,v 1.7 2005/05/14 15:25:17 miod Exp $ */ +/* $OpenBSD: z8530kbd.c,v 1.8 2005/11/11 16:44:48 miod Exp $ */ /* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -386,9 +386,6 @@ zskbd_attach(parent, self, aux) return; } - /* - * XXX should provide a method to change keyclick setting - */ ss->sc_click = 0; #if defined(SUN4C) || defined(SUN4M) if (!CPU_ISSUN4) { @@ -398,6 +395,7 @@ zskbd_attach(parent, self, aux) ss->sc_click = 1; } #endif + sunkbd_setclick(ss, ss->sc_click); a.console = console; if (ISTYPE5(ss->sc_layout)) { diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c index 277ede26ab0..bde4a3d4295 100644 --- a/sys/arch/sparc64/dev/comkbd_ebus.c +++ b/sys/arch/sparc64/dev/comkbd_ebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comkbd_ebus.c,v 1.17 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: comkbd_ebus.c,v 1.18 2005/11/11 16:44:51 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -219,6 +219,10 @@ comkbd_attach(parent, self, aux) return; } + ss->sc_click = + strcmp(getpropstring(optionsnode, "keyboard-click?"), "true") == 0; + sunkbd_setclick(ss, ss->sc_click); + a.console = console; if (ISTYPE5(ss->sc_layout)) { a.keymap = &sunkbd5_keymapdata; diff --git a/sys/arch/sparc64/dev/z8530kbd.c b/sys/arch/sparc64/dev/z8530kbd.c index 3f28d1b0cd5..f2e9cf8c9ce 100644 --- a/sys/arch/sparc64/dev/z8530kbd.c +++ b/sys/arch/sparc64/dev/z8530kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530kbd.c,v 1.17 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: z8530kbd.c,v 1.18 2005/11/11 16:44:51 miod Exp $ */ /* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -108,6 +108,8 @@ #include <sys/kernel.h> #include <sys/syslog.h> +#include <machine/autoconf.h> + #include <dev/wscons/wsconsio.h> #include <dev/wscons/wskbdvar.h> @@ -383,6 +385,10 @@ zskbd_attach(parent, self, aux) return; } + ss->sc_click = + strcmp(getpropstring(optionsnode, "keyboard-click?"), "true") == 0; + sunkbd_setclick(ss, ss->sc_click); + a.console = console; if (ISTYPE5(ss->sc_layout)) { a.keymap = &sunkbd5_keymapdata; diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c index 2c750f061ed..572db74e998 100644 --- a/sys/dev/sun/sunkbd.c +++ b/sys/dev/sun/sunkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbd.c,v 1.20 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: sunkbd.c,v 1.21 2005/11/11 16:44:51 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -213,6 +213,20 @@ sunkbd_raw(struct sunkbd_softc *sc, u_int8_t c) } } +int +sunkbd_setclick(struct sunkbd_softc *sc, int click) +{ + u_int8_t c; + + /* Type 2 keyboards do not support keyclick */ + if (sc->sc_id == KB_SUN2) + return (ENXIO); + + c = click ? SKBD_CMD_CLICKON : SKBD_CMD_CLICKOFF; + (*sc->sc_sendcmd)(sc, &c, 1); + return (0); +} + void sunkbd_setleds(void *v, int wled) { diff --git a/sys/dev/sun/sunkbdvar.h b/sys/dev/sun/sunkbdvar.h index 8349fdf6598..e904f7a1707 100644 --- a/sys/dev/sun/sunkbdvar.h +++ b/sys/dev/sun/sunkbdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sunkbdvar.h,v 1.9 2005/05/14 15:25:20 miod Exp $ */ +/* $OpenBSD: sunkbdvar.h,v 1.10 2005/11/11 16:44:51 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -53,6 +53,7 @@ extern struct wskbd_accessops sunkbd_accessops; void sunkbd_bellstop(void *); void sunkbd_decode(u_int8_t, u_int *, int *); void sunkbd_raw(struct sunkbd_softc *, u_int8_t); +int sunkbd_setclick(struct sunkbd_softc *, int); extern const struct wscons_keydesc sunkbd_keydesctab[]; extern struct wskbd_mapdata sunkbd_keymapdata; |