Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
qos.c File Reference
#include <linux/pm_qos.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/export.h>
#include "power.h"

Go to the source code of this file.

Functions

s32 __dev_pm_qos_read_value (struct device *dev)
 
s32 dev_pm_qos_read_value (struct device *dev)
 
void dev_pm_qos_constraints_init (struct device *dev)
 
void dev_pm_qos_constraints_destroy (struct device *dev)
 
int dev_pm_qos_add_request (struct device *dev, struct dev_pm_qos_request *req, s32 value)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_add_request)
 
int dev_pm_qos_update_request (struct dev_pm_qos_request *req, s32 new_value)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_update_request)
 
int dev_pm_qos_remove_request (struct dev_pm_qos_request *req)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_remove_request)
 
int dev_pm_qos_add_notifier (struct device *dev, struct notifier_block *notifier)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_add_notifier)
 
int dev_pm_qos_remove_notifier (struct device *dev, struct notifier_block *notifier)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_remove_notifier)
 
int dev_pm_qos_add_global_notifier (struct notifier_block *notifier)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_add_global_notifier)
 
int dev_pm_qos_remove_global_notifier (struct notifier_block *notifier)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_remove_global_notifier)
 
int dev_pm_qos_add_ancestor_request (struct device *dev, struct dev_pm_qos_request *req, s32 value)
 
 EXPORT_SYMBOL_GPL (dev_pm_qos_add_ancestor_request)
 

Function Documentation

s32 __dev_pm_qos_read_value ( struct device dev)

__dev_pm_qos_read_value - Get PM QoS constraint for a given device. : Device to get the PM QoS constraint value for.

This routine must be called with dev->power.lock held.

Definition at line 56 of file qos.c.

int dev_pm_qos_add_ancestor_request ( struct device dev,
struct dev_pm_qos_request req,
s32  value 
)

dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor. : Device whose ancestor to add the request for. : Pointer to the preallocated handle. : Constraint latency value.

Definition at line 442 of file qos.c.

int dev_pm_qos_add_global_notifier ( struct notifier_block notifier)

dev_pm_qos_add_global_notifier - sets notification entry for changes to target value of the PM QoS constraints for any device

: notifier block managed by caller.

Will register the notifier into a notification chain that gets called upon changes to the target value for any device.

Definition at line 415 of file qos.c.

int dev_pm_qos_add_notifier ( struct device dev,
struct notifier_block notifier 
)

dev_pm_qos_add_notifier - sets notification entry for changes to target value of per-device PM QoS constraints

: target device for the constraint : notifier block managed by caller.

Will register the notifier into a notification chain that gets called upon changes to the target value for the device.

If the device's constraints object doesn't exist when this routine is called, it will be created (or error code will be returned if that fails).

Definition at line 359 of file qos.c.

int dev_pm_qos_add_request ( struct device dev,
struct dev_pm_qos_request req,
s32  value 
)

dev_pm_qos_add_request - inserts new qos request into the list : target device for the constraint : pointer to a preallocated handle : defines the qos request

This function inserts a new entry in the device constraints list of requested qos performance characteristics. It recomputes the aggregate QoS expectations of parameters and initializes the dev_pm_qos_request handle. Caller needs to save this handle for later use in updates and removal.

Returns 1 if the aggregated constraint value has changed, 0 if the aggregated constraint value has not changed, -EINVAL in case of wrong parameters, -ENOMEM if there's not enough memory to allocate for data structures, -ENODEV if the device has just been removed from the system.

Definition at line 222 of file qos.c.

void dev_pm_qos_constraints_destroy ( struct device dev)

dev_pm_qos_constraints_destroy : target device

Called from the device PM subsystem on device removal under device_pm_lock().

Definition at line 165 of file qos.c.

void dev_pm_qos_constraints_init ( struct device dev)

dev_pm_qos_constraints_init - Initalize device's PM QoS constraints pointer. : target device

Called from the device PM subsystem during device insertion under device_pm_lock().

Definition at line 151 of file qos.c.

s32 dev_pm_qos_read_value ( struct device dev)

dev_pm_qos_read_value - Get PM QoS constraint for a given device (locked). : Device to get the PM QoS constraint value for.

Definition at line 67 of file qos.c.

int dev_pm_qos_remove_global_notifier ( struct notifier_block notifier)

dev_pm_qos_remove_global_notifier - deletes notification for changes to target value of PM QoS constraints for any device

: notifier block to be removed.

Will remove the notifier from the notification chain that gets called upon changes to the target value for any device.

Definition at line 430 of file qos.c.

int dev_pm_qos_remove_notifier ( struct device dev,
struct notifier_block notifier 
)

dev_pm_qos_remove_notifier - deletes notification for changes to target value of per-device PM QoS constraints

: target device for the constraint : notifier block to be removed.

Will remove the notifier from the notification chain that gets called upon changes to the target value.

Definition at line 388 of file qos.c.

int dev_pm_qos_remove_request ( struct dev_pm_qos_request req)

dev_pm_qos_remove_request - modifies an existing qos request : handle to request list element

Will remove pm qos request from the list of constraints and recompute the current target value. Call this on slow code paths.

Returns 1 if the aggregated constraint value has changed, 0 if the aggregated constraint value has not changed, -EINVAL in case of wrong parameters, -ENODEV if the device has been removed from the system

Definition at line 319 of file qos.c.

int dev_pm_qos_update_request ( struct dev_pm_qos_request req,
s32  new_value 
)

dev_pm_qos_update_request - modifies an existing qos request : handle to list element holding a dev_pm_qos request to use : defines the qos request

Updates an existing dev PM qos request along with updating the target value.

Attempts are made to make this code callable on hot code paths.

Returns 1 if the aggregated constraint value has changed, 0 if the aggregated constraint value has not changed, -EINVAL in case of wrong parameters, -ENODEV if the device has been removed from the system

Definition at line 279 of file qos.c.

EXPORT_SYMBOL_GPL ( dev_pm_qos_add_request  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_update_request  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_remove_request  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_add_notifier  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_remove_notifier  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_add_global_notifier  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_remove_global_notifier  )
EXPORT_SYMBOL_GPL ( dev_pm_qos_add_ancestor_request  )