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.
Showing the changes to include/linux (1 of 9 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | |||
| 11 | #ifndef __LINUX_OPP_H__ | 11 | #ifndef __LINUX_OPP_H__ |
| 12 | #define __LINUX_OPP_H__ | 12 | #define __LINUX_OPP_H__ |
| 13 | 13 | ||
| 14 | #include <linux/energy_model.h> | ||
| 14 | #include <linux/err.h> | 15 | #include <linux/err.h> |
| 15 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
| 16 | 17 | ||
| @@ -373,7 +374,11 @@ struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev); · 356 unmodified lines | |||
| 373 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); | 374 | struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp); |
| 374 | int of_get_required_opp_performance_state(struct device_node *np, int index); | 375 | int of_get_required_opp_performance_state(struct device_node *np, int index); |
| 375 | int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table); | 376 | 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 | } | ||
| 377 | #else | 382 | #else |
| 378 | static inline int dev_pm_opp_of_add_table(struct device *dev) | 383 | static inline int dev_pm_opp_of_add_table(struct device *dev) |
| 379 | { | 384 | { |
| @@ -413,7 +418,13 @@ static inline struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp) · 33 unmodified lines | |||
| 413 | return NULL; | 418 | return NULL; |
| 414 | } | 419 | } |
| 415 | 420 | ||
| 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) | ||
| 417 | { | 428 | { |
| 418 | } | 429 | } |
| 419 | 430 | ||