diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-02-22 18:13:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-02-22 18:13:29 +0000 |
commit | acab49cc438aa68a51229703911f0dc99d96fa78 (patch) | |
tree | 0f25662562c5a91567b3933b0a2f54c2e433f089 | |
parent | 1108a7f51c653115f12fe0fed51a8351b1aee4ca (diff) |
based on hinge buttons, do screen blanking. uwe and i agree that
later on we should look at debouncing the buttons, as the current code
may lead to rapid display on/off cycles, which might be hard on the
battery; uwe ok
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_kbd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_kbd.c b/sys/arch/zaurus/dev/zaurus_kbd.c index d7ec1d0c7be..d7087a80416 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.12 2005/01/30 21:55:50 drahn Exp $ */ +/* $OpenBSD: zaurus_kbd.c,v 1.13 2005/02/22 18:13:28 deraadt Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> * @@ -450,11 +450,18 @@ zkbd_hinge(void *v) struct zkbd_softc *sc = v; int a = pxa2x0_gpio_get_bit(sc->sc_swa_pin) ? 1 : 0; int b = pxa2x0_gpio_get_bit(sc->sc_swb_pin) ? 2 : 0; + extern int lcd_blank(int); #if 0 printf("hinge event A %d B %d\n", a, b); #endif sc->sc_hinge = a | b; + + if (sc->sc_hinge == 3) + lcd_blank(1); + else + lcd_blank(0); + return 1; } |