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
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
373struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);374struct device_node *dev_pm_opp_get_of_node(struct dev_pm_opp *opp);
374int of_get_required_opp_performance_state(struct device_node *np, int index);375int of_get_required_opp_performance_state(struct device_node *np, int index);
375int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table);376int dev_pm_opp_of_find_icc_paths(struct device *dev, struct opp_table *opp_table);
376void dev_pm_opp_of_register_em(struct cpumask *cpus);377int dev_pm_opp_of_register_em(struct device *dev, struct cpumask *cpus);
378static inline void dev_pm_opp_of_unregister_em(struct device *dev)
379{
380 em_dev_unregister_perf_domain(dev);
381}
377#else382#else
378static inline int dev_pm_opp_of_add_table(struct device *dev)383static 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
416static inline void dev_pm_opp_of_register_em(struct cpumask *cpus)421static inline int dev_pm_opp_of_register_em(struct device *dev,
422 struct cpumask *cpus)
423{
424 return -ENOTSUPP;
425}
426
427static inline void dev_pm_opp_of_unregister_em(struct device *dev)
417{428{
418}429}
419 430