diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 17:11:42 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 17:11:42 -0400 |
commit | a392f7d4afb850934851fde5a8e298912650a6b8 (patch) | |
tree | ed9901ba019615f6911c0f9f1a3af180b243bc8f /kernel/power | |
parent | f58c41cc0427115e3d750ec090020892acf0fb9c (diff) | |
parent | 4cf563c5d97c83d4b2fb3a778dd7d5e362cc3e34 (diff) |
Merge branch 'acpi-pm'
* acpi-pm:
ACPI / PM: Export rest of the subsys PM callbacks
ACPI / PM: Avoid resuming devices in ACPI PM domain during system suspend
ACPI / PM: Hold ACPI scan lock over the "freeze" sleep state
ACPI / PM: Export acpi_target_system_state() to modules
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/suspend.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 338a6f147974..963e6d0f050b 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -38,6 +38,7 @@ struct pm_sleep_state pm_states[PM_SUSPEND_MAX] = { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | static const struct platform_suspend_ops *suspend_ops; | 40 | static const struct platform_suspend_ops *suspend_ops; |
41 | static const struct platform_freeze_ops *freeze_ops; | ||
41 | 42 | ||
42 | static bool need_suspend_ops(suspend_state_t state) | 43 | static bool need_suspend_ops(suspend_state_t state) |
43 | { | 44 | { |
@@ -47,6 +48,13 @@ static bool need_suspend_ops(suspend_state_t state) | |||
47 | static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head); | 48 | static DECLARE_WAIT_QUEUE_HEAD(suspend_freeze_wait_head); |
48 | static bool suspend_freeze_wake; | 49 | static bool suspend_freeze_wake; |
49 | 50 | ||
51 | void freeze_set_ops(const struct platform_freeze_ops *ops) | ||
52 | { | ||
53 | lock_system_sleep(); | ||
54 | freeze_ops = ops; | ||
55 | unlock_system_sleep(); | ||
56 | } | ||
57 | |||
50 | static void freeze_begin(void) | 58 | static void freeze_begin(void) |
51 | { | 59 | { |
52 | suspend_freeze_wake = false; | 60 | suspend_freeze_wake = false; |
@@ -291,6 +299,10 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
291 | error = suspend_ops->begin(state); | 299 | error = suspend_ops->begin(state); |
292 | if (error) | 300 | if (error) |
293 | goto Close; | 301 | goto Close; |
302 | } else if (state == PM_SUSPEND_FREEZE && freeze_ops->begin) { | ||
303 | error = freeze_ops->begin(); | ||
304 | if (error) | ||
305 | goto Close; | ||
294 | } | 306 | } |
295 | suspend_console(); | 307 | suspend_console(); |
296 | suspend_test_start(); | 308 | suspend_test_start(); |
@@ -316,6 +328,9 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
316 | Close: | 328 | Close: |
317 | if (need_suspend_ops(state) && suspend_ops->end) | 329 | if (need_suspend_ops(state) && suspend_ops->end) |
318 | suspend_ops->end(); | 330 | suspend_ops->end(); |
331 | else if (state == PM_SUSPEND_FREEZE && freeze_ops->end) | ||
332 | freeze_ops->end(); | ||
333 | |||
319 | trace_machine_suspend(PWR_EVENT_EXIT); | 334 | trace_machine_suspend(PWR_EVENT_EXIT); |
320 | return error; | 335 | return error; |
321 | 336 | ||