diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-09-25 17:35:21 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-10-16 19:57:48 -0400 |
commit | 15bcb91d7e607d8a2e060f01f7784a7454668da4 (patch) | |
tree | 6d59964cb78ab4b7c93a3c4d06f0dad256b99140 /include/linux/pm.h | |
parent | 7490e44239e60293bca0c2663229050c36c660c2 (diff) |
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index abd81ffaba3c..40f3f45702ba 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -444,6 +444,9 @@ enum rpm_status { | |||
444 | * | 444 | * |
445 | * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback | 445 | * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback |
446 | * | 446 | * |
447 | * RPM_REQ_AUTOSUSPEND Same as RPM_REQ_SUSPEND, but not until the device has | ||
448 | * been inactive for as long as power.autosuspend_delay | ||
449 | * | ||
447 | * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback | 450 | * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback |
448 | */ | 451 | */ |
449 | 452 | ||
@@ -451,6 +454,7 @@ enum rpm_request { | |||
451 | RPM_REQ_NONE = 0, | 454 | RPM_REQ_NONE = 0, |
452 | RPM_REQ_IDLE, | 455 | RPM_REQ_IDLE, |
453 | RPM_REQ_SUSPEND, | 456 | RPM_REQ_SUSPEND, |
457 | RPM_REQ_AUTOSUSPEND, | ||
454 | RPM_REQ_RESUME, | 458 | RPM_REQ_RESUME, |
455 | }; | 459 | }; |
456 | 460 | ||
@@ -482,9 +486,13 @@ struct dev_pm_info { | |||
482 | unsigned int run_wake:1; | 486 | unsigned int run_wake:1; |
483 | unsigned int runtime_auto:1; | 487 | unsigned int runtime_auto:1; |
484 | unsigned int no_callbacks:1; | 488 | unsigned int no_callbacks:1; |
489 | unsigned int use_autosuspend:1; | ||
490 | unsigned int timer_autosuspends:1; | ||
485 | enum rpm_request request; | 491 | enum rpm_request request; |
486 | enum rpm_status runtime_status; | 492 | enum rpm_status runtime_status; |
487 | int runtime_error; | 493 | int runtime_error; |
494 | int autosuspend_delay; | ||
495 | unsigned long last_busy; | ||
488 | unsigned long active_jiffies; | 496 | unsigned long active_jiffies; |
489 | unsigned long suspended_jiffies; | 497 | unsigned long suspended_jiffies; |
490 | unsigned long accounting_timestamp; | 498 | unsigned long accounting_timestamp; |