提交 74a2799a 编写于 作者: R Rafael J. Wysocki

PM / Domains: Operations related to cpuidle using domain names

Make it possible to use domain names in operations connecting cpuidle
to and disconnecting it from a PM domain.  This is useful on
platforms where PM domain objects are organized in such a way that
the names of the domains are easier to use than the addresses of
those objects.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
上级 40114447
...@@ -1887,6 +1887,16 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) ...@@ -1887,6 +1887,16 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
goto out; goto out;
} }
/**
* pm_genpd_name_attach_cpuidle - Find PM domain and connect cpuidle to it.
* @name: Name of the domain to connect to cpuidle.
* @state: cpuidle state this domain can manipulate.
*/
int pm_genpd_name_attach_cpuidle(const char *name, int state)
{
return pm_genpd_attach_cpuidle(pm_genpd_lookup_name(name), state);
}
/** /**
* pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain. * pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain.
* @genpd: PM domain to remove the cpuidle connection from. * @genpd: PM domain to remove the cpuidle connection from.
...@@ -1925,6 +1935,15 @@ int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) ...@@ -1925,6 +1935,15 @@ int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
return ret; return ret;
} }
/**
* pm_genpd_name_detach_cpuidle - Find PM domain and disconnect cpuidle from it.
* @name: Name of the domain to disconnect cpuidle from.
*/
int pm_genpd_name_detach_cpuidle(const char *name)
{
return pm_genpd_detach_cpuidle(pm_genpd_lookup_name(name));
}
/* Default device callbacks for generic PM domains. */ /* Default device callbacks for generic PM domains. */
/** /**
......
...@@ -156,7 +156,9 @@ extern int pm_genpd_add_callbacks(struct device *dev, ...@@ -156,7 +156,9 @@ extern int pm_genpd_add_callbacks(struct device *dev,
struct gpd_timing_data *td); struct gpd_timing_data *td);
extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
extern int pm_genpd_name_detach_cpuidle(const char *name);
extern void pm_genpd_init(struct generic_pm_domain *genpd, extern void pm_genpd_init(struct generic_pm_domain *genpd,
struct dev_power_governor *gov, bool is_off); struct dev_power_governor *gov, bool is_off);
...@@ -229,10 +231,18 @@ static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int s ...@@ -229,10 +231,18 @@ static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int s
{ {
return -ENOSYS; return -ENOSYS;
} }
static inline int pm_genpd_name_attach_cpuidle(const char *name, int state)
{
return -ENOSYS;
}
static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
{ {
return -ENOSYS; return -ENOSYS;
} }
static inline int pm_genpd_name_detach_cpuidle(const char *name)
{
return -ENOSYS;
}
static inline void pm_genpd_init(struct generic_pm_domain *genpd, static inline void pm_genpd_init(struct generic_pm_domain *genpd,
struct dev_power_governor *gov, bool is_off) struct dev_power_governor *gov, bool is_off)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册