diff options
| author | Nate Lawson <njl@FreeBSD.org> | 2004-05-25 02:41:19 +0000 |
|---|---|---|
| committer | Nate Lawson <njl@FreeBSD.org> | 2004-05-25 02:41:19 +0000 |
| commit | 0c3e6e7452ccfae218edc7facff29f625d9e0c1f (patch) | |
| tree | 98084a924d3852a9d145a062e0280d08f8793605 /sys/contrib/dev | |
| parent | c2c6addc686b2cc52c573b9097bff6ffc5a167dd (diff) | |
Notes
Diffstat (limited to 'sys/contrib/dev')
| -rw-r--r-- | sys/contrib/dev/acpica/hwsleep.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c index d3c984128ce3..bb4ef6a90a91 100644 --- a/sys/contrib/dev/acpica/hwsleep.c +++ b/sys/contrib/dev/acpica/hwsleep.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface - * $Revision: 66 $ + * $Revision: 69 $ * *****************************************************************************/ @@ -358,6 +358,8 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } + /* Clear all fixed and general purpose status bits */ + Status = AcpiHwClearAcpiStatus (ACPI_MTX_DO_NOT_LOCK); if (ACPI_FAILURE (Status)) { @@ -376,10 +378,17 @@ AcpiEnterSleepState ( } /* - * 1) Disable all runtime GPEs + * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs */ - Status = AcpiHwPrepareGpesForSleep (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = FALSE; + + Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -531,10 +540,17 @@ AcpiEnterSleepStateS4bios ( } /* - * 1) Disable all runtime GPEs + * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs */ - Status = AcpiHwPrepareGpesForSleep (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = FALSE; + + Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -658,10 +674,17 @@ AcpiLeaveSleepState ( /* * Restore the GPEs: - * 1) Disable all wakeup GPEs + * 1) Disable/Clear all GPEs * 2) Enable all runtime GPEs */ - Status = AcpiHwRestoreGpesOnWake (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = TRUE; + + Status = AcpiHwEnableAllRuntimeGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -669,9 +692,9 @@ AcpiLeaveSleepState ( /* Enable power button */ - AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId, + (void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId, 1, ACPI_MTX_DO_NOT_LOCK); - AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, + (void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, 1, ACPI_MTX_DO_NOT_LOCK); /* Enable BM arbitration */ |
