diff options
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 cf0817a555e4..cac0dfb2a082 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, | |||
461 | acpi_notify_handler handler, void *context); | 461 | acpi_notify_handler handler, void *context); |
462 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | 462 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, |
463 | acpi_notify_handler handler); | 463 | acpi_notify_handler handler); |
464 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | ||
465 | u32 target_state, int d_max_in, int *d_min_p); | ||
466 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 464 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
467 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | 465 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); |
468 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | 466 | 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, | |||
478 | { | 476 | { |
479 | return AE_SUPPORT; | 477 | return AE_SUPPORT; |
480 | } | 478 | } |
481 | static inline int __acpi_device_power_state(int m, int *p) | 479 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) |
482 | { | 480 | { |
483 | if (p) | 481 | if (p) |
484 | *p = ACPI_STATE_D0; | 482 | *p = ACPI_STATE_D0; |
483 | |||
485 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; | 484 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; |
486 | } | 485 | } |
487 | static inline int acpi_device_power_state(struct device *dev, | ||
488 | struct acpi_device *adev, | ||
489 | u32 target_state, int d_max_in, | ||
490 | int *d_min_p) | ||
491 | { | ||
492 | return __acpi_device_power_state(d_max_in, d_min_p); | ||
493 | } | ||
494 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | ||
495 | { | ||
496 | return __acpi_device_power_state(m, p); | ||
497 | } | ||
498 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | 486 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, |
499 | struct device *depdev) {} | 487 | struct device *depdev) {} |
500 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | 488 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, |
diff --git a/include/xen/acpi.h b/include/xen/acpi.h index 68d73d09b770..46aa3d1c1654 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) | |||
78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, | 78 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, |
79 | u32 pm1a_cnt, u32 pm1b_cnd); | 79 | u32 pm1a_cnt, u32 pm1b_cnd); |
80 | 80 | ||
81 | static inline int xen_acpi_suspend_lowlevel(void) | ||
82 | { | ||
83 | /* | ||
84 | * Xen will save and restore CPU context, so | ||
85 | * we can skip that and just go straight to | ||
86 | * the suspend. | ||
87 | */ | ||
88 | acpi_enter_sleep_state(ACPI_STATE_S3); | ||
89 | return 0; | ||
90 | } | ||
91 | |||
81 | static inline void xen_acpi_sleep_register(void) | 92 | static inline void xen_acpi_sleep_register(void) |
82 | { | 93 | { |
83 | if (xen_initial_domain()) | 94 | if (xen_initial_domain()) { |
84 | acpi_os_set_prepare_sleep( | 95 | acpi_os_set_prepare_sleep( |
85 | &xen_acpi_notify_hypervisor_state); | 96 | &xen_acpi_notify_hypervisor_state); |
97 | |||
98 | acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel; | ||
99 | } | ||
86 | } | 100 | } |
87 | #else | 101 | #else |
88 | static inline void xen_acpi_sleep_register(void) | 102 | static inline void xen_acpi_sleep_register(void) |