]> err.no Git - linux-2.6/blobdiff - drivers/acpi/sleep/main.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6] / drivers / acpi / sleep / main.c
index 048295ec370786aae9b04b900402103e29c72df8..2c0b6630f8ba54603530fce4574f8697faaabe9e 100644 (file)
@@ -44,7 +44,6 @@ int acpi_sleep_prepare(u32 acpi_state)
        ACPI_FLUSH_CPU_CACHE();
        acpi_enable_wakeup_device_prep(acpi_state);
 #endif
-       acpi_gpe_sleep_prepare(acpi_state);
        acpi_enter_sleep_state_prep(acpi_state);
        return 0;
 }
@@ -168,8 +167,8 @@ static void acpi_pm_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
-       acpi_leave_sleep_state(acpi_state);
        acpi_disable_wakeup_device(acpi_state);
+       acpi_leave_sleep_state(acpi_state);
 
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
@@ -268,8 +267,13 @@ static void acpi_hibernation_leave(void)
 
 static void acpi_hibernation_finish(void)
 {
-       acpi_leave_sleep_state(ACPI_STATE_S4);
+       /*
+        * If ACPI is not enabled by the BIOS and the boot kernel, we need to
+        * enable it here.
+        */
+       acpi_enable();
        acpi_disable_wakeup_device(ACPI_STATE_S4);
+       acpi_leave_sleep_state(ACPI_STATE_S4);
 
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
@@ -406,6 +410,7 @@ static void acpi_power_off(void)
        /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
        printk("%s called\n", __FUNCTION__);
        local_irq_disable();
+       acpi_enable_wakeup_device(ACPI_STATE_S5);
        acpi_enter_sleep_state(ACPI_STATE_S5);
 }