diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-10-03 11:12:11 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-15 18:50:35 -0400 |
commit | 99d428cf0bcdbbbdeb622c338cd5ab72189e8d22 (patch) | |
tree | adc236f5b76c56f006d251d9dc432d3d5ec559b5 /drivers/cpufreq/tegra-cpufreq.c | |
parent | 7a936bd085372842fd1c9397a80b74e62026c89e (diff) |
cpufreq: tegra: use cpufreq_generic_init()
Use generic cpufreq_generic_init() routine instead of replicating the same code
here.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/tegra-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/tegra-cpufreq.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 9c32b23322bd..32483ef63d53 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c | |||
@@ -204,19 +204,23 @@ static struct notifier_block tegra_cpu_pm_notifier = { | |||
204 | 204 | ||
205 | static int tegra_cpu_init(struct cpufreq_policy *policy) | 205 | static int tegra_cpu_init(struct cpufreq_policy *policy) |
206 | { | 206 | { |
207 | int ret; | ||
208 | |||
207 | if (policy->cpu >= NUM_CPUS) | 209 | if (policy->cpu >= NUM_CPUS) |
208 | return -EINVAL; | 210 | return -EINVAL; |
209 | 211 | ||
210 | clk_prepare_enable(emc_clk); | 212 | clk_prepare_enable(emc_clk); |
211 | clk_prepare_enable(cpu_clk); | 213 | clk_prepare_enable(cpu_clk); |
212 | 214 | ||
213 | cpufreq_table_validate_and_show(policy, freq_table); | ||
214 | target_cpu_speed[policy->cpu] = tegra_getspeed(policy->cpu); | 215 | target_cpu_speed[policy->cpu] = tegra_getspeed(policy->cpu); |
215 | 216 | ||
216 | /* FIXME: what's the actual transition time? */ | 217 | /* FIXME: what's the actual transition time? */ |
217 | policy->cpuinfo.transition_latency = 300 * 1000; | 218 | ret = cpufreq_generic_init(policy, freq_table, 300 * 1000); |
218 | 219 | if (ret) { | |
219 | cpumask_copy(policy->cpus, cpu_possible_mask); | 220 | clk_disable_unprepare(cpu_clk); |
221 | clk_disable_unprepare(emc_clk); | ||
222 | return ret; | ||
223 | } | ||
220 | 224 | ||
221 | if (policy->cpu == 0) | 225 | if (policy->cpu == 0) |
222 | register_pm_notifier(&tegra_cpu_pm_notifier); | 226 | register_pm_notifier(&tegra_cpu_pm_notifier); |
@@ -227,6 +231,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) | |||
227 | static int tegra_cpu_exit(struct cpufreq_policy *policy) | 231 | static int tegra_cpu_exit(struct cpufreq_policy *policy) |
228 | { | 232 | { |
229 | cpufreq_frequency_table_put_attr(policy->cpu); | 233 | cpufreq_frequency_table_put_attr(policy->cpu); |
234 | clk_disable_unprepare(cpu_clk); | ||
230 | clk_disable_unprepare(emc_clk); | 235 | clk_disable_unprepare(emc_clk); |
231 | return 0; | 236 | return 0; |
232 | } | 237 | } |