diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-08-25 06:13:53 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-08-25 06:13:53 +0000 |
commit | ba9cd7416732439e82cc6ccb71d1e7f1cf35b1c8 (patch) | |
tree | 1b9cb5826f189eec94bff7c3e1d39d44e9433cde /sys/dev | |
parent | abd6ef614697a337ee8fb816784aac80409d0f50 (diff) | |
download | FreeBSD-src-ba9cd7416732439e82cc6ccb71d1e7f1cf35b1c8.zip FreeBSD-src-ba9cd7416732439e82cc6ccb71d1e7f1cf35b1c8.tar.gz |
Add new sysctl MIB (hw.acpi.sleep_delay) to specify the delay (in
seconds) before ACPI sleep. Some machines might need this to sleep
by Hot-key.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpica/acpi.c | 8 | ||||
-rw-r--r-- | sys/dev/acpica/acpivar.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0b0e157..d8657d8 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -417,11 +417,15 @@ acpi_attach(device_t dev) OID_AUTO, "suspend_state", CTLTYPE_STRING | CTLFLAG_RW, &sc->acpi_suspend_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "sleep_delay", CTLFLAG_RD | CTLFLAG_RW, + &sc->acpi_sleep_delay, 0, "sleep delay"); + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "s4bios", CTLFLAG_RD | CTLFLAG_RW, &sc->acpi_s4bios, 0, "S4BIOS mode"); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "verbose", CTLFLAG_RD | CTLFLAG_RW, &sc->acpi_verbose, 0, "verbose mode"); + sc->acpi_sleep_delay = 1; sc->acpi_s4bios = 1; if (bootverbose) sc->acpi_verbose = 1; @@ -1357,6 +1361,10 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) break; } + if (sc->acpi_sleep_delay > 0) { + DELAY(sc->acpi_sleep_delay * 1000000); + } + if (state != ACPI_STATE_S1) { acpi_sleep_machdep(sc, state); diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 88c462e..ae94b05 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -59,6 +59,7 @@ struct acpi_softc { int acpi_standby_sx; int acpi_suspend_sx; + int acpi_sleep_delay; int acpi_s4bios; int acpi_verbose; |