diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-18 04:21:21 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-03-09 16:41:07 +0300 |
commit | 702c9e542a25cf95683c08c56e711eddb80020ac (patch) | |
tree | 245a4ac07166204e1aee917cc2b5057ec28eed16 /drivers/cpufreq/cpufreq_conservative.c | |
parent | 8847e038c1d19c20dda0d7a590e31ffa528da8a5 (diff) | |
download | linux-702c9e542a25cf95683c08c56e711eddb80020ac.tar.xz |
cpufreq: governor: Add a ->start callback for governors
To avoid having to check the governor type explicitly in the common
code in order to initialize data structures specific to the governor
type properly, add a ->start callback to struct dbs_governor and
use it to initialize those data structures for the ondemand and
conservative governors.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_conservative.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 4a6f8e1ed72e..c11fe95152de 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -279,6 +279,14 @@ static void cs_exit(struct dbs_data *dbs_data, bool notify) kfree(dbs_data->tuners); } +static void cs_start(struct cpufreq_policy *policy) +{ + struct cs_cpu_dbs_info_s *dbs_info = &per_cpu(cs_cpu_dbs_info, policy->cpu); + + dbs_info->down_skip = 0; + dbs_info->requested_freq = policy->cur; +} + define_get_cpu_dbs_routines(cs_cpu_dbs_info); static struct dbs_governor cs_dbs_gov = { @@ -295,6 +303,7 @@ static struct dbs_governor cs_dbs_gov = { .gov_dbs_timer = cs_dbs_timer, .init = cs_init, .exit = cs_exit, + .start = cs_start, }; #define CPU_FREQ_GOV_CONSERVATIVE (&cs_dbs_gov.gov) |