Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
domain.c File Reference
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <linux/pm_domain.h>
#include <linux/pm_qos.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/suspend.h>
#include <linux/export.h>

Go to the source code of this file.

Macros

#define GENPD_DEV_CALLBACK(genpd, type, callback, dev)
 
#define GENPD_DEV_TIMED_CALLBACK(genpd, type, callback, dev, field, name)
 
#define pm_genpd_runtime_suspend   NULL
 
#define pm_genpd_runtime_resume   NULL
 
#define pm_genpd_prepare   NULL
 
#define pm_genpd_suspend   NULL
 
#define pm_genpd_suspend_late   NULL
 
#define pm_genpd_suspend_noirq   NULL
 
#define pm_genpd_resume_early   NULL
 
#define pm_genpd_resume_noirq   NULL
 
#define pm_genpd_resume   NULL
 
#define pm_genpd_freeze   NULL
 
#define pm_genpd_freeze_late   NULL
 
#define pm_genpd_freeze_noirq   NULL
 
#define pm_genpd_thaw_early   NULL
 
#define pm_genpd_thaw_noirq   NULL
 
#define pm_genpd_thaw   NULL
 
#define pm_genpd_restore_noirq   NULL
 
#define pm_genpd_complete   NULL
 

Functions

int __pm_genpd_add_device (struct generic_pm_domain *genpd, struct device *dev, struct gpd_timing_data *td)
 
int __pm_genpd_of_add_device (struct device_node *genpd_node, struct device *dev, struct gpd_timing_data *td)
 
int __pm_genpd_name_add_device (const char *domain_name, struct device *dev, struct gpd_timing_data *td)
 
int pm_genpd_remove_device (struct generic_pm_domain *genpd, struct device *dev)
 
void pm_genpd_dev_need_restore (struct device *dev, bool val)
 
 EXPORT_SYMBOL_GPL (pm_genpd_dev_need_restore)
 
int pm_genpd_add_subdomain (struct generic_pm_domain *genpd, struct generic_pm_domain *subdomain)
 
int pm_genpd_add_subdomain_names (const char *master_name, const char *subdomain_name)
 
int pm_genpd_remove_subdomain (struct generic_pm_domain *genpd, struct generic_pm_domain *subdomain)
 
int pm_genpd_add_callbacks (struct device *dev, struct gpd_dev_ops *ops, struct gpd_timing_data *td)
 
 EXPORT_SYMBOL_GPL (pm_genpd_add_callbacks)
 
int __pm_genpd_remove_callbacks (struct device *dev, bool clear_td)
 
 EXPORT_SYMBOL_GPL (__pm_genpd_remove_callbacks)
 
int pm_genpd_attach_cpuidle (struct generic_pm_domain *genpd, int state)
 
: Name of the domain to connect to cpuidle.

pm_genpd_name_attach_cpuidle - Find PM domain and connect cpuidle to it.

: cpuidle state this domain can manipulate.

int pm_genpd_name_attach_cpuidle (const char *name, int state)
 
int pm_genpd_detach_cpuidle (struct generic_pm_domain *genpd)
 

: Name of the domain to disconnect cpuidle from.

pm_genpd_name_detach_cpuidle - Find PM domain and disconnect cpuidle from it.

#define pm_genpd_default_suspend   NULL
 
#define pm_genpd_default_suspend_late   NULL
 
#define pm_genpd_default_resume_early   NULL
 
#define pm_genpd_default_resume   NULL
 
#define pm_genpd_default_freeze   NULL
 
#define pm_genpd_default_freeze_late   NULL
 
#define pm_genpd_default_thaw_early   NULL
 
#define pm_genpd_default_thaw   NULL
 
int pm_genpd_name_detach_cpuidle (const char *name)
 
void pm_genpd_init (struct generic_pm_domain *genpd, struct dev_power_governor *gov, bool is_off)
 

Macro Definition Documentation

