aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-08-06 19:06:11 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-09-03 19:36:52 -0400
commitb5abb085f5540a612b0b7a6326ae2a07de2330dd (patch)
tree00098a48ea6b872e1d5f05939a30c0fbb9f5e779 /include/linux
parentfeb70af0e3ac6817327be70b47731039ea135dbc (diff)
PM / Domains: Make it possible to use domain names when adding devices
Add a new helper function __pm_genpd_name_add_device() allowing a device to be added to a (registered) generic PM domain identified by name. Add a wrapper around it, pm_genpd_name_add_device(), passing NULL as the last argument and reorganize pm_domains.h for the new functions to be defined consistently with the existing ones. These functions are useful for adding devices to PM domains whose representations are stored in tables, when the caller doesn't know the index of the domain to add the device to, but it knows the domain's name. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pm_domain.h43
1 files changed, 30 insertions, 13 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 08adf8e5a80e..1991a92b0567 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -138,17 +138,9 @@ extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
138 struct device *dev, 138 struct device *dev,
139 struct gpd_timing_data *td); 139 struct gpd_timing_data *td);
140 140
141static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 141extern int __pm_genpd_name_add_device(const char *domain_name,
142 struct device *dev) 142 struct device *dev,
143{ 143 struct gpd_timing_data *td);
144 return __pm_genpd_add_device(genpd, dev, NULL);
145}
146
147static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
148 struct device *dev)
149{
150 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
151}
152 144
153extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 145extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
154 struct device *dev); 146 struct device *dev);
@@ -187,8 +179,15 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
187{ 179{
188 return -ENOSYS; 180 return -ENOSYS;
189} 181}
190static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 182static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
191 struct device *dev) 183 struct device *dev,
184 struct gpd_timing_data *td)
185{
186 return -ENOSYS;
187}
188static inline int __pm_genpd_name_add_device(const char *domain_name,
189 struct device *dev,
190 struct gpd_timing_data *td)
192{ 191{
193 return -ENOSYS; 192 return -ENOSYS;
194} 193}
@@ -242,6 +241,24 @@ static inline bool default_stop_ok(struct device *dev)
242#define pm_domain_always_on_gov NULL 241#define pm_domain_always_on_gov NULL
243#endif 242#endif
244 243
244static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
245 struct device *dev)
246{
247 return __pm_genpd_add_device(genpd, dev, NULL);
248}
249
250static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
251 struct device *dev)
252{
253 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
254}
255
256static inline int pm_genpd_name_add_device(const char *domain_name,
257 struct device *dev)
258{
259 return __pm_genpd_name_add_device(domain_name, dev, NULL);
260}
261
245static inline int pm_genpd_remove_callbacks(struct device *dev) 262static inline int pm_genpd_remove_callbacks(struct device *dev)
246{ 263{
247 return __pm_genpd_remove_callbacks(dev, true); 264 return __pm_genpd_remove_callbacks(dev, true);