summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-02-19 05:35:20 +0000
committernjl <njl@FreeBSD.org>2004-02-19 05:35:20 +0000
commitf84686bc1d61697ffca893d0d997c458505e6ce8 (patch)
tree990f659d89e4e8ef217687fd34f7ca570eea9db7 /sys/dev
parenta3ce894968d0ca71e7f6c77fdec6454239b4d39d (diff)
downloadFreeBSD-src-f84686bc1d61697ffca893d0d997c458505e6ce8.zip
FreeBSD-src-f84686bc1d61697ffca893d0d997c458505e6ce8.tar.gz
Fix problem caused by previous commit where some users' buttons
stopped returning events. Don't disable the event when removing the handler because it still needs to be enabled for the other handler. Also, remove duplicate AcpiEnableEvent calls since the install function now does this for us.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi.c2
-rw-r--r--sys/dev/acpica/acpi_button.c11
2 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 0f81f2a..ea6e6b9 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1122,7 +1122,6 @@ acpi_enable_fixed_events(struct acpi_softc *sc)
/* Enable and clear fixed events and install handlers. */
if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) {
- AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, 0);
AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
AcpiInstallFixedEventHandler(ACPI_EVENT_POWER_BUTTON,
acpi_event_power_button_sleep, sc);
@@ -1130,7 +1129,6 @@ acpi_enable_fixed_events(struct acpi_softc *sc)
device_printf(sc->acpi_dev, "Power Button (fixed)\n");
}
if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) {
- AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, 0);
AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
AcpiInstallFixedEventHandler(ACPI_EVENT_SLEEP_BUTTON,
acpi_event_sleep_button_sleep, sc);
diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c
index 3bab1dd..2bfb570 100644
--- a/sys/dev/acpica/acpi_button.c
+++ b/sys/dev/acpica/acpi_button.c
@@ -132,7 +132,6 @@ acpi_button_attach(device_t dev)
/* Install the appropriate new handler. */
if (sc->fixed) {
- AcpiEnableEvent(event, 0);
AcpiClearEvent(event);
status = AcpiInstallFixedEventHandler(event,
acpi_button_fixed_handler, sc);
@@ -152,16 +151,10 @@ acpi_button_attach(device_t dev)
* 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) {
- AcpiDisableEvent(event, 0);
- AcpiClearEvent(event);
+ 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) {
- AcpiDisableEvent(event, 0);
- AcpiClearEvent(event);
+ if (event == ACPI_EVENT_SLEEP_BUTTON && AcpiGbl_FADT->SleepButton == 0)
AcpiRemoveFixedEventHandler(event, acpi_event_sleep_button_sleep);
- }
return_VALUE (0);
}
OpenPOWER on IntegriCloud