summaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-16 20:54:26 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-20 21:11:12 -0500
commita436b6a19f57656a6557439523923d89eb4a880d (patch)
tree62637a13b7721a775f8aa2af4554c9fc3069f595 /Documentation/power
parentd89d7ff9edf58cbf8ad0f490694b2edea8eb3a39 (diff)
PM / runtime: Add new helper for conditional usage count incrementation
Introduce a new runtime PM function, pm_runtime_get_if_in_use(), that will increment the device's runtime PM usage counter and return 1 if its status is RPM_ACTIVE and its usage counter is greater than 0 at the same time (0 will be returned otherwise). This is useful for things that should only be done if the device is active (from the runtime PM perspective) and used by somebody (as indicated by the usage counter) already and they are not worth bothering otherwise. Requested-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/runtime_pm.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index 0784bc3a2ab5..7328cf85236c 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -371,6 +371,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
371 - increment the device's usage counter, run pm_runtime_resume(dev) and 371 - increment the device's usage counter, run pm_runtime_resume(dev) and
372 return its result 372 return its result
373 373
374 int pm_runtime_get_if_in_use(struct device *dev);
375 - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
376 runtime PM status is RPM_ACTIVE and the runtime PM usage counter is
377 nonzero, increment the counter and return 1; otherwise return 0 without
378 changing the counter
379
374 void pm_runtime_put_noidle(struct device *dev); 380 void pm_runtime_put_noidle(struct device *dev);
375 - decrement the device's usage counter 381 - decrement the device's usage counter
376 382