History

OPP: refactor dev_pm_opp_of_register_em() and update related drivers

The Energy Model framework supports not only CPU devices. Drop the CPU specific interface with cpumask and add struct device. Add also a return value, user might use it. This new interface provides easy way to create a simple Energy Model, which then might be used by e.g. thermal subsystem.

Lukasz Luba committed 6 years ago

Commit 0e0ffa81 parent 7b7570a9 files · +65 −35Browse files

Showing the changes to include/linux (1 of 9 files). Show all

Unified · Split

include/linux/pm_opp.h+13−2
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #ifndef __LINUX_OPP_H__
1212 #define __LINUX_OPP_H__
1313
14+#include <linux/energy_model.h>
1415 #include <linux/err.h>
1516 #include <linux/notifier.h>
1617
@@ -373,7 +374,11 @@ struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); · 356 unmodified lines
373374 struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
374375 int of_get_required_opp_performance_state(struct device_node *np, int index);
375376 int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table);
376−void dev_pm_opp_of_register_em(struct cpumask *cpus);
377+int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus);
378+static inline void dev_pm_opp_of_unregister_em(struct device *dev)
379+{
380+ em_dev_unregister_perf_domain(dev);
381+}
377382 #else
378383 static inline int dev_pm_opp_of_add_table(struct device *dev)
379384 {
@@ -413,7 +418,13 @@ static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) · 33 unmodified lines
413418 return NULL;
414419 }
415420
416−static inline void dev_pm_opp_of_register_em(struct cpumask *cpus)
421+static inline int dev_pm_opp_of_register_em(struct device *dev,
422+ struct cpumask *cpus)
423+{
424+ return -ENOTSUPP;
425+}
426+
427+static inline void dev_pm_opp_of_unregister_em(struct device *dev)
417428 {
418429 }
419430