summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-08-09 21:29:27 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-08-09 21:29:27 +0000
commite88597ec793bf18fbf965f9d00f8ff9675332a24 (patch)
treea9cdc9540f8400b2f9ab4348ead48ac9cd327130
parent9012e538eba085655fb59ca830fb7124f79337dc (diff)
- Don't depend on the APM_CRIT_RESUME event to run PWR_RESUME power hooks
after a APM_CRIT_SUSPEND_REQ event. This fixes non-working devices after resume from battery low suspend. - Don't suspend automatically on APM_BATT_LOW because that's what could be too early (and we now understand APM_CRIT_SUSPEND_REQ).
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c
index ced5b04deb2..df360619021 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.13 2005/04/13 05:40:07 uwe Exp $ */
+/* $OpenBSD: pxa2x0_apm.c,v 1.14 2005/08/09 21:29:26 uwe Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -353,8 +353,12 @@ apm_handle_event(struct pxa2x0_apm_softc *sc, u_int type)
break;
case APM_CRIT_SUSPEND_REQ:
DPRINTF(("suspend required immediately\n"));
- apm_record_event(sc, type);
- apm_suspend(sc);
+ (void)apm_record_event(sc, type);
+ /*
+ * We ignore APM_CRIT_RESUME and just suspend here as usual
+ * to simplify the actual apm_get_event() implementation.
+ */
+ apm_suspends++;
break;
case APM_USER_SUSPEND_REQ:
case APM_SUSPEND_REQ:
@@ -418,7 +422,7 @@ apm_thread(void *v)
if (apm_handle_event(sc, type) != 0)
break;
}
- if (apm_battlow || apm_suspends || apm_userstandbys) {
+ if (apm_suspends || apm_userstandbys /* || apm_battlow*/) {
apm_suspend(sc);
apm_resume(sc);
}