summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/contrib/dev/acpica/hwsleep.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c
index d3c9841..bb4ef6a 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 */
OpenPOWER on IntegriCloud