aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/devfreq.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r--include/linux/devfreq.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index d48dc00232a4..f1863dcd83ea 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -181,6 +181,12 @@ extern struct devfreq *devfreq_add_device(struct device *dev,
181 const char *governor_name, 181 const char *governor_name,
182 void *data); 182 void *data);
183extern int devfreq_remove_device(struct devfreq *devfreq); 183extern int devfreq_remove_device(struct devfreq *devfreq);
184extern struct devfreq *devm_devfreq_add_device(struct device *dev,
185 struct devfreq_dev_profile *profile,
186 const char *governor_name,
187 void *data);
188extern void devm_devfreq_remove_device(struct device *dev,
189 struct devfreq *devfreq);
184 190
185/* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */ 191/* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */
186extern int devfreq_suspend_device(struct devfreq *devfreq); 192extern int devfreq_suspend_device(struct devfreq *devfreq);
@@ -193,6 +199,10 @@ extern int devfreq_register_opp_notifier(struct device *dev,
193 struct devfreq *devfreq); 199 struct devfreq *devfreq);
194extern int devfreq_unregister_opp_notifier(struct device *dev, 200extern int devfreq_unregister_opp_notifier(struct device *dev,
195 struct devfreq *devfreq); 201 struct devfreq *devfreq);
202extern int devm_devfreq_register_opp_notifier(struct device *dev,
203 struct devfreq *devfreq);
204extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
205 struct devfreq *devfreq);
196 206
197#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) 207#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
198/** 208/**
@@ -220,7 +230,7 @@ static inline struct devfreq *devfreq_add_device(struct device *dev,
220 const char *governor_name, 230 const char *governor_name,
221 void *data) 231 void *data)
222{ 232{
223 return NULL; 233 return ERR_PTR(-ENOSYS);
224} 234}
225 235
226static inline int devfreq_remove_device(struct devfreq *devfreq) 236static inline int devfreq_remove_device(struct devfreq *devfreq)
@@ -228,6 +238,19 @@ static inline int devfreq_remove_device(struct devfreq *devfreq)
228 return 0; 238 return 0;
229} 239}
230 240
241static inline struct devfreq *devm_devfreq_add_device(struct device *dev,
242 struct devfreq_dev_profile *profile,
243 const char *governor_name,
244 void *data)
245{
246 return ERR_PTR(-ENOSYS);
247}
248
249static inline void devm_devfreq_remove_device(struct device *dev,
250 struct devfreq *devfreq)
251{
252}
253
231static inline int devfreq_suspend_device(struct devfreq *devfreq) 254static inline int devfreq_suspend_device(struct devfreq *devfreq)
232{ 255{
233 return 0; 256 return 0;
@@ -256,6 +279,16 @@ static inline int devfreq_unregister_opp_notifier(struct device *dev,
256 return -EINVAL; 279 return -EINVAL;
257} 280}
258 281
282static inline int devm_devfreq_register_opp_notifier(struct device *dev,
283 struct devfreq *devfreq)
284{
285 return -EINVAL;
286}
287
288static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,
289 struct devfreq *devfreq)
290{
291}
259#endif /* CONFIG_PM_DEVFREQ */ 292#endif /* CONFIG_PM_DEVFREQ */
260 293
261#endif /* __LINUX_DEVFREQ_H__ */ 294#endif /* __LINUX_DEVFREQ_H__ */