diff options
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index c40fb2e81bbc..c11e3795431b 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -89,6 +89,7 @@ u32 acpi_target_system_state(void) | |||
89 | { | 89 | { |
90 | return acpi_target_sleep_state; | 90 | return acpi_target_sleep_state; |
91 | } | 91 | } |
92 | EXPORT_SYMBOL_GPL(acpi_target_system_state); | ||
92 | 93 | ||
93 | static bool pwr_btn_event_pending; | 94 | static bool pwr_btn_event_pending; |
94 | 95 | ||
@@ -611,6 +612,22 @@ static const struct platform_suspend_ops acpi_suspend_ops_old = { | |||
611 | .recover = acpi_pm_finish, | 612 | .recover = acpi_pm_finish, |
612 | }; | 613 | }; |
613 | 614 | ||
615 | static int acpi_freeze_begin(void) | ||
616 | { | ||
617 | acpi_scan_lock_acquire(); | ||
618 | return 0; | ||
619 | } | ||
620 | |||
621 | static void acpi_freeze_end(void) | ||
622 | { | ||
623 | acpi_scan_lock_release(); | ||
624 | } | ||
625 | |||
626 | static const struct platform_freeze_ops acpi_freeze_ops = { | ||
627 | .begin = acpi_freeze_begin, | ||
628 | .end = acpi_freeze_end, | ||
629 | }; | ||
630 | |||
614 | static void acpi_sleep_suspend_setup(void) | 631 | static void acpi_sleep_suspend_setup(void) |
615 | { | 632 | { |
616 | int i; | 633 | int i; |
@@ -621,7 +638,9 @@ static void acpi_sleep_suspend_setup(void) | |||
621 | 638 | ||
622 | suspend_set_ops(old_suspend_ordering ? | 639 | suspend_set_ops(old_suspend_ordering ? |
623 | &acpi_suspend_ops_old : &acpi_suspend_ops); | 640 | &acpi_suspend_ops_old : &acpi_suspend_ops); |
641 | freeze_set_ops(&acpi_freeze_ops); | ||
624 | } | 642 | } |
643 | |||
625 | #else /* !CONFIG_SUSPEND */ | 644 | #else /* !CONFIG_SUSPEND */ |
626 | static inline void acpi_sleep_suspend_setup(void) {} | 645 | static inline void acpi_sleep_suspend_setup(void) {} |
627 | #endif /* !CONFIG_SUSPEND */ | 646 | #endif /* !CONFIG_SUSPEND */ |