summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2009-11-26 23:44:39 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2009-11-26 23:44:39 +0000
commitff500d53e0a8255f083e6114a7be1b80083069d7 (patch)
tree35d6eb08fa54fa16e1dae142fd3ee3b404add340 /sys/dev/acpi
parent88462ef42deba06babae67a1c50b91f60063a010 (diff)
Visual (and on some machines, audio) feedback while the machine is
resuming via calls to aml _SST method. This also makes the "moon" LED on thinkpads to blink during resume and cease when resume is completed. ok pirofti@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpi.c25
-rw-r--r--sys/dev/acpi/acpivar.h9
2 files changed, 28 insertions, 6 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 23538e1187a..add53a52080 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.151 2009/11/26 13:20:39 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.152 2009/11/26 23:44:38 mlarkin Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -1779,7 +1779,7 @@ acpi_init_pm(struct acpi_softc *sc)
sc->sc_wak = aml_searchname(&aml_root, "_WAK");
sc->sc_bfs = aml_searchname(&aml_root, "_BFS");
sc->sc_gts = aml_searchname(&aml_root, "_GTS");
- sc->sc_sst = aml_searchname(&aml_root, "_SST");
+ sc->sc_sst = aml_searchname(&aml_root, "_SI_._SST");
}
#ifndef SMALL_KERNEL
@@ -1927,6 +1927,12 @@ acpi_resume(struct acpi_softc *sc, int state)
DEVNAME(sc));
}
+ /* Reset the indicator lights to "waking" */
+ if (sc->sc_sst) {
+ env.v_integer = ACPI_SST_WAKING;
+ aml_evalnode(sc, sc->sc_sst, 1, &env, NULL);
+ }
+
/* Disable wake GPEs */
acpi_susp_resume_gpewalk(sc, state, 0);
@@ -1944,6 +1950,12 @@ acpi_resume(struct acpi_softc *sc, int state)
DEVNAME(sc));
}
}
+
+ /* Reset the indicator lights to "working" */
+ if (sc->sc_sst) {
+ env.v_integer = ACPI_SST_WORKING;
+ aml_evalnode(sc, sc->sc_sst, 1, &env, NULL);
+ }
}
#endif /* ! SMALL_KERNEL */
@@ -1969,6 +1981,12 @@ acpi_handle_suspend_failure(struct acpi_softc *sc)
DEVNAME(sc));
}
}
+
+ /* Reset the indicator lights to "working" */
+ if (sc->sc_sst) {
+ env.v_integer = ACPI_SST_WORKING;
+ aml_evalnode(sc, sc->sc_sst, 1, &env, NULL);
+ }
}
int
@@ -2025,9 +2043,6 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state)
return (ENXIO);
}
- if (sc->sc_sst)
- aml_evalnode(sc, sc->sc_sst, 1, &env, NULL);
-
/* Enable wake GPEs */
acpi_susp_resume_gpewalk(sc, state, 1);
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 83fe5991adc..7d44290b6a0 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.54 2009/11/23 16:21:54 pirofti Exp $ */
+/* $OpenBSD: acpivar.h,v 1.55 2009/11/26 23:44:38 mlarkin Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -115,6 +115,13 @@ typedef SIMPLEQ_HEAD(, acpi_wakeq) acpi_wakeqhead_t;
#define ACPIREG_GPE_STS 0x11
#define ACPIREG_GPE_EN 0x12
+/* System status (_SST) codes */
+#define ACPI_SST_INDICATOR_OFF 0
+#define ACPI_SST_WORKING 1
+#define ACPI_SST_WAKING 2
+#define ACPI_SST_SLEEPING 3
+#define ACPI_SST_SLEEP_CONTEXT 4
+
struct acpi_parsestate {
u_int8_t *start;
u_int8_t *end;