From 56d8cb57b9ea877c38cd4725f36425b9f7e54a72 Mon Sep 17 00:00:00 2001 From: Mitsuru IWASAKI Date: Sun, 22 Jul 2001 19:13:54 +0000 Subject: Don't do sleep state transition if specified sleep state is not supported by the system. --- sys/dev/acpica/acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/dev') diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 93f58b589a45..8eaaeb26935e 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1041,6 +1041,8 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) { ACPI_STATUS status = AE_OK; UINT16 Count; + UINT8 TypeA; + UINT8 TypeB; FUNCTION_TRACE_U32(__func__, state); ACPI_ASSERTLOCK; @@ -1057,6 +1059,12 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) case ACPI_STATE_S2: case ACPI_STATE_S3: case ACPI_STATE_S4: + status = AcpiHwObtainSleepTypeRegisterData((UINT8)state, &TypeA, &TypeB); + if (status != AE_OK) { + device_printf(sc->acpi_dev, "AcpiHwObtainSleepTypeRegisterData failed - %s\n", AcpiFormatException(status)); + break; + } + /* * Inform all devices that we are going to sleep. */ -- cgit v1.3