diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-04-11 02:35:36 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-04-11 02:35:36 +0000 |
commit | 57ffc3ee00c70eed0ac54666964887d6112fd60b (patch) | |
tree | d79e3313d18eb97c46181f704071786431cf08d7 /sys/dev | |
parent | 7a1e6e2ecdeadbb20c6dda6a5840cf5822200190 (diff) |
Add acpi_resume(struct acpi_softc *sc), which calls some AML methods,
detected at attach time, currently unused.
ok marco@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpi.c | 34 | ||||
-rw-r--r-- | sys/dev/acpi/acpivar.h | 3 |
2 files changed, 35 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 4276662b654..b1d8678666b 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.46 2006/04/11 02:28:10 gwk Exp $ */ +/* $OpenBSD: acpi.c,v 1.47 2006/04/11 02:35:35 gwk Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1109,6 +1109,38 @@ acpi_enter_sleep_state(struct acpi_softc *sc, int state) } void +acpi_resume(struct acpi_softc *sc) +{ + struct aml_value res, env; + + env.type = AML_OBJTYPE_INTEGER; + env.v_integer = sc->sc_state; + + if (sc->sc_bfs) { + if (aml_eval_object(sc, sc->sc_pts, &res, 1, &env)) { + dnprintf(10, "%s evaluating method _BFS failed.\n", + DEVNAME(sc)); + } + } + dopowerhooks(PWR_RESUME); + inittodr(0); + if (sc->sc_wak) { + if (aml_eval_object(sc, sc->sc_wak, &res, 1, &env)) { + dnprintf(10, "%s evaluating method _WAK failed.\n", + DEVNAME(sc)); + } + } + sc->sc_state = ACPI_STATE_S0; + if (sc->sc_tts) { + env.v_integer = sc->sc_state; + if (aml_eval_object(sc, sc->sc_wak, &res, 1, &env)) { + dnprintf(10, "%s evaluating method _TTS failed.\n", + DEVNAME(sc)); + } + } +} + +void acpi_powerdown(void) { acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5); diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index 53c4c1ed244..ad6b6ce48f6 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.21 2006/04/11 02:28:10 gwk Exp $ */ +/* $OpenBSD: acpivar.h,v 1.22 2006/04/11 02:35:35 gwk Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -189,6 +189,7 @@ void acpi_attach_machdep(struct acpi_softc *); int acpi_interrupt(void *); void acpi_enter_sleep_state(struct acpi_softc *, int); void acpi_powerdown(void); +void acpi_resume(struct acpi_softc *); #define ACPI_IOREAD 0 #define ACPI_IOWRITE 1 |