diff options
Diffstat (limited to 'drivers/acpi/sleep')
-rw-r--r-- | drivers/acpi/sleep/main.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 96d23b3cfc4e..e2e4e617952b 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -63,11 +63,11 @@ static u32 acpi_suspend_states[] = { | |||
63 | static int init_8259A_after_S1; | 63 | static int init_8259A_after_S1; |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * acpi_pm_set_target - Set the target system sleep state to the state | 66 | * acpi_pm_begin - Set the target system sleep state to the state |
67 | * associated with given @pm_state, if supported. | 67 | * associated with given @pm_state, if supported. |
68 | */ | 68 | */ |
69 | 69 | ||
70 | static int acpi_pm_set_target(suspend_state_t pm_state) | 70 | static int acpi_pm_begin(suspend_state_t pm_state) |
71 | { | 71 | { |
72 | u32 acpi_state = acpi_suspend_states[pm_state]; | 72 | u32 acpi_state = acpi_suspend_states[pm_state]; |
73 | int error = 0; | 73 | int error = 0; |
@@ -164,7 +164,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) | |||
164 | } | 164 | } |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * acpi_pm_finish - Finish up suspend sequence. | 167 | * acpi_pm_finish - Instruct the platform to leave a sleep state. |
168 | * | 168 | * |
169 | * This is called after we wake back up (or if entering the sleep state | 169 | * This is called after we wake back up (or if entering the sleep state |
170 | * failed). | 170 | * failed). |
@@ -190,6 +190,19 @@ static void acpi_pm_finish(void) | |||
190 | #endif | 190 | #endif |
191 | } | 191 | } |
192 | 192 | ||
193 | /** | ||
194 | * acpi_pm_end - Finish up suspend sequence. | ||
195 | */ | ||
196 | |||
197 | static void acpi_pm_end(void) | ||
198 | { | ||
199 | /* | ||
200 | * This is necessary in case acpi_pm_finish() is not called during a | ||
201 | * failing transition to a sleep state. | ||
202 | */ | ||
203 | acpi_target_sleep_state = ACPI_STATE_S0; | ||
204 | } | ||
205 | |||
193 | static int acpi_pm_state_valid(suspend_state_t pm_state) | 206 | static int acpi_pm_state_valid(suspend_state_t pm_state) |
194 | { | 207 | { |
195 | u32 acpi_state; | 208 | u32 acpi_state; |
@@ -208,10 +221,11 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) | |||
208 | 221 | ||
209 | static struct platform_suspend_ops acpi_pm_ops = { | 222 | static struct platform_suspend_ops acpi_pm_ops = { |
210 | .valid = acpi_pm_state_valid, | 223 | .valid = acpi_pm_state_valid, |
211 | .set_target = acpi_pm_set_target, | 224 | .begin = acpi_pm_begin, |
212 | .prepare = acpi_pm_prepare, | 225 | .prepare = acpi_pm_prepare, |
213 | .enter = acpi_pm_enter, | 226 | .enter = acpi_pm_enter, |
214 | .finish = acpi_pm_finish, | 227 | .finish = acpi_pm_finish, |
228 | .end = acpi_pm_end, | ||
215 | }; | 229 | }; |
216 | 230 | ||
217 | /* | 231 | /* |