diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-05-27 18:38:45 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-05-27 18:38:45 +0000 |
commit | e8b4d56eb58827184db0b780acf7962892503dd5 (patch) | |
tree | 1817b677583b861f1119c6cedba1d7db92c18e9a /sys/dev/acpica/acpi_button.c | |
parent | d49b8d3917334c842b0ac5611850f7d79b27676e (diff) | |
download | src-e8b4d56eb58827184db0b780acf7962892503dd5.tar.gz src-e8b4d56eb58827184db0b780acf7962892503dd5.zip |
Restructure the wake GPE API. Now there are three functions:
acpi_wake_init:
Evaluate _PRW and set the GPE type
acpi_wake_set_enable:
Enable or disable a device's GPE.
acpi_wake_sleep_prep:
Perform any last-minute changes to the device to prepare it for
entering the given sleep state.
Also, walk the entire namespace when transitioning to a sleep state,
disabling any GPEs which aren't appropriate for the given state. Transition
acpi_lid and acpi_button to the new API.
This clears the way for non-ACPI-aware devices to wake the system (i.e.
modems) and fixes a problem where systems power up after shutdown when a
GPE is triggered.
Notes
Notes:
svn path=/head/; revision=129783
Diffstat (limited to 'sys/dev/acpica/acpi_button.c')
-rw-r--r-- | sys/dev/acpica/acpi_button.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c index 004a54ed35d7..b96c5feb0dd3 100644 --- a/sys/dev/acpica/acpi_button.c +++ b/sys/dev/acpica/acpi_button.c @@ -154,20 +154,21 @@ acpi_button_attach(device_t dev) AcpiFormatException(status)); return_VALUE (ENXIO); } - acpi_device_enable_wake_capability(sc->button_handle, 1); - acpi_device_enable_wake_event(sc->button_handle); + /* Enable the GPE for wake/runtime. */ + acpi_wake_init(dev, ACPI_GPE_TYPE_WAKE_RUN); + acpi_wake_set_enable(dev, 1); + return_VALUE (0); } static int acpi_button_suspend(device_t dev) { -#if 0 - struct acpi_button_softc *sc; + struct acpi_softc *acpi_sc; - sc = device_get_softc(dev); -#endif + acpi_sc = acpi_device_get_parent_softc(dev); + acpi_wake_sleep_prep(dev, acpi_sc->acpi_sstate); return (0); } |