From 84e7bd5bf900eda95ba93e398b8d856681a1bd83 Mon Sep 17 00:00:00 2001 From: njl Date: Thu, 19 Feb 2004 18:16:34 +0000 Subject: Do not remove the fixed handlers. Several systems (e.g., ASUS) only return events on the fixed handler even after defining a duplicate in the AML. While this violates the spec, hopefully we can get by with leaving both installed. --- sys/dev/acpica/acpi_button.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c index 2bfb570..9d95ba1 100644 --- a/sys/dev/acpica/acpi_button.c +++ b/sys/dev/acpica/acpi_button.c @@ -130,7 +130,11 @@ acpi_button_attach(device_t dev) event = (sc->button_type == ACPI_SLEEP_BUTTON) ? ACPI_EVENT_SLEEP_BUTTON : ACPI_EVENT_POWER_BUTTON; - /* Install the appropriate new handler. */ + /* + * Install the new handler. We could remove any fixed handlers added + * from the FADT once we have a duplicate from the AML but some systems + * only return events on one or the other so we have to keep both. + */ if (sc->fixed) { AcpiClearEvent(event); status = AcpiInstallFixedEventHandler(event, @@ -146,16 +150,6 @@ acpi_button_attach(device_t dev) } acpi_device_enable_wake_capability(sc->button_handle, 1); - /* - * If we have fixed buttons defined in the FADT, remove them now that - * we have found one in the AML. Some systems define buttons both ways - * but only deliver events to the AML object. - */ - if (event == ACPI_EVENT_POWER_BUTTON && AcpiGbl_FADT->PwrButton == 0) - AcpiRemoveFixedEventHandler(event, acpi_event_power_button_sleep); - if (event == ACPI_EVENT_SLEEP_BUTTON && AcpiGbl_FADT->SleepButton == 0) - AcpiRemoveFixedEventHandler(event, acpi_event_sleep_button_sleep); - return_VALUE (0); } -- cgit v1.1