aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/hwesleep.c9
-rw-r--r--drivers/acpi/osl.c24
-rw-r--r--include/linux/acpi.h7
3 files changed, 40 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index 5e5f76230f5e..414076818d40 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -43,6 +43,7 @@
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 48
48#define _COMPONENT ACPI_HARDWARE 49#define _COMPONENT ACPI_HARDWARE
@@ -128,6 +129,14 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
128 129
129 ACPI_FLUSH_CPU_CACHE(); 130 ACPI_FLUSH_CPU_CACHE();
130 131
132 status = acpi_os_prepare_extended_sleep(sleep_state,
133 acpi_gbl_sleep_type_a,
134 acpi_gbl_sleep_type_b);
135 if (ACPI_SKIP(status))
136 return_ACPI_STATUS(AE_OK);
137 if (ACPI_FAILURE(status))
138 return_ACPI_STATUS(status);
139
131 /* 140 /*
132 * Set the SLP_TYP and SLP_EN bits. 141 * Set the SLP_TYP and SLP_EN bits.
133 * 142 *
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 6ab2c3505520..a934950ff7a0 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -79,6 +79,8 @@ extern char line_buf[80];
79 79
80static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl, 80static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl,
81 u32 pm1b_ctrl); 81 u32 pm1b_ctrl);
82static int (*__acpi_os_prepare_extended_sleep)(u8 sleep_state, u32 val_a,
83 u32 val_b);
82 84
83static acpi_osd_handler acpi_irq_handler; 85static acpi_osd_handler acpi_irq_handler;
84static void *acpi_irq_context; 86static void *acpi_irq_context;
@@ -1779,6 +1781,28 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
1779 __acpi_os_prepare_sleep = func; 1781 __acpi_os_prepare_sleep = func;
1780} 1782}
1781 1783
1784acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state, u32 val_a,
1785 u32 val_b)
1786{
1787 int rc = 0;
1788 if (__acpi_os_prepare_extended_sleep)
1789 rc = __acpi_os_prepare_extended_sleep(sleep_state,
1790 val_a, val_b);
1791 if (rc < 0)
1792 return AE_ERROR;
1793 else if (rc > 0)
1794 return AE_CTRL_SKIP;
1795
1796 return AE_OK;
1797}
1798
1799void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
1800 u32 val_a, u32 val_b))
1801{
1802 __acpi_os_prepare_extended_sleep = func;
1803}
1804
1805
1782void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context, 1806void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
1783 void (*func)(struct work_struct *work)) 1807 void (*func)(struct work_struct *work))
1784{ 1808{
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 353ba256f368..a5db4aeefa36 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -481,6 +481,13 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
481 481
482acpi_status acpi_os_prepare_sleep(u8 sleep_state, 482acpi_status acpi_os_prepare_sleep(u8 sleep_state,
483 u32 pm1a_control, u32 pm1b_control); 483 u32 pm1a_control, u32 pm1b_control);
484
485void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
486 u32 val_a, u32 val_b));
487
488acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
489 u32 val_a, u32 val_b);
490
484#ifdef CONFIG_X86 491#ifdef CONFIG_X86
485void arch_reserve_mem_area(acpi_physical_address addr, size_t size); 492void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
486#else 493#else