diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 21:37:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 21:37:54 +0000 |
commit | cee99a5b83912f30e320d32732a97248b3b9395b (patch) | |
tree | 3975f543a34f060d102d7405549673e705a73371 /sys/arch/zaurus | |
parent | b0fc800de7e8d3eaae874bc61f1b5cb7abcdf6c6 (diff) |
Hurray! Zaurus apm can now call the activate functions intead of powerhooks.
We call the activate functions at splhigh; unfortunately we cannot suspend a
zaurus at splhigh because on resume the clock is hosed. We accept this bug
for now... perhaps someone can find it?
(The powerhooks remain in place in the drivers, and will be roto-tilled once
we all the other powerhook-using architectures have switched over)
testing by myself and jakemsr; proof reading by oga
Diffstat (limited to 'sys/arch/zaurus')
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_apm.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 */ |