diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 10:58:30 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-28 10:58:30 (GMT) |
commit | 3b4550e0e0cd24d8073dc571cecb0d4aa4ca3542 (patch) | |
tree | 44af05a1ac1c85621fa1d06d50d6b127a4cc83bb /include | |
parent | 8e9914d5efe460600f5948da7ae4c1b6c038a4c0 (diff) | |
parent | fa1675b56537651270e79967b7f1ee4202c83bf6 (diff) | |
download | linux-fsl-qoriq-3b4550e0e0cd24d8073dc571cecb0d4aa4ca3542.tar.xz |
Merge branch 'acpi-pm'
* acpi-pm:
ACPI / PM: Rework and clean up acpi_dev_pm_get_state()
ACPI / PM: Replace ACPI_STATE_D3 with ACPI_STATE_D3_COLD in device_pm.c
ACPI / PM: Rename function acpi_device_power_state() and make it static
ACPI / PM: acpi_processor_suspend() can be static
xen / ACPI / sleep: Register an acpi_suspend_lowlevel callback.
x86 / ACPI / sleep: Provide registration for acpi_suspend_lowlevel.
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_bus.h | 16 | ||||
-rw-r--r-- | include/xen/acpi.h | 16 |
2 files changed, 17 insertions, 15 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index cf0817a..cac0dfb 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -461,8 +461,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, acpi_notify_handler handler, void *context); acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, acpi_notify_handler handler); -int acpi_device_power_state(struct device *dev, struct acpi_device *adev, - u32 target_state, int d_max_in, int *d_min_p); int acpi_pm_device_sleep_state(struct device *, int *, int); void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); @@ -478,23 +476,13 @@ static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, { return AE_SUPPORT; } -static inline int __acpi_device_power_state(int m, int *p) +static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) { if (p) *p = ACPI_STATE_D0; + return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; } -static inline int acpi_device_power_state(struct device *dev, - struct acpi_device *adev, - u32 target_state, int d_max_in, - int *d_min_p) -{ - return __acpi_device_power_state(d_max_in, d_min_p); -} -static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) -{ - return __acpi_device_power_state(m, p); -} static inline void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev) {} static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, diff --git a/include/xen/acpi.h b/include/xen/acpi.h index 68d73d0..46aa3d1 100644 --- a/include/xen/acpi.h +++ b/include/xen/acpi.h @@ -78,11 +78,25 @@ static inline int xen_acpi_get_pxm(acpi_handle h) int xen_acpi_notify_hypervisor_state(u8 sleep_state, u32 pm1a_cnt, u32 pm1b_cnd); +static inline int xen_acpi_suspend_lowlevel(void) +{ + /* + * Xen will save and restore CPU context, so + * we can skip that and just go straight to + * the suspend. + */ + acpi_enter_sleep_state(ACPI_STATE_S3); + return 0; +} + static inline void xen_acpi_sleep_register(void) { - if (xen_initial_domain()) + if (xen_initial_domain()) { acpi_os_set_prepare_sleep( &xen_acpi_notify_hypervisor_state); + + acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel; + } } #else static inline void xen_acpi_sleep_register(void) |