#define GENPD_DEV_CALLBACK (   genpd,
  type,
  callback,
  dev 
)
Value:
({ \
type (*__routine)(struct device *__d); \
type __ret = (type)0; \
\
__routine = genpd->dev_ops.callback; \
if (__routine) { \
__ret = __routine(dev); \
} else { \
__routine = dev_gpd_data(dev)->ops.callback; \
if (__routine) \
__ret = __routine(dev); \
} \
__ret; \
})

Definition at line 21 of file domain.c.

#define GENPD_DEV_TIMED_CALLBACK (   genpd,
  type,
  callback,
  dev,
  field,
  name 
)
Value:
({ \
type __retval = GENPD_DEV_CALLBACK(genpd, type, callback, dev); \
s64 __elapsed = ktime_to_ns(ktime_sub(ktime_get(), __start)); \
struct gpd_timing_data *__td = &dev_gpd_data(dev)->td; \
if (!__retval && __elapsed > __td->field) { \
__td->field = __elapsed; \
dev_warn(dev, name " latency exceeded, new value %lld ns\n", \
__elapsed); \
genpd->max_off_time_changed = true; \
__td->constraint_changed = true; \
} \
__retval; \
})

Definition at line 37 of file domain.c.

#define pm_genpd_complete   NULL

Definition at line 1367 of file domain.c.

#define pm_genpd_default_freeze   NULL

Definition at line 2102 of file domain.c.

#define pm_genpd_default_freeze_late   NULL

Definition at line 2103 of file domain.c.

#define pm_genpd_default_resume   NULL

Definition at line 2101 of file domain.c.

#define pm_genpd_default_resume_early   NULL

Definition at line 2100 of file domain.c.

#define pm_genpd_default_suspend   NULL

Definition at line 2098 of file domain.c.

#define pm_genpd_default_suspend_late   NULL

Definition at line 2099 of file domain.c.

#define pm_genpd_default_thaw   NULL

Definition at line 2105 of file domain.c.

#define pm_genpd_default_thaw_early   NULL

Definition at line 2104 of file domain.c.

#define pm_genpd_freeze   NULL

Definition at line 1360 of file domain.c.

#define pm_genpd_freeze_late   NULL

Definition at line 1361 of file domain.c.

#define pm_genpd_freeze_noirq   NULL

Definition at line 1362 of file domain.c.

#define pm_genpd_prepare   NULL

Definition at line 1353 of file domain.c.

#define pm_genpd_restore_noirq   NULL

Definition at line 1366 of file domain.c.

#define pm_genpd_resume   NULL

Definition at line 1359 of file domain.c.

#define pm_genpd_resume_early   NULL

Definition at line 1357 of file domain.c.

#define pm_genpd_resume_noirq   NULL

Definition at line 1358 of file domain.c.

#define pm_genpd_runtime_resume   NULL

Definition at line 727 of file domain.c.

#define pm_genpd_runtime_suspend   NULL

Definition at line 726 of file domain.c.

#define pm_genpd_suspend   NULL

Definition at line 1354 of file domain.c.

#define pm_genpd_suspend_late   NULL

Definition at line 1355 of file domain.c.

#define pm_genpd_suspend_noirq   NULL

Definition at line 1356 of file domain.c.

#define pm_genpd_thaw   NULL

Definition at line 1365 of file domain.c.

#define pm_genpd_thaw_early   NULL

Definition at line 1363 of file domain.c.

#define pm_genpd_thaw_noirq   NULL

Definition at line 1364 of file domain.c.

Function Documentation

int __pm_genpd_add_device ( struct generic_pm_domain genpd,
struct device dev,
struct gpd_timing_data td 
)

__pm_genpd_add_device - Add a device to an I/O PM domain. : PM domain to add the device to. : Device to be added. : Set of PM QoS timing parameters to attach to the device.

Definition at line 1398 of file domain.c.

int __pm_genpd_name_add_device ( const char domain_name,
struct device dev,
struct gpd_timing_data td 
)

__pm_genpd_name_add_device - Find I/O PM domain and add a device to it. : Name of the PM domain to add the device to. : Device to be added. : Set of PM QoS timing parameters to attach to the device.

Definition at line 1505 of file domain.c.

int __pm_genpd_of_add_device ( struct device_node genpd_node,
struct device dev,
struct gpd_timing_data td 
)

__pm_genpd_of_add_device - Add a device to an I/O PM domain. : Device tree node pointer representing a PM domain to which the the device is added to. : Device to be added. : Set of PM QoS timing parameters to attach to the device.

Definition at line 1473 of file domain.c.

int __pm_genpd_remove_callbacks ( struct device dev,
bool  clear_td 
)

__pm_genpd_remove_callbacks - Remove PM domain callbacks from a given device. : Device to remove the callbacks from. : If set, clear the device's timing data too.

This routine can only be called after pm_genpd_add_callbacks().

Definition at line 1788 of file domain.c.

EXPORT_SYMBOL_GPL ( pm_genpd_dev_need_restore  )
EXPORT_SYMBOL_GPL ( pm_genpd_add_callbacks  )
EXPORT_SYMBOL_GPL ( __pm_genpd_remove_callbacks  )
int pm_genpd_add_callbacks ( struct device dev,
struct gpd_dev_ops ops,
struct gpd_timing_data td 
)

pm_genpd_add_callbacks - Add PM domain callbacks to a given device. : Device to add the callbacks to. : Set of callbacks to add. : Timing data to add to the device along with the callbacks (optional).

Every call to this routine should be balanced with a call to __pm_genpd_remove_callbacks() and they must not be nested.

Definition at line 1735 of file domain.c.

int pm_genpd_add_subdomain ( struct generic_pm_domain genpd,
struct generic_pm_domain subdomain 
)

pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain. : Master PM domain to add the subdomain to. : Subdomain to be added.

Definition at line 1597 of file domain.c.

int pm_genpd_add_subdomain_names ( const char master_name,
const char subdomain_name 
)

pm_genpd_add_subdomain_names - Add a subdomain to an I/O PM domain. : Name of the master PM domain to add the subdomain to. : Name of the subdomain to be added.

Definition at line 1655 of file domain.c.

int pm_genpd_attach_cpuidle ( struct generic_pm_domain genpd,
int  state 
)

pm_genpd_attach_cpuidle - Connect the given PM domain with cpuidle. : PM domain to be connected with cpuidle. : cpuidle state this domain can disable/enable.

Make a PM domain behave as though it contained a CPU core, that is, instead of calling its power down routine it will enable the given cpuidle state so that the cpuidle subsystem can power it down (if possible and desirable).

Definition at line 1841 of file domain.c.

int pm_genpd_detach_cpuidle ( struct generic_pm_domain genpd)

pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain. : PM domain to remove the cpuidle connection from.

Remove the cpuidle connection set up by pm_genpd_attach_cpuidle() from the given PM domain.

Definition at line 1910 of file domain.c.

void pm_genpd_dev_need_restore ( struct device dev,
bool  val 
)

pm_genpd_dev_need_restore - Set/unset the device's "need restore" flag. : Device to set/unset the flag for. : The new value of the device's "need restore" flag.

Definition at line 1577 of file domain.c.

void pm_genpd_init ( struct generic_pm_domain genpd,
struct dev_power_governor gov,
bool  is_off 
)

pm_genpd_init - Initialize a generic I/O PM domain object. : PM domain object to initialize. : PM domain governor to associate with the domain (may be NULL). : Initial value of the domain's power_is_off field.

Definition at line 2115 of file domain.c.

int pm_genpd_name_attach_cpuidle ( const char name,
int  state 
)

Definition at line 1898 of file domain.c.

int pm_genpd_name_detach_cpuidle ( const char name)

Definition at line 1945 of file domain.c.

int pm_genpd_remove_device ( struct generic_pm_domain genpd,
struct device dev 
)

pm_genpd_remove_device - Remove a device from an I/O PM domain. : PM domain to remove the device from. : Device to be removed.

Definition at line 1516 of file domain.c.

int pm_genpd_remove_subdomain ( struct generic_pm_domain genpd,
struct generic_pm_domain subdomain 
)

pm_genpd_remove_subdomain - Remove a subdomain from an I/O PM domain. : Master PM domain to remove the subdomain from. : Subdomain to be removed.

Definition at line 1684 of file domain.c.