diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-05-25 07:29:18 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-05-25 07:29:18 +0000 |
commit | 83c0e6d71dc3753f1eba9513c6f3ffae7fcf3f25 (patch) | |
tree | 0977c6b4391256378b9f072d3f5bf9053a31b8b8 /sys/arch | |
parent | 0ee6282a605d6ef806a1a095075e0f66fa53e5c4 (diff) |
Resample the hinge value on wakeup, prevent 'hung' keyboard on return
from suspend.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_kbd.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_kbd.c b/sys/arch/zaurus/dev/zaurus_kbd.c index 916771d0bc7..9b83459b19f 100644 --- a/sys/arch/zaurus/dev/zaurus_kbd.c +++ b/sys/arch/zaurus/dev/zaurus_kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_kbd.c,v 1.22 2005/05/24 20:32:43 uwe Exp $ */ +/* $OpenBSD: zaurus_kbd.c,v 1.23 2005/05/25 07:29:17 drahn Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> * @@ -109,6 +109,7 @@ struct zkbd_softc { char sc_rep[MAXKEYS]; int sc_nrep; #endif + void *sc_powerhook; }; struct zkbd_softc *zkbd_dev; /* XXX */ @@ -121,6 +122,7 @@ void zkbd_poll(void *v); int zkbd_on(void *v); int zkbd_sync(void *v); int zkbd_hinge(void *v); +void zkbd_power(int why, void *arg); int zkbd_modstate; @@ -180,6 +182,12 @@ zkbd_attach(struct device *parent, struct device *self, void *aux) #endif /* Determine which system we are - XXX */ + sc->sc_powerhook = powerhook_establish(zkbd_power, sc); + if (sc->sc_powerhook == NULL) { + printf(": unable to establish powerhook\n"); + return; + } + if (1 /* C3000 */) { sc->sc_sense_array = gpio_sense_pins_c3000; sc->sc_strobe_array = gpio_strobe_pins_c3000; @@ -573,3 +581,14 @@ void zkbd_cnpollc(void *v, int on) { } + +void +zkbd_power(int why, void *arg) +{ + struct zkbd_softc *sc = arg; + int a = pxa2x0_gpio_get_bit(sc->sc_swa_pin) ? 1 : 0; + int b = pxa2x0_gpio_get_bit(sc->sc_swb_pin) ? 2 : 0; + + /* probably should check why */ + sc->sc_hinge = a | b; +} |