diff options
author | njl <njl@FreeBSD.org> | 2004-05-25 02:47:35 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-05-25 02:47:35 +0000 |
commit | 70e389d6cfb11f189060d16fde82012e8c1d8aeb (patch) | |
tree | 25ff73bb09231d547c140b54615b5edf5ba0f276 /sys/dev/acpica/acpi_button.c | |
parent | a714b78fea0d6c73e38a47e7db9e0b44c9814856 (diff) | |
download | FreeBSD-src-70e389d6cfb11f189060d16fde82012e8c1d8aeb.zip FreeBSD-src-70e389d6cfb11f189060d16fde82012e8c1d8aeb.tar.gz |
Changes to implement 20040514:
* Add calls to AcpiSetGpeType. We use wake/run as the type for lid and
button switches since wake-only causes Thinkpads to immediately wake on
the second suspend. Note that with wake/run, some systems return both
wake and device-specific notifies so we don't register for system notifies
for lid and button switches.
* Remove the hw.acpi.osi_method tunable since it is not needed.
* Always print unknown notifies for all types.
* Add more cleanup for the EC if it fails to attach.
* Use the GPE handle now that we parse it. This allows GPEs to be defined
in AML GPE blocks.
* Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread
which processes queued requests.
Diffstat (limited to 'sys/dev/acpica/acpi_button.c')
-rw-r--r-- | sys/dev/acpica/acpi_button.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c index 8071102..121ebec 100644 --- a/sys/dev/acpica/acpi_button.c +++ b/sys/dev/acpica/acpi_button.c @@ -141,6 +141,11 @@ acpi_button_attach(device_t dev) status = AcpiInstallFixedEventHandler(event, acpi_button_fixed_handler, sc); } else { + /* + * If a system does not get lid events, it may make sense to change + * the type to ACPI_ALL_NOTIFY. Some systems generate both a wake + * and runtime notify in that case though. + */ status = AcpiInstallNotifyHandler(sc->button_handle, ACPI_DEVICE_NOTIFY, acpi_button_notify_handler, sc); } @@ -231,10 +236,11 @@ acpi_button_notify_wakeup(void *arg) static void acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) { - struct acpi_button_softc *sc = (struct acpi_button_softc *)context; + struct acpi_button_softc *sc; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify); + sc = (struct acpi_button_softc *)context; switch (notify) { case ACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP: AcpiOsQueueForExecution(OSD_PRIORITY_LO, @@ -245,7 +251,8 @@ acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) acpi_button_notify_wakeup, sc); break; default: - break; /* unknown notification value */ + device_printf(sc->button_dev, "unknown notify %#x\n", notify); + break; } } |