diff options
author | Len Brown <len.brown@intel.com> | 2012-03-22 01:31:09 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-03-22 01:31:09 -0400 |
commit | e840dfe334b4791af07aadee1b2cf3c7c7363581 (patch) | |
tree | b0f8336f578cb6d3e39399f6714b8ec811536225 /drivers/acpi | |
parent | c16fa4f2ad19908a47c63d8fa436a1178438c7e7 (diff) | |
parent | a1f37788a6d8c037e7d92fe4a0fe9ec0d713b21e (diff) |
Merge branch 'stable/for-x86-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into tboot
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/hwsleep.c | 10 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 24 |
2 files changed, 31 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 3c4a922a9fc2..af702a7a69d9 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c | |||
@@ -43,9 +43,9 @@ | |||
43 | */ | 43 | */ |
44 | 44 | ||
45 | #include <acpi/acpi.h> | 45 | #include <acpi/acpi.h> |
46 | #include <linux/acpi.h> | ||
46 | #include "accommon.h" | 47 | #include "accommon.h" |
47 | #include "actables.h" | 48 | #include "actables.h" |
48 | #include <linux/tboot.h> | ||
49 | #include <linux/module.h> | 49 | #include <linux/module.h> |
50 | 50 | ||
51 | #define _COMPONENT ACPI_HARDWARE | 51 | #define _COMPONENT ACPI_HARDWARE |
@@ -344,8 +344,12 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
344 | 344 | ||
345 | ACPI_FLUSH_CPU_CACHE(); | 345 | ACPI_FLUSH_CPU_CACHE(); |
346 | 346 | ||
347 | tboot_sleep(sleep_state, pm1a_control, pm1b_control); | 347 | status = acpi_os_prepare_sleep(sleep_state, pm1a_control, |
348 | 348 | pm1b_control); | |
349 | if (ACPI_SKIP(status)) | ||
350 | return_ACPI_STATUS(AE_OK); | ||
351 | if (ACPI_FAILURE(status)) | ||
352 | return_ACPI_STATUS(status); | ||
349 | /* Write #2: Write both SLP_TYP + SLP_EN */ | 353 | /* Write #2: Write both SLP_TYP + SLP_EN */ |
350 | 354 | ||
351 | status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control); | 355 | status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control); |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 412a1e04a922..17516ad59937 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -77,6 +77,9 @@ EXPORT_SYMBOL(acpi_in_debugger); | |||
77 | extern char line_buf[80]; | 77 | extern char line_buf[80]; |
78 | #endif /*ENABLE_DEBUGGER */ | 78 | #endif /*ENABLE_DEBUGGER */ |
79 | 79 | ||
80 | static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl, | ||
81 | u32 pm1b_ctrl); | ||
82 | |||
80 | static acpi_osd_handler acpi_irq_handler; | 83 | static acpi_osd_handler acpi_irq_handler; |
81 | static void *acpi_irq_context; | 84 | static void *acpi_irq_context; |
82 | static struct workqueue_struct *kacpid_wq; | 85 | static struct workqueue_struct *kacpid_wq; |
@@ -1641,3 +1644,24 @@ acpi_status acpi_os_terminate(void) | |||
1641 | 1644 | ||
1642 | return AE_OK; | 1645 | return AE_OK; |
1643 | } | 1646 | } |
1647 | |||
1648 | acpi_status acpi_os_prepare_sleep(u8 sleep_state, u32 pm1a_control, | ||
1649 | u32 pm1b_control) | ||
1650 | { | ||
1651 | int rc = 0; | ||
1652 | if (__acpi_os_prepare_sleep) | ||
1653 | rc = __acpi_os_prepare_sleep(sleep_state, | ||
1654 | pm1a_control, pm1b_control); | ||
1655 | if (rc < 0) | ||
1656 | return AE_ERROR; | ||
1657 | else if (rc > 0) | ||
1658 | return AE_CTRL_SKIP; | ||
1659 | |||
1660 | return AE_OK; | ||
1661 | } | ||
1662 | |||
1663 | void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | ||
1664 | u32 pm1a_ctrl, u32 pm1b_ctrl)) | ||
1665 | { | ||
1666 | __acpi_os_prepare_sleep = func; | ||
1667 | } | ||