]> err.no Git - linux-2.6/blobdiff - drivers/acpi/hardware/hwsleep.c
Merge branches 'ns9x' and 'machtypes' into devel
[linux-2.6] / drivers / acpi / hardware / hwsleep.c
index fd1c4ba63367469f9826460c6b545407491f9f86..dba3cfbe8cba9e3235970e7b972e7f54da24c4af 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -70,9 +70,10 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
 
        /* Get the FACS */
 
-       status =
-           acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-                                   (struct acpi_table_header **)&facs);
+       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+                                        ACPI_CAST_INDIRECT_PTR(struct
+                                                               acpi_table_header,
+                                                               &facs));
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
@@ -124,9 +125,10 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
 
        /* Get the FACS */
 
-       status =
-           acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-                                   (struct acpi_table_header **)&facs);
+       status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+                                        ACPI_CAST_INDIRECT_PTR(struct
+                                                               acpi_table_header,
+                                                               &facs));
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
@@ -221,15 +223,17 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
                break;
        }
 
-       /* Set the system indicators to show the desired sleep state. */
-
+       /*
+        * Set the system indicators to show the desired sleep state.
+        * _SST is an optional method (return no error if not found)
+        */
        status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);
        if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
                ACPI_EXCEPTION((AE_INFO, status,
                                "While executing method _SST"));
        }
 
-       return_ACPI_STATUS(status);
+       return_ACPI_STATUS(AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
@@ -286,13 +290,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
        }
 
        /*
+        * 1) Disable/Clear all GPEs
         * 2) Enable all wakeup GPEs
         */
        status = acpi_hw_disable_all_gpes();
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
-
        acpi_gbl_system_awake_and_running = FALSE;
 
        status = acpi_hw_enable_all_wakeup_gpes();
@@ -616,6 +620,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
                return_ACPI_STATUS(status);
        }
 
+       arg.integer.value = sleep_state;
        status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL);
        if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
                ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK"));