Commit 9a2a9ebc authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: Introduce governor flags

A new cpufreq governor flag will be added subsequently, so replace
the bool dynamic_switching fleid in struct cpufreq_governor with a
flags field and introduce CPUFREQ_GOV_DYNAMIC_SWITCHING to set for
the "dynamic switching" governors instead of it.

No intentional functional impact.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent f8394f23
...@@ -2254,7 +2254,7 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy) ...@@ -2254,7 +2254,7 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy)
return -EINVAL; return -EINVAL;
/* Platform doesn't want dynamic frequency switching ? */ /* Platform doesn't want dynamic frequency switching ? */
if (policy->governor->dynamic_switching && if (policy->governor->flags & CPUFREQ_GOV_DYNAMIC_SWITCHING &&
cpufreq_driver->flags & CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING) { cpufreq_driver->flags & CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING) {
struct cpufreq_governor *gov = cpufreq_fallback_governor(); struct cpufreq_governor *gov = cpufreq_fallback_governor();
......
...@@ -156,7 +156,7 @@ void cpufreq_dbs_governor_limits(struct cpufreq_policy *policy); ...@@ -156,7 +156,7 @@ void cpufreq_dbs_governor_limits(struct cpufreq_policy *policy);
#define CPUFREQ_DBS_GOVERNOR_INITIALIZER(_name_) \ #define CPUFREQ_DBS_GOVERNOR_INITIALIZER(_name_) \
{ \ { \
.name = _name_, \ .name = _name_, \
.dynamic_switching = true, \ .flags = CPUFREQ_GOV_DYNAMIC_SWITCHING, \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
.init = cpufreq_dbs_governor_init, \ .init = cpufreq_dbs_governor_init, \
.exit = cpufreq_dbs_governor_exit, \ .exit = cpufreq_dbs_governor_exit, \
......
...@@ -570,12 +570,17 @@ struct cpufreq_governor { ...@@ -570,12 +570,17 @@ struct cpufreq_governor {
char *buf); char *buf);
int (*store_setspeed) (struct cpufreq_policy *policy, int (*store_setspeed) (struct cpufreq_policy *policy,
unsigned int freq); unsigned int freq);
/* For governors which change frequency dynamically by themselves */
bool dynamic_switching;
struct list_head governor_list; struct list_head governor_list;
struct module *owner; struct module *owner;
u8 flags;
}; };
/* Governor flags */
/* For governors which change frequency dynamically by themselves */
#define CPUFREQ_GOV_DYNAMIC_SWITCHING BIT(0)
/* Pass a target to the cpufreq driver */ /* Pass a target to the cpufreq driver */
unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy, unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq); unsigned int target_freq);
......
...@@ -881,7 +881,7 @@ static void sugov_limits(struct cpufreq_policy *policy) ...@@ -881,7 +881,7 @@ static void sugov_limits(struct cpufreq_policy *policy)
struct cpufreq_governor schedutil_gov = { struct cpufreq_governor schedutil_gov = {
.name = "schedutil", .name = "schedutil",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dynamic_switching = true, .flags = CPUFREQ_GOV_DYNAMIC_SWITCHING,
.init = sugov_init, .init = sugov_init,
.exit = sugov_exit, .exit = sugov_exit,
.start = sugov_start, .start = sugov_start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment