diff options
Diffstat (limited to 'drivers/cpufreq/s5pv210-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/s5pv210-cpufreq.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index ccd548c6f0c1..55a8e9fa9435 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <mach/map.h> | 23 | #include <mach/map.h> |
24 | #include <mach/regs-clock.h> | 24 | #include <mach/regs-clock.h> |
25 | 25 | ||
26 | static struct clk *cpu_clk; | ||
27 | static struct clk *dmc0_clk; | 26 | static struct clk *dmc0_clk; |
28 | static struct clk *dmc1_clk; | 27 | static struct clk *dmc1_clk; |
29 | static DEFINE_MUTEX(set_freq_lock); | 28 | static DEFINE_MUTEX(set_freq_lock); |
@@ -164,14 +163,6 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq) | |||
164 | __raw_writel(tmp1, reg); | 163 | __raw_writel(tmp1, reg); |
165 | } | 164 | } |
166 | 165 | ||
167 | static unsigned int s5pv210_getspeed(unsigned int cpu) | ||
168 | { | ||
169 | if (cpu) | ||
170 | return 0; | ||
171 | |||
172 | return clk_get_rate(cpu_clk) / 1000; | ||
173 | } | ||
174 | |||
175 | static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) | 166 | static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) |
176 | { | 167 | { |
177 | unsigned long reg; | 168 | unsigned long reg; |
@@ -193,7 +184,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index) | |||
193 | goto exit; | 184 | goto exit; |
194 | } | 185 | } |
195 | 186 | ||
196 | old_freq = s5pv210_getspeed(0); | 187 | old_freq = policy->cur; |
197 | new_freq = s5pv210_freq_table[index].frequency; | 188 | new_freq = s5pv210_freq_table[index].frequency; |
198 | 189 | ||
199 | /* Finding current running level index */ | 190 | /* Finding current running level index */ |
@@ -471,9 +462,9 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) | |||
471 | unsigned long mem_type; | 462 | unsigned long mem_type; |
472 | int ret; | 463 | int ret; |
473 | 464 | ||
474 | cpu_clk = clk_get(NULL, "armclk"); | 465 | policy->clk = clk_get(NULL, "armclk"); |
475 | if (IS_ERR(cpu_clk)) | 466 | if (IS_ERR(policy->clk)) |
476 | return PTR_ERR(cpu_clk); | 467 | return PTR_ERR(policy->clk); |
477 | 468 | ||
478 | dmc0_clk = clk_get(NULL, "sclk_dmc0"); | 469 | dmc0_clk = clk_get(NULL, "sclk_dmc0"); |
479 | if (IS_ERR(dmc0_clk)) { | 470 | if (IS_ERR(dmc0_clk)) { |
@@ -516,7 +507,7 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) | |||
516 | out_dmc1: | 507 | out_dmc1: |
517 | clk_put(dmc0_clk); | 508 | clk_put(dmc0_clk); |
518 | out_dmc0: | 509 | out_dmc0: |
519 | clk_put(cpu_clk); | 510 | clk_put(policy->clk); |
520 | return ret; | 511 | return ret; |
521 | } | 512 | } |
522 | 513 | ||
@@ -563,7 +554,7 @@ static struct cpufreq_driver s5pv210_driver = { | |||
563 | .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, | 554 | .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, |
564 | .verify = cpufreq_generic_frequency_table_verify, | 555 | .verify = cpufreq_generic_frequency_table_verify, |
565 | .target_index = s5pv210_target, | 556 | .target_index = s5pv210_target, |
566 | .get = s5pv210_getspeed, | 557 | .get = cpufreq_generic_get, |
567 | .init = s5pv210_cpu_init, | 558 | .init = s5pv210_cpu_init, |
568 | .name = "s5pv210", | 559 | .name = "s5pv210", |
569 | #ifdef CONFIG_PM | 560 | #ifdef CONFIG_PM |