aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/power/runtime_pm.txt
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-03-06 15:28:17 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2010-03-06 15:28:17 -0500
commit87d1b3e60b55ef65f10054ccc319e5d67cf010e9 (patch)
treeda89462b400db6d2b71d630be350201de7e3281e /Documentation/power/runtime_pm.txt
parent64096c17417380d8a472d096645f4cbc9406c987 (diff)
PM / Runtime: Document power.runtime_auto and related functions
The power.runtime_auto device flag and the helper functions pm_runtime_allow() and pm_runtime_forbid() used to modify it are a part of the run-time power management framework and therefore they should be described in Documentation/power/runtime_pm.txt. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'Documentation/power/runtime_pm.txt')
-rw-r--r--Documentation/power/runtime_pm.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 356fd86f4ea8..f19370641684 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -224,6 +224,12 @@ defined in include/linux/pm.h:
224 RPM_SUSPENDED, which means that each device is initially regarded by the 224 RPM_SUSPENDED, which means that each device is initially regarded by the
225 PM core as 'suspended', regardless of its real hardware status 225 PM core as 'suspended', regardless of its real hardware status
226 226
227 unsigned int runtime_auto;
228 - if set, indicates that the user space has allowed the device driver to
229 power manage the device at run time via the /sys/devices/.../power/control
230 interface; it may only be modified with the help of the pm_runtime_allow()
231 and pm_runtime_forbid() helper functions
232
227All of the above fields are members of the 'power' member of 'struct device'. 233All of the above fields are members of the 'power' member of 'struct device'.
228 234
2294. Run-time PM Device Helper Functions 2354. Run-time PM Device Helper Functions
@@ -329,6 +335,16 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
329 'power.runtime_error' is set or 'power.disable_depth' is greater than 335 'power.runtime_error' is set or 'power.disable_depth' is greater than
330 zero) 336 zero)
331 337
338 void pm_runtime_allow(struct device *dev);
339 - set the power.runtime_auto flag for the device and decrease its usage
340 counter (used by the /sys/devices/.../power/control interface to
341 effectively allow the device to be power managed at run time)
342
343 void pm_runtime_forbid(struct device *dev);
344 - unset the power.runtime_auto flag for the device and increase its usage
345 counter (used by the /sys/devices/.../power/control interface to
346 effectively prevent the device from being power managed at run time)
347
332It is safe to execute the following helper functions from interrupt context: 348It is safe to execute the following helper functions from interrupt context:
333 349
334pm_request_idle() 350pm_request_idle()
@@ -382,6 +398,18 @@ may be desirable to suspend the device as soon as ->probe() or ->remove() has
382finished, so the PM core uses pm_runtime_idle_sync() to invoke the 398finished, so the PM core uses pm_runtime_idle_sync() to invoke the
383subsystem-level idle callback for the device at that time. 399subsystem-level idle callback for the device at that time.
384 400
401The user space can effectively disallow the driver of the device to power manage
402it at run time by changing the value of its /sys/devices/.../power/control
403attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
404this mechanism may also be used by the driver to effectively turn off the
405run-time power management of the device until the user space turns it on.
406Namely, during the initialization the driver can make sure that the run-time PM
407status of the device is 'active' and call pm_runtime_forbid(). It should be
408noted, however, that if the user space has already intentionally changed the
409value of /sys/devices/.../power/control to "auto" to allow the driver to power
410manage the device at run time, the driver may confuse it by using
411pm_runtime_forbid() this way.
412
3856. Run-time PM and System Sleep 4136. Run-time PM and System Sleep
386 414
387Run-time PM and system sleep (i.e., system suspend and hibernation, also known 415Run-time PM and system sleep (i.e., system suspend and hibernation, also known