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 use pmf_event_inject() instead of call l...
details: https://anonhg.NetBSD.org/src/rev/51274ac6f039
branches: trunk
changeset: 766399:51274ac6f039
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Jun 21 17:17:27 2011 +0000
description:
use pmf_event_inject() instead of call lcd_blank() directly.
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, 17 insertions(+), 27 deletions(-)
diffs (173 lines):
diff -r 57fb9041027c -r 51274ac6f039 sys/arch/zaurus/dev/zkbd.c
--- a/sys/arch/zaurus/dev/zkbd.c Tue Jun 21 15:28:05 2011 +0000
+++ b/sys/arch/zaurus/dev/zkbd.c Tue Jun 21 17:17:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zkbd.c,v 1.12 2011/06/19 16:20:09 nonaka Exp $ */
+/* $NetBSD: zkbd.c,v 1.13 2011/06/21 17:17:27 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.12 2011/06/19 16:20:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zkbd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $");
#include "opt_wsdisplay_compat.h"
#if 0 /* XXX */
@@ -44,7 +44,6 @@
#include <zaurus/zaurus/zaurus_var.h>
#include <zaurus/dev/zkbdmap.h>
-#include <zaurus/dev/zlcdvar.h>
static const int gpio_sense_pins_c3000[] = {
12,
@@ -299,11 +298,10 @@
{
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, c;
+ int npress = 0, ncbuf = 0;
char cbuf[MAXKEYS * 2];
#endif
@@ -374,7 +372,7 @@
(sc->sc_keystate[14] ? (1 << 2) : 0)); /* 'alt' */
for (i = 0; i < sc->sc_nsense * sc->sc_nstrobe; i++) {
- stuck = 0;
+ int stuck = 0;
/* extend xt_keymap to do this faster. */
/* ignore 'stuck' keys' */
for (j = 0; j < __arraycount(stuck_keys); j++) {
@@ -390,9 +388,9 @@
keysdown |= keystate; /* if any keys held */
#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (sc->sc_polling == 0 && sc->sc_rawkbd) {
- if ((keystate) || (sc->sc_okeystate[i] != keystate)) {
- c = sc->sc_xt_keymap[i];
+ if (!sc->sc_polling && sc->sc_rawkbd) {
+ if (keystate || sc->sc_okeystate[i] != keystate) {
+ int c = sc->sc_xt_keymap[i];
if (c & 0x80) {
cbuf[ncbuf++] = 0xe0;
}
@@ -412,7 +410,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;
@@ -428,7 +426,7 @@
}
#ifdef WSDISPLAY_COMPAT_RAWKBD
- if (sc->sc_polling == 0 && sc->sc_rawkbd) {
+ if (!sc->sc_polling && sc->sc_rawkbd) {
wskbd_rawinput(sc->sc_wskbddev, cbuf, ncbuf);
sc->sc_nrep = npress;
if (npress != 0)
@@ -513,9 +511,9 @@
if (lid_suspend)
apm_suspends++;
#endif
- lcd_blank(1);
+ pmf_event_inject(NULL, PMFE_DISPLAY_OFF);
} else {
- lcd_blank(0);
+ pmf_event_inject(NULL, PMFE_DISPLAY_ON);
}
return 1;
diff -r 57fb9041027c -r 51274ac6f039 sys/arch/zaurus/dev/zlcd.c
--- a/sys/arch/zaurus/dev/zlcd.c Tue Jun 21 15:28:05 2011 +0000
+++ b/sys/arch/zaurus/dev/zlcd.c Tue Jun 21 17:17:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zlcd.c,v 1.12 2011/06/19 16:20:09 nonaka Exp $ */
+/* $NetBSD: zlcd.c,v 1.13 2011/06/21 17:17:27 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.12 2011/06/19 16:20:09 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zlcd.c,v 1.13 2011/06/21 17:17:27 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,6 +169,7 @@
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)
@@ -266,14 +267,12 @@
{
lcd_blank(0);
- lcd_set_backlight(1);
}
static void
lcd_display_off(device_t dv)
{
- lcd_set_backlight(0);
lcd_blank(1);
}
@@ -501,7 +500,7 @@
else if (newval > maxval)
newval = maxval;
- if (lcd_get_backlight() && !lcdisblank)
+ if (lcdislit && !lcdisblank)
lcd_set_brightness_internal(newval);
if (newval > 0)
@@ -565,7 +564,7 @@
}
}
-void
+static void
lcd_blank(int blank)
{
diff -r 57fb9041027c -r 51274ac6f039 sys/arch/zaurus/dev/zlcdvar.h
--- a/sys/arch/zaurus/dev/zlcdvar.h Tue Jun 21 15:28:05 2011 +0000
+++ b/sys/arch/zaurus/dev/zlcdvar.h Tue Jun 21 17:17:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zlcdvar.h,v 1.1 2011/06/19 16:20:09 nonaka Exp $ */
+/* $NetBSD: zlcdvar.h,v 1.2 2011/06/21 17:17:27 nonaka Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,13 +32,6 @@
#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