summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-03-20 21:37:52 +0000
committerjkim <jkim@FreeBSD.org>2012-03-20 21:37:52 +0000
commit9807567995352b475fd7e23ea58b7512a20e7bd3 (patch)
tree2a460dab9bb8e6fffc77dcd3749cddbe16ec0ab6 /sys/dev
parent107d21a0f4a0fa5f29290cca23e94c24fe945998 (diff)
parentf65c4f80d1c60e597f67836e51986ebf3cd669f7 (diff)
downloadFreeBSD-src-9807567995352b475fd7e23ea58b7512a20e7bd3.zip
FreeBSD-src-9807567995352b475fd7e23ea58b7512a20e7bd3.tar.gz
Merge ACPICA 20120320.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi.c14
-rw-r--r--sys/dev/acpica/acpivar.h5
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index fc5fec1..bec341c 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -97,6 +97,9 @@ struct mtx acpi_mutex;
/* Bitmap of device quirks. */
int acpi_quirks;
+/* Optional ACPI methods for suspend and resume, e.g., _GTS and _BFS. */
+int acpi_sleep_flags;
+
/* Supported sleep states. */
static BOOLEAN acpi_sleep_states[ACPI_S_STATE_COUNT];
@@ -289,6 +292,11 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
/* Allow users to override quirks. */
TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
+/* Execute optional ACPI methods for suspend and resume. */
+TUNABLE_INT("debug.acpi.sleep_flags", &acpi_sleep_flags);
+SYSCTL_INT(_debug_acpi, OID_AUTO, sleep_flags, CTLFLAG_RW | CTLFLAG_TUN,
+ &acpi_sleep_flags, 0, "Execute optional ACPI methods for suspend/resume.");
+
static int acpi_susp_bounce;
SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW,
&acpi_susp_bounce, 0, "Don't actually suspend, just test devices.");
@@ -1976,7 +1984,7 @@ acpi_shutdown_final(void *arg, int howto)
}
device_printf(sc->acpi_dev, "Powering system off\n");
ACPI_DISABLE_IRQS();
- status = AcpiEnterSleepState(ACPI_STATE_S5);
+ status = AcpiEnterSleepState(ACPI_STATE_S5, acpi_sleep_flags);
if (ACPI_FAILURE(status))
device_printf(sc->acpi_dev, "power-off failed - %s\n",
AcpiFormatException(status));
@@ -2723,7 +2731,7 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
AcpiEnable();
} else {
ACPI_DISABLE_IRQS();
- status = AcpiEnterSleepState(state);
+ status = AcpiEnterSleepState(state, acpi_sleep_flags);
if (ACPI_FAILURE(status)) {
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n",
AcpiFormatException(status));
@@ -2742,7 +2750,7 @@ backout:
sc->acpi_sstate = ACPI_STATE_S0;
}
if (slp_state >= ACPI_SS_SLP_PREP) {
- AcpiLeaveSleepStatePrep(state);
+ AcpiLeaveSleepStatePrep(state, acpi_sleep_flags);
AcpiLeaveSleepState(state);
}
if (slp_state >= ACPI_SS_DEV_SUSPEND)
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index c05859b..5791ca5 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -217,6 +217,11 @@ extern int acpi_quirks;
#define ACPI_Q_MADT_IRQ0 (1 << 2)
/*
+ * Sleep flags. See actypes.h for available flags.
+ */
+extern int acpi_sleep_flags;
+
+/*
* Note that the low ivar values are reserved to provide
* interface compatibility with ISA drivers which can also
* attach to ACPI.
OpenPOWER on IntegriCloud