Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pckbc only power down on suspend, not standby (suges...
details: https://anonhg.NetBSD.org/src/rev/a3c71e210efb
branches: trunk
changeset: 533827:a3c71e210efb
user: chuck <chuck%NetBSD.org@localhost>
date: Wed Jul 10 02:05:25 2002 +0000
description:
only power down on suspend, not standby (sugested by thorpej).
fixes problem noted at bottom of PR#17537.
diffstat:
sys/dev/pckbc/pms.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diffs (58 lines):
diff -r fcc51812a2cc -r a3c71e210efb sys/dev/pckbc/pms.c
--- a/sys/dev/pckbc/pms.c Wed Jul 10 01:55:43 2002 +0000
+++ b/sys/dev/pckbc/pms.c Wed Jul 10 02:05:25 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pms.c,v 1.7 2002/07/08 07:43:31 martin Exp $ */
+/* $NetBSD: pms.c,v 1.8 2002/07/10 02:05:25 chuck Exp $ */
/*-
* Copyright (c) 1994 Charles M. Hannum.
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.7 2002/07/08 07:43:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pms.c,v 1.8 2002/07/10 02:05:25 chuck Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -75,6 +75,7 @@
int sc_enabled; /* input enabled? */
#ifndef PMS_DISABLE_POWERHOOK
void *sc_powerhook; /* cookie from power hook */
+ int sc_suspended; /* suspended? */
#endif /* !PMS_DISABLE_POWERHOOK */
int inputstate; /* number of bytes received for this packet */
u_int buttons; /* mouse button status */
@@ -245,6 +246,7 @@
#ifndef PMS_DISABLE_POWERHOOK
sc->sc_powerhook = powerhook_establish(pms_power, sc);
+ sc->sc_suspended = 0;
#endif /* !PMS_DISABLE_POWERHOOK */
}
@@ -353,15 +355,19 @@
struct pms_softc *sc = v;
switch (why) {
+ case PWR_STANDBY:
+ break;
case PWR_SUSPEND:
- case PWR_STANDBY:
- if (sc->sc_enabled)
+ if (sc->sc_enabled) {
do_disable(sc);
+ sc->sc_suspended = 1;
+ }
break;
case PWR_RESUME:
- if (sc->sc_enabled) {
+ if (sc->sc_enabled && sc->sc_suspended) {
sc->protocol = PMS_UNKNOWN; /* recheck protocol & init mouse */
- do_enable(sc);
+ sc->sc_suspended = 0;
+ do_enable(sc); /* only if we were suspended */
}
case PWR_SOFTSUSPEND:
case PWR_SOFTSTANDBY:
Home |
Main Index |
Thread Index |
Old Index