Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280425
b: refs/heads/master
c: 40a5f8b
h: refs/heads/master
i:
  280423: 35c0e7f
v: v3
  • Loading branch information
Rafael J. Wysocki committed Dec 25, 2011
1 parent 885391c commit 4bd91a1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 767c0f3aed74be56f268709f5347e6c86d52b408
refs/heads/master: 40a5f8be2f482783de0f1f0fe856660e489734a8
25 changes: 25 additions & 0 deletions trunk/drivers/base/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,28 @@ int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
}
EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);

/**
* dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
* @dev: Device whose ancestor to add the request for.
* @req: Pointer to the preallocated handle.
* @value: Constraint latency value.
*/
int dev_pm_qos_add_ancestor_request(struct device *dev,
struct dev_pm_qos_request *req, s32 value)
{
struct device *ancestor = dev->parent;
int error = -ENODEV;

while (ancestor && !ancestor->power.ignore_children)
ancestor = ancestor->parent;

if (ancestor)
error = dev_pm_qos_add_request(ancestor, req, value);

if (error)
req->dev = NULL;

return error;
}
EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
5 changes: 5 additions & 0 deletions trunk/include/linux/pm_qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
void dev_pm_qos_constraints_init(struct device *dev);
void dev_pm_qos_constraints_destroy(struct device *dev);
int dev_pm_qos_add_ancestor_request(struct device *dev,
struct dev_pm_qos_request *req, s32 value);
#else
static inline int pm_qos_update_target(struct pm_qos_constraints *c,
struct plist_node *node,
Expand Down Expand Up @@ -150,6 +152,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev)
{
dev->power.power_state = PMSG_INVALID;
}
static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
struct dev_pm_qos_request *req, s32 value)
{ return 0; }
#endif

#endif

0 comments on commit 4bd91a1

Please sign in to comment.