diff options
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_apm.c | 15 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_apm.c | 13 |
2 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c index 02d5df269c6..4ac3fe336c8 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ b/sys/arch/arm/xscale/pxa2x0_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.33 2010/08/29 02:02:25 deraadt Exp $ */ +/* $OpenBSD: pxa2x0_apm.c,v 1.34 2010/08/30 21:37:52 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -306,14 +306,14 @@ apm_power_info(struct pxa2x0_apm_softc *sc, void apm_suspend(struct pxa2x0_apm_softc *sc) { + int s; + #if NWSDISPLAY > 0 wsdisplay_suspend(); #endif /* NWSDISPLAY > 0 */ resettodr(); - dopowerhooks(PWR_SUSPEND); - if (cold) vfs_syncwait(0); @@ -322,14 +322,21 @@ apm_suspend(struct pxa2x0_apm_softc *sc) else sc->sc_suspend(sc); + s = splhigh(); + config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND); + splx(s); + pxa2x0_apm_sleep(sc); } void apm_resume(struct pxa2x0_apm_softc *sc) { + int s; - dopowerhooks(PWR_RESUME); + s = splhigh(); + config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); + splx(s); inittodr(0); diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c index af4dd49511a..9cd9578ecb9 100644 --- a/sys/arch/zaurus/dev/zaurus_apm.c +++ b/sys/arch/zaurus/dev/zaurus_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_apm.c,v 1.17 2010/08/29 02:02:26 deraadt Exp $ */ +/* $OpenBSD: zaurus_apm.c,v 1.18 2010/08/30 21:37:53 deraadt Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> @@ -641,6 +641,7 @@ void zapm_poweroff(void) { struct pxa2x0_apm_softc *sc; + int s; KASSERT(apm_cd.cd_ndevs > 0 && apm_cd.cd_devs[0] != NULL); sc = apm_cd.cd_devs[0]; @@ -649,7 +650,8 @@ zapm_poweroff(void) wsdisplay_suspend(); #endif /* NWSDISPLAY > 0 */ - dopowerhooks(PWR_SUSPEND); + s = splhigh(); + config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND); /* XXX enable charging during suspend */ @@ -665,14 +667,15 @@ zapm_poweroff(void) do { pxa2x0_apm_sleep(sc); - } - while (!zapm_resume(sc)); + } while (!zapm_resume(sc)); zapm_restart(); /* NOTREACHED */ - dopowerhooks(PWR_RESUME); + config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); + splx(s); + bufq_restart(); #if NWSDISPLAY > 0 wsdisplay_resume(); #endif /* NWSDISPLAY > 0 */ |