From 57ffc3ee00c70eed0ac54666964887d6112fd60b Mon Sep 17 00:00:00 2001 From: Gordon Willem Klok Date: Tue, 11 Apr 2006 02:35:36 +0000 Subject: Add acpi_resume(struct acpi_softc *sc), which calls some AML methods, detected at attach time, currently unused. ok marco@ --- sys/dev/acpi/acpi.c | 34 +++++++++++++++++++++++++++++++++- sys/dev/acpi/acpivar.h | 3 ++- 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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 * Copyright (c) 2005 Jordan Hargrave @@ -1108,6 +1108,38 @@ acpi_enter_sleep_state(struct acpi_softc *sc, int state) #endif } +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) { 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 * @@ -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 -- cgit v1.2.3