Commit bdda27fb authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / PM: Fix device PM kernedoc comments and #ifdefs

The kerneldoc comments for acpi_pm_device_sleep_state(),
acpi_pm_device_run_wake(), and acpi_pm_device_sleep_wake() are
outdated or otherwise inaccurate and/or don't follow the common
kerneldoc patterns, so fix them.

Additionally, notice that acpi_pm_device_run_wake() should be under
CONFIG_PM_RUNTIME rather than under CONFIG_PM_SLEEP, so fix that too.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dea553e3
...@@ -684,28 +684,21 @@ int acpi_suspend(u32 acpi_state) ...@@ -684,28 +684,21 @@ int acpi_suspend(u32 acpi_state)
#ifdef CONFIG_PM #ifdef CONFIG_PM
/** /**
* acpi_pm_device_sleep_state - return preferred power state of ACPI device * acpi_pm_device_sleep_state - Get preferred power state of ACPI device.
* in the system sleep state given by %acpi_target_sleep_state * @dev: Device whose preferred target power state to return.
* @dev: device to examine; its driver model wakeup flags control * @d_min_p: Location to store the upper limit of the allowed states range.
* whether it should be able to wake up the system * @d_max_in: Deepest low-power state to take into consideration.
* @d_min_p: used to store the upper limit of allowed states range * Return value: Preferred power state of the device on success, -ENODEV
* @d_max_in: specify the lowest allowed states * (if there's no 'struct acpi_device' for @dev) or -EINVAL on failure
* Return value: preferred power state of the device on success, -ENODEV
* (ie. if there's no 'struct acpi_device' for @dev) or -EINVAL on failure
* *
* Find the lowest power (highest number) ACPI device power state that * Find the lowest power (highest number) ACPI device power state that the
* device @dev can be in while the system is in the sleep state represented * device can be in while the system is in the sleep state represented
* by %acpi_target_sleep_state. If @wake is nonzero, the device should be * by %acpi_target_sleep_state. If @d_min_p is set, the highest power (lowest
* able to wake up the system from this sleep state. If @d_min_p is set, * number) device power state that @dev can be in for the given system sleep
* the highest power (lowest number) device power state of @dev allowed * state is stored at the location pointed to by it.
* in this system sleep state is stored at the location pointed to by it.
* *
* The caller must ensure that @dev is valid before using this function. * The caller must ensure that @dev is valid before using this function.
* The caller is also responsible for figuring out if the device is
* supposed to be able to wake up the system and passing this information
* via @wake.
*/ */
int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in) int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
{ {
acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 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) ...@@ -797,14 +790,15 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
EXPORT_SYMBOL(acpi_pm_device_sleep_state); EXPORT_SYMBOL(acpi_pm_device_sleep_state);
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_RUNTIME
/** /**
* acpi_pm_device_run_wake - Enable/disable wake-up for given device. * acpi_pm_device_run_wake - Enable/disable remote wakeup for given device.
* @phys_dev: Device to enable/disable the platform to wake-up the system for. * @phys_dev: Device to enable/disable the platform to wake up.
* @enable: Whether enable or disable the wake-up functionality. * @enable: Whether to enable or disable the wakeup functionality.
* *
* Find the ACPI device object corresponding to @pci_dev and try to * Find the ACPI device object corresponding to @phys_dev and try to
* enable/disable the GPE associated with it. * enable/disable the GPE associated with it, so that it can generate
* wakeup signals for the device in response to external (remote) events.
*/ */
int acpi_pm_device_run_wake(struct device *phys_dev, bool enable) int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
{ {
...@@ -832,12 +826,13 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable) ...@@ -832,12 +826,13 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
return 0; return 0;
} }
EXPORT_SYMBOL(acpi_pm_device_run_wake); EXPORT_SYMBOL(acpi_pm_device_run_wake);
#endif /* CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM_SLEEP
/** /**
* acpi_pm_device_sleep_wake - enable or disable the system wake-up * acpi_pm_device_sleep_wake - Enable or disable device to wake up the system.
* capability of given device * @dev: Device to enable/desible to wake up the system from sleep states.
* @dev: device to handle * @enable: Whether to enable or disable @dev to wake up the system.
* @enable: 'true' - enable, 'false' - disable the wake-up capability
*/ */
int acpi_pm_device_sleep_wake(struct device *dev, bool enable) int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
{ {
......
...@@ -426,14 +426,18 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) ...@@ -426,14 +426,18 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
} }
#endif #endif
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_RUNTIME
int acpi_pm_device_run_wake(struct device *, bool); int acpi_pm_device_run_wake(struct device *, bool);
int acpi_pm_device_sleep_wake(struct device *, bool);
#else #else
static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
{ {
return -ENODEV; return -ENODEV;
} }
#endif
#ifdef CONFIG_PM_SLEEP
int acpi_pm_device_sleep_wake(struct device *, bool);
#else
static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
{ {
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment