Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/zaurus/dev backout previous.
details: https://anonhg.NetBSD.org/src/rev/ac39732a53bd
branches: trunk
changeset: 766402:ac39732a53bd
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Jun 21 18:13:19 2011 +0000
description:
backout previous.
diffstat:
sys/arch/zaurus/dev/zkbd.c | 24 +++++++++++++-----------
sys/arch/zaurus/dev/zlcd.c | 11 ++++++-----
sys/arch/zaurus/dev/zlcdvar.h | 9 ++++++++-
3 files changed, 27 insertions(+), 17 deletions(-)
diffs (173 lines):
diff -r 2b14d4097711 -r ac39732a53bd sys/arch/zaurus/dev/zkbd.c
--- a/sys/arch/zaurus/dev/zkbd.c Tue Jun 21 18:02:43 2011 +0000
+++ b/sys/arch/zaurus/dev/zkbd.c Tue Jun 21 18:13:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zkbd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $ */
+/* $NetBSD: zkbd.c,v 1.14 2011/06/21 18:13:19 nonaka Exp $ */
/* $OpenBSD: zaurus_kbd.c,v 1.28 2005/12/21 20:36:03 deraadt Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zkbd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zkbd.c,v 1.14 2011/06/21 18:13:19 nonaka Exp $");
#include "opt_wsdisplay_compat.h"
#if 0 /* XXX */
@@ -44,6 +44,7 @@
#include <zaurus/zaurus/zaurus_var.h>
#include <zaurus/dev/zkbdmap.h>
+#include <zaurus/dev/zlcdvar.h>
static const int gpio_sense_pins_c3000[] = {
12,
@@ -298,10 +299,11 @@
{
struct zkbd_softc *sc = (struct zkbd_softc *)v;
int i, j, col, pin, type, keysdown = 0;
+ int stuck;
int keystate;
int s;
#ifdef WSDISPLAY_COMPAT_RAWKBD
- int npress = 0, ncbuf = 0;
+ int npress = 0, ncbuf = 0, c;
char cbuf[MAXKEYS * 2];
#endif
@@ -372,7 +374,7 @@
(sc->sc_keystate[14] ? (1 << 2) : 0)); /* 'alt' */
for (i = 0; i < sc->sc_nsense * sc->sc_nstrobe; i++) {
- int stuck = 0;
+ stuck = 0;
/* extend xt_keymap to do this faster. */
/* ignore 'stuck' keys' */
for (j = 0; j < __arraycount(stuck_keys); j++) {
@@ -388,9 +390,9 @@
keysdown |= keystate; /* if any keys held */
#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (!sc->sc_polling && sc->sc_rawkbd) {
- if (keystate || sc->sc_okeystate[i] != keystate) {
- int c = sc->sc_xt_keymap[i];
+ if (sc->sc_polling == 0 && sc->sc_rawkbd) {
+ if ((keystate) || (sc->sc_okeystate[i] != keystate)) {
+ c = sc->sc_xt_keymap[i];
if (c & 0x80) {
cbuf[ncbuf++] = 0xe0;
}
@@ -410,7 +412,7 @@
}
#endif
- if (!sc->sc_rawkbd && (sc->sc_okeystate[i] != keystate)) {
+ if ((!sc->sc_rawkbd) && (sc->sc_okeystate[i] != keystate)) {
type = keystate ? WSCONS_EVENT_KEY_DOWN :
WSCONS_EVENT_KEY_UP;
@@ -426,7 +428,7 @@
}
#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (!sc->sc_polling && sc->sc_rawkbd) {
+ if (sc->sc_polling == 0 && sc->sc_rawkbd) {
wskbd_rawinput(sc->sc_wskbddev, cbuf, ncbuf);
sc->sc_nrep = npress;
if (npress != 0)
@@ -511,9 +513,9 @@
if (lid_suspend)
apm_suspends++;
#endif
- pmf_event_inject(NULL, PMFE_DISPLAY_OFF);
+ lcd_blank(1);
} else {
- pmf_event_inject(NULL, PMFE_DISPLAY_ON);
+ lcd_blank(0);
}
return 1;
diff -r 2b14d4097711 -r ac39732a53bd sys/arch/zaurus/dev/zlcd.c
--- a/sys/arch/zaurus/dev/zlcd.c Tue Jun 21 18:02:43 2011 +0000
+++ b/sys/arch/zaurus/dev/zlcd.c Tue Jun 21 18:13:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zlcd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $ */
+/* $NetBSD: zlcd.c,v 1.14 2011/06/21 18:13:19 nonaka Exp $ */
/* $OpenBSD: zaurus_lcd.c,v 1.20 2006/06/02 20:50:14 miod Exp $ */
/* NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp */
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zlcd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zlcd.c,v 1.14 2011/06/21 18:13:19 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,7 +169,6 @@
static void lcd_set_brightness_internal(int);
static int lcd_get_backlight(void);
static void lcd_set_backlight(int);
-static void lcd_blank(int);
static int
lcd_match(device_t parent, cfdata_t cf, void *aux)
@@ -267,12 +266,14 @@
{
lcd_blank(0);
+ lcd_set_backlight(1);
}
static void
lcd_display_off(device_t dv)
{
+ lcd_set_backlight(0);
lcd_blank(1);
}
@@ -500,7 +501,7 @@
else if (newval > maxval)
newval = maxval;
- if (lcdislit && !lcdisblank)
+ if (lcd_get_backlight() && !lcdisblank)
lcd_set_brightness_internal(newval);
if (newval > 0)
@@ -564,7 +565,7 @@
}
}
-static void
+void
lcd_blank(int blank)
{
diff -r 2b14d4097711 -r ac39732a53bd sys/arch/zaurus/dev/zlcdvar.h
--- a/sys/arch/zaurus/dev/zlcdvar.h Tue Jun 21 18:02:43 2011 +0000
+++ b/sys/arch/zaurus/dev/zlcdvar.h Tue Jun 21 18:13:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zlcdvar.h,v 1.2 2011/06/21 17:17:27 nonaka Exp $ */
+/* $NetBSD: zlcdvar.h,v 1.3 2011/06/21 18:13:19 nonaka Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,6 +32,13 @@
#ifndef _ZAURUS_DEV_ZLCDVAR_H_
#define _ZAURUS_DEV_ZLCDVAR_H_
+#include "lcd.h"
+
void lcd_cnattach(void);
+#if NLCD > 0
+void lcd_blank(int);
+#else
+#define lcd_blank(blank) do { } while (/*CONSTCOND*/0)
+#endif
#endif /* _ZAURUS_DEV_ZLCDVAR_H_ */
Home |
Main Index |
Thread Index |
Old Index