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.
This commit is contained in:
parent
fcfce9770f
commit
ff01efb50d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102402
@ -416,12 +416,16 @@ acpi_attach(device_t dev)
|
||||
SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
|
||||
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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user