From e1b1903eee71c5fa6063bbf713cfc947e76c4e04 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 3 Dec 2009 21:04:08 +0100 Subject: PM / Runtime: Make documentation of runtime_idle() agree with the code Currently the ->runtime_idle() callback is documented as having no return value, but in fact it returns int. Although its return value is ignored at the PM core level, it may be used by bus type routines executing the drivers' ->runtime_idle() callbacks. Signed-off-by: Rafael J. Wysocki Reported-by: Alan Stern --- Documentation/power/runtime_pm.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index f49a33b704d..6bb25cb24da 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt @@ -38,7 +38,7 @@ struct dev_pm_ops { ... int (*runtime_suspend)(struct device *dev); int (*runtime_resume)(struct device *dev); - void (*runtime_idle)(struct device *dev); + int (*runtime_idle)(struct device *dev); ... }; @@ -114,7 +114,8 @@ The action performed by a bus type's ->runtime_idle() callback is totally dependent on the bus type in question, but the expected and recommended action is to check if the device can be suspended (i.e. if all of the conditions necessary for suspending the device are satisfied) and to queue up a suspend -request for the device in that case. +request for the device in that case. The value returned by this callback is +ignored by the PM core. The helper functions provided by the PM core, described in Section 4, guarantee that the following constraints are met with respect to the bus type's run-time -- cgit v1.2.3 From 7a1a8eb58a2c6cd819d17332c5a2c369203635d5 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 3 Dec 2009 21:19:18 +0100 Subject: PM: Add flag for devices capable of generating run-time wake-up events Apparently, there are devices that can wake up the system from sleep states and yet are incapable of generating wake-up events at run time. Thus, introduce a flag indicating if given device is capable of generating run-time wake-up events. Signed-off-by: Rafael J. Wysocki --- Documentation/power/runtime_pm.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 6bb25cb24da..4a3109b2884 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt @@ -71,9 +71,9 @@ what to do to handle the device). purpose). In particular, if the driver requires remote wakeup capability for proper -functioning and device_may_wakeup() returns 'false' for the device, then +functioning and device_run_wake() returns 'false' for the device, then ->runtime_suspend() should return -EBUSY. On the other hand, if -device_may_wakeup() returns 'true' for the device and the device is put +device_run_wake() returns 'true' for the device and the device is put into a low power state during the execution of its bus type's ->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism allowing the device to request a change of its power state, such as PCI PME) @@ -215,6 +215,9 @@ defined in include/linux/pm.h: being executed for that device and it is not practical to wait for the suspend to complete; means "start a resume as soon as you've suspended" + unsigned int run_wake; + - set if the device is capable of generating run-time wake-up events + enum rpm_status runtime_status; - the run-time PM status of the device; this field's initial value is RPM_SUSPENDED, which means that each device is initially regarded by the -- cgit v1.2.3