aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep/main.c')
-rw-r--r--drivers/acpi/sleep/main.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index 85633c585aab..c79edcb8e842 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -26,6 +26,27 @@ u8 sleep_states[ACPI_S_STATE_COUNT];
26 26
27static u32 acpi_target_sleep_state = ACPI_STATE_S0; 27static u32 acpi_target_sleep_state = ACPI_STATE_S0;
28 28
29int acpi_sleep_prepare(u32 acpi_state)
30{
31#ifdef CONFIG_ACPI_SLEEP
32 /* do we have a wakeup address for S2 and S3? */
33 if (acpi_state == ACPI_STATE_S3) {
34 if (!acpi_wakeup_address) {
35 return -EFAULT;
36 }
37 acpi_set_firmware_waking_vector((acpi_physical_address)
38 virt_to_phys((void *)
39 acpi_wakeup_address));
40
41 }
42 ACPI_FLUSH_CPU_CACHE();
43 acpi_enable_wakeup_device_prep(acpi_state);
44#endif
45 acpi_gpe_sleep_prepare(acpi_state);
46 acpi_enter_sleep_state_prep(acpi_state);
47 return 0;
48}
49
29#ifdef CONFIG_SUSPEND 50#ifdef CONFIG_SUSPEND
30static struct pm_ops acpi_pm_ops; 51static struct pm_ops acpi_pm_ops;
31 52
@@ -60,27 +81,6 @@ static int acpi_pm_set_target(suspend_state_t pm_state)
60 return error; 81 return error;
61} 82}
62 83
63int acpi_sleep_prepare(u32 acpi_state)
64{
65#ifdef CONFIG_ACPI_SLEEP
66 /* do we have a wakeup address for S2 and S3? */
67 if (acpi_state == ACPI_STATE_S3) {
68 if (!acpi_wakeup_address) {
69 return -EFAULT;
70 }
71 acpi_set_firmware_waking_vector((acpi_physical_address)
72 virt_to_phys((void *)
73 acpi_wakeup_address));
74
75 }
76 ACPI_FLUSH_CPU_CACHE();
77 acpi_enable_wakeup_device_prep(acpi_state);
78#endif
79 acpi_gpe_sleep_prepare(acpi_state);
80 acpi_enter_sleep_state_prep(acpi_state);
81 return 0;
82}
83
84/** 84/**
85 * acpi_pm_prepare - Do preliminary suspend work. 85 * acpi_pm_prepare - Do preliminary suspend work.
86 * @pm_state: ignored 86 * @pm_state: ignored