diff options
| author | Jean Pihet <j-pihet@ti.com> | 2011-08-25 15:35:34 +0200 | 
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-08-25 15:35:34 +0200 | 
| commit | abe98ec2d86279fe821c9051003a0abc43444f15 (patch) | |
| tree | 014f3ce775504218121194f54e2ba5b88c08c777 /include/linux/pm_qos.h | |
| parent | 4e1779baaa542c83b459b0a56585e0c1a04c7782 (diff) | |
| download | olio-linux-3.10-abe98ec2d86279fe821c9051003a0abc43444f15.tar.xz olio-linux-3.10-abe98ec2d86279fe821c9051003a0abc43444f15.zip  | |
PM QoS: Generalize and export constraints management code
In preparation for the per-device constratins support:
 - rename update_target to pm_qos_update_target
 - generalize and export pm_qos_update_target for usage by the upcoming
   per-device latency constraints framework:
   * operate on struct pm_qos_constraints for constraints management,
   * introduce an 'action' parameter for constraints add/update/remove,
   * the return value indicates if the aggregated constraint value has
     changed,
 - update the internal code to operate on struct pm_qos_constraints
 - add a NULL pointer check in the API functions
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm_qos.h')
| -rw-r--r-- | include/linux/pm_qos.h | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 97723113ae9..84aa1508989 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h @@ -44,7 +44,16 @@ struct pm_qos_constraints {  	struct blocking_notifier_head *notifiers;  }; +/* Action requested to pm_qos_update_target */ +enum pm_qos_req_action { +	PM_QOS_ADD_REQ,		/* Add a new request */ +	PM_QOS_UPDATE_REQ,	/* Update an existing request */ +	PM_QOS_REMOVE_REQ	/* Remove an existing request */ +}; +  #ifdef CONFIG_PM +int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, +			 enum pm_qos_req_action action, int value);  void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,  			s32 value);  void pm_qos_update_request(struct pm_qos_request *req, @@ -56,6 +65,11 @@ int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);  int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);  int pm_qos_request_active(struct pm_qos_request *req);  #else +static inline int pm_qos_update_target(struct pm_qos_constraints *c, +				       struct plist_node *node, +				       enum pm_qos_req_action action, +				       int value) +			{ return 0; }  static inline void pm_qos_add_request(struct pm_qos_request *req,  				      int pm_qos_class, s32 value)  			{ return; }  |