summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2007-03-29 18:42:39 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2007-03-29 18:42:39 +0000
commitbaa31b7505103721e06149694e3a0a0a6b726a75 (patch)
tree1e8e36dc507c5aee0c34c04ed2a52c394b9bf9f0 /sys/arch/arm
parent39db385c566253b8b3e3fc4bf00808441f47b61c (diff)
Add power hook to scoop(4), replacing the Zaurus-specific scoop_* calls in
pxa2x0_apm.c. Set a flag to indicate that scoop is currently suspended. Test this flag in scoop_timeout() (and maybe later in other places) to avoid manipulating scoop registers while the driver is suspended. The scoop_checkdisk timeout is intentionally not stopped, as it should be safe to have timeouts running accross suspend/resume. Put splhigh() in scoop_gpio_pin_write() to make changing the pin level an atomic operation. Result of prodding and diffs from Robert and Theo.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c
index e8bb228480a..d38b571634e 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.27 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: pxa2x0_apm.c,v 1.28 2007/03/29 18:42:38 uwe Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -235,11 +235,6 @@ void pxa27x_cpu_speed_low(void);
void pxa27x_cpu_speed_91(void);
void pxa27x_cpu_speed_208(void);
-/* XXX */
-void scoop_check_mcr(void);
-void scoop_suspend(void);
-void scoop_resume(void);
-
void
apm_power_print(struct pxa2x0_apm_softc *sc, struct apm_power_info *powerp)
{
@@ -905,8 +900,6 @@ suspend_again:
bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PKSR,
0xffffffff);
- scoop_check_mcr();
-
/* XXX control battery charging in sleep mode. */
/* XXX schedule RTC alarm to check the battery, or schedule
@@ -924,9 +917,6 @@ suspend_again:
#endif
pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, PI2C_VOLTAGE_LOW);
- scoop_check_mcr();
- scoop_suspend();
-
sd.sd_gpdr0 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR0);
sd.sd_gpdr1 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR1);
sd.sd_gpdr2 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR2);
@@ -1124,9 +1114,6 @@ suspend_again:
if ((read_icu(INTCTL_ICIP) & 0x1) != 0)
bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PEDR, 0x1);
- scoop_check_mcr();
- scoop_resume();
-
bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR0, sd.sd_osmr0);
bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR1, sd.sd_osmr1);
bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR2, sd.sd_osmr2);