-/* $OpenBSD: acpi_x86.c,v 1.3 2022/02/14 23:42:37 kettenis Exp $ */
+/* $OpenBSD: acpi_x86.c,v 1.4 2022/02/15 02:29:23 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
if (aml_node_setval(sc, sc->sc_pts, sc->sc_state) != 0)
return (EINVAL);
acpi_indicator(sc, ACPI_SST_WAKING); /* blink */
+
+ acpibtn_enable_psw(); /* enable _LID for wakeup */
+ acpi_indicator(sc, ACPI_SST_SLEEPING);
+
+ /* 3rd suspend AML step: _GTS(tostate) */
+ aml_node_setval(sc, sc->sc_gts, sc->sc_state);
return 0;
}
{
struct acpi_softc *sc = v;
- acpibtn_enable_psw(); /* enable _LID for wakeup */
- acpi_indicator(sc, ACPI_SST_SLEEPING);
-
- /* 3rd suspend AML step: _GTS(tostate) */
- aml_node_setval(sc, sc->sc_gts, sc->sc_state);
-
/* Clear fixed event status */
acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS);