Module Name:    src
Committed By:   jakllsch
Date:           Fri Aug  5 18:27:48 UTC 2011

Modified Files:
        src/sys/dev/acpi: acpi.c

Log Message:
As we add a handler for the ACPI fixed feature button events,
ensure they aren't going to trigger as soon as we enable interrupts,
furthermore ensure that the event is unmasked.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/dev/acpi/acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.248 src/sys/dev/acpi/acpi.c:1.249
--- src/sys/dev/acpi/acpi.c:1.248	Mon Aug  1 11:25:59 2011
+++ src/sys/dev/acpi/acpi.c	Fri Aug  5 18:27:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.248 2011/08/01 11:25:59 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.249 2011/08/05 18:27:48 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.248 2011/08/01 11:25:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.249 2011/08/05 18:27:48 jakllsch Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -1185,11 +1185,25 @@
 	aprint_debug_dev(sc->sc_dev, "fixed %s button present\n",
 	    (type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep");
 
+	rv = AcpiClearEvent(event)
+	if (ACPI_FAILURE(rv)) {
+		aprint_error_dev(sc->sc_dev,
+		    "fixed event %d did not clear: %s\n",
+		    event, AcpiFormatException(rv));
+	}
+
+	rv = AcpiEnableEvent(event, 0))
+	if (ACPI_FAILURE(rv)) {
+		aprint_error_dev(sc->sc_dev,
+		    "fixed event %d did not enable: %s\n",
+		    event, AcpiFormatException(rv));
+	}
+
 	return;
 
 fail:
 	aprint_error_dev(sc->sc_dev, "failed to register "
-	    "fixed event: %s\n", AcpiFormatException(rv));
+	    "fixed event %d: %s\n", event, AcpiFormatException(rv));
 }
 
 static void

Reply via email to