summaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-09-25 23:35:21 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2010-10-17 01:57:48 +0200
commit15bcb91d7e607d8a2e060f01f7784a7454668da4 (patch)
tree6d59964cb78ab4b7c93a3c4d06f0dad256b99140 /include/linux/pm.h
parent7490e44239e60293bca0c2663229050c36c660c2 (diff)
downloadop-kernel-dev-15bcb91d7e607d8a2e060f01f7784a7454668da4.zip
op-kernel-dev-15bcb91d7e607d8a2e060f01f7784a7454668da4.tar.gz
PM / Runtime: Implement autosuspend support
This patch (as1427) implements the "autosuspend" facility for runtime PM. A few new fields are added to the dev_pm_info structure and several new PM helper functions are defined, for telling the PM core whether or not a device uses autosuspend, for setting the autosuspend delay, and for marking periods of device activity. Drivers that do not want to use autosuspend can continue using the same helper functions as before; their behavior will not change. In addition, drivers supporting autosuspend can also call the old helper functions to get the old behavior. The details are all explained in Documentation/power/runtime_pm.txt and Documentation/ABI/testing/sysfs-devices-power. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index abd81ff..40f3f45 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -444,6 +444,9 @@ enum rpm_status {
*
* RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback
*
+ * RPM_REQ_AUTOSUSPEND Same as RPM_REQ_SUSPEND, but not until the device has
+ * been inactive for as long as power.autosuspend_delay
+ *
* RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback
*/
@@ -451,6 +454,7 @@ enum rpm_request {
RPM_REQ_NONE = 0,
RPM_REQ_IDLE,
RPM_REQ_SUSPEND,
+ RPM_REQ_AUTOSUSPEND,
RPM_REQ_RESUME,
};
@@ -482,9 +486,13 @@ struct dev_pm_info {
unsigned int run_wake:1;
unsigned int runtime_auto:1;
unsigned int no_callbacks:1;
+ unsigned int use_autosuspend:1;
+ unsigned int timer_autosuspends:1;
enum rpm_request request;
enum rpm_status runtime_status;
int runtime_error;
+ int autosuspend_delay;
+ unsigned long last_busy;
unsigned long active_jiffies;
unsigned long suspended_jiffies;
unsigned long accounting_timestamp;
OpenPOWER on IntegriCloud