aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/sleep.c53
-rw-r--r--include/acpi/acpi_bus.h8
2 files changed, 30 insertions, 31 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 69134653909c..4defa0297ee4 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -684,28 +684,21 @@ int acpi_suspend(u32 acpi_state)
684 684
685#ifdef CONFIG_PM 685#ifdef CONFIG_PM
686/** 686/**
687 * acpi_pm_device_sleep_state - return preferred power state of ACPI device 687 * acpi_pm_device_sleep_state - Get preferred power state of ACPI device.
688 * in the system sleep state given by %acpi_target_sleep_state 688 * @dev: Device whose preferred target power state to return.
689 * @dev: device to examine; its driver model wakeup flags control 689 * @d_min_p: Location to store the upper limit of the allowed states range.
690 * whether it should be able to wake up the system 690 * @d_max_in: Deepest low-power state to take into consideration.
691 * @d_min_p: used to store the upper limit of allowed states range 691 * Return value: Preferred power state of the device on success, -ENODEV
692 * @d_max_in: specify the lowest allowed states 692 * (if there's no 'struct acpi_device' for @dev) or -EINVAL on failure
693 * Return value: preferred power state of the device on success, -ENODEV
694 * (ie. if there's no 'struct acpi_device' for @dev) or -EINVAL on failure
695 * 693 *
696 * Find the lowest power (highest number) ACPI device power state that 694 * Find the lowest power (highest number) ACPI device power state that the
697 * device @dev can be in while the system is in the sleep state represented 695 * device can be in while the system is in the sleep state represented
698 * by %acpi_target_sleep_state. If @wake is nonzero, the device should be 696 * by %acpi_target_sleep_state. If @d_min_p is set, the highest power (lowest
699 * able to wake up the system from this sleep state. If @d_min_p is set, 697 * number) device power state that @dev can be in for the given system sleep
700 * the highest power (lowest number) device power state of @dev allowed 698 * state is stored at the location pointed to by it.
701 * in this system sleep state is stored at the location pointed to by it.
702 * 699 *
703 * The caller must ensure that @dev is valid before using this function. 700 * The caller must ensure that @dev is valid before using this function.
704 * The caller is also responsible for figuring out if the device is
705 * supposed to be able to wake up the system and passing this information
706 * via @wake.
707 */ 701 */
708
709int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in) 702int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
710{ 703{
711 acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 704 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
@@ -797,14 +790,15 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
797EXPORT_SYMBOL(acpi_pm_device_sleep_state); 790EXPORT_SYMBOL(acpi_pm_device_sleep_state);
798#endif /* CONFIG_PM */ 791#endif /* CONFIG_PM */
799 792
800#ifdef CONFIG_PM_SLEEP 793#ifdef CONFIG_PM_RUNTIME
801/** 794/**
802 * acpi_pm_device_run_wake - Enable/disable wake-up for given device. 795 * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
803 * @phys_dev: Device to enable/disable the platform to wake-up the system for. 796 * @phys_dev: Device to enable/disable the platform to wake up.
804 * @enable: Whether enable or disable the wake-up functionality. 797 * @enable: Whether to enable or disable the wakeup functionality.
805 * 798 *
806 * Find the ACPI device object corresponding to @pci_dev and try to 799 * Find the ACPI device object corresponding to @phys_dev and try to
807 * enable/disable the GPE associated with it. 800 * enable/disable the GPE associated with it, so that it can generate
801 * wakeup signals for the device in response to external (remote) events.
808 */ 802 */
809int acpi_pm_device_run_wake(struct device *phys_dev, bool enable) 803int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
810{ 804{
@@ -832,12 +826,13 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
832 return 0; 826 return 0;
833} 827}
834EXPORT_SYMBOL(acpi_pm_device_run_wake); 828EXPORT_SYMBOL(acpi_pm_device_run_wake);
829#endif /* CONFIG_PM_RUNTIME */
835 830
831#ifdef CONFIG_PM_SLEEP
836/** 832/**
837 * acpi_pm_device_sleep_wake - enable or disable the system wake-up 833 * acpi_pm_device_sleep_wake - Enable or disable device to wake up the system.
838 * capability of given device 834 * @dev: Device to enable/desible to wake up the system from sleep states.
839 * @dev: device to handle 835 * @enable: Whether to enable or disable @dev to wake up the system.
840 * @enable: 'true' - enable, 'false' - disable the wake-up capability
841 */ 836 */
842int acpi_pm_device_sleep_wake(struct device *dev, bool enable) 837int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
843{ 838{
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 0daa0fbd8654..72053db9c2ec 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -426,14 +426,18 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
426} 426}
427#endif 427#endif
428 428
429#ifdef CONFIG_PM_SLEEP 429#ifdef CONFIG_PM_RUNTIME
430int acpi_pm_device_run_wake(struct device *, bool); 430int acpi_pm_device_run_wake(struct device *, bool);
431int acpi_pm_device_sleep_wake(struct device *, bool);
432#else 431#else
433static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) 432static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
434{ 433{
435 return -ENODEV; 434 return -ENODEV;
436} 435}
436#endif
437
438#ifdef CONFIG_PM_SLEEP
439int acpi_pm_device_sleep_wake(struct device *, bool);
440#else
437static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) 441static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
438{ 442{
439 return -ENODEV; 443 return -ENODEV;