Commit a150ef02 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] sa11x0 ->get

sa11x0_getspeed can be used by both cpu-sa1100.c and cpu-sa1110.c as
->get() function. Update calling conventions, and un-export it as
we fixed the handling of cpufreq_get in the cpufreq core. Also,
remove special call to userspace-governor init as it isn't needed
any longer.
parent 04958bd1
...@@ -180,7 +180,7 @@ static int sa1100_target(struct cpufreq_policy *policy, ...@@ -180,7 +180,7 @@ static int sa1100_target(struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int target_freq,
unsigned int relation) unsigned int relation)
{ {
unsigned int cur = sa11x0_getspeed(); unsigned int cur = sa11x0_getspeed(0);
unsigned int new_ppcr; unsigned int new_ppcr;
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
...@@ -221,7 +221,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy) ...@@ -221,7 +221,7 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
{ {
if (policy->cpu != 0) if (policy->cpu != 0)
return -EINVAL; return -EINVAL;
policy->cur = policy->min = policy->max = sa11x0_getspeed(); policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.min_freq = 59000; policy->cpuinfo.min_freq = 59000;
policy->cpuinfo.max_freq = 287000; policy->cpuinfo.max_freq = 287000;
...@@ -230,15 +230,17 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy) ...@@ -230,15 +230,17 @@ static int __init sa1100_cpu_init(struct cpufreq_policy *policy)
} }
static struct cpufreq_driver sa1100_driver = { static struct cpufreq_driver sa1100_driver = {
.flags = (CPUFREQ_PANIC_OUTOFSYNC |
CPUFREQ_PANIC_RESUME_OUTOFSYNC),
.verify = sa11x0_verify_speed, .verify = sa11x0_verify_speed,
.target = sa1100_target, .target = sa1100_target,
.get = sa11x0_getspeed,
.init = sa1100_cpu_init, .init = sa1100_cpu_init,
.name = "sa1100", .name = "sa1100",
}; };
static int __init sa1100_dram_init(void) static int __init sa1100_dram_init(void)
{ {
cpufreq_gov_userspace_init();
if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID) if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID)
return cpufreq_register_driver(&sa1100_driver); return cpufreq_register_driver(&sa1100_driver);
else else
......
...@@ -238,7 +238,7 @@ static int sa1110_target(struct cpufreq_policy *policy, ...@@ -238,7 +238,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
return -EINVAL; return -EINVAL;
} }
freqs.old = sa11x0_getspeed(); freqs.old = sa11x0_getspeed(0);
freqs.new = sa11x0_ppcr_to_freq(ppcr); freqs.new = sa11x0_ppcr_to_freq(ppcr);
freqs.cpu = 0; freqs.cpu = 0;
...@@ -320,7 +320,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) ...@@ -320,7 +320,7 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
{ {
if (policy->cpu != 0) if (policy->cpu != 0)
return -EINVAL; return -EINVAL;
policy->cur = policy->min = policy->max = sa11x0_getspeed(); policy->cur = policy->min = policy->max = sa11x0_getspeed(0);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.min_freq = 59000; policy->cpuinfo.min_freq = 59000;
policy->cpuinfo.max_freq = 287000; policy->cpuinfo.max_freq = 287000;
...@@ -329,8 +329,11 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy) ...@@ -329,8 +329,11 @@ static int __init sa1110_cpu_init(struct cpufreq_policy *policy)
} }
static struct cpufreq_driver sa1110_driver = { static struct cpufreq_driver sa1110_driver = {
.flags = (CPUFREQ_PANIC_OUTOFSYNC |
CPUFREQ_PANIC_RESUME_OUTOFSYNC),
.verify = sa11x0_verify_speed, .verify = sa11x0_verify_speed,
.target = sa1110_target, .target = sa1110_target,
.get = sa11x0_getspeed,
.init = sa1110_cpu_init, .init = sa1110_cpu_init,
.name = "sa1110", .name = "sa1110",
}; };
...@@ -354,8 +357,6 @@ static int __init sa1110_clk_init(void) ...@@ -354,8 +357,6 @@ static int __init sa1110_clk_init(void)
sdram->tck, sdram->trcd, sdram->trp, sdram->tck, sdram->trcd, sdram->trp,
sdram->twr, sdram->refresh, sdram->cas_latency); sdram->twr, sdram->refresh, sdram->cas_latency);
cpufreq_gov_userspace_init();
memcpy(&sdram_params, sdram, sizeof(sdram_params)); memcpy(&sdram_params, sdram, sizeof(sdram_params));
return cpufreq_register_driver(&sa1110_driver); return cpufreq_register_driver(&sa1110_driver);
......
...@@ -96,11 +96,13 @@ int sa11x0_verify_speed(struct cpufreq_policy *policy) ...@@ -96,11 +96,13 @@ int sa11x0_verify_speed(struct cpufreq_policy *policy)
return 0; return 0;
} }
unsigned int sa11x0_getspeed(void) unsigned int sa11x0_getspeed(unsigned int cpu)
{ {
if (cpu)
return 0;
return cclk_frequency_100khz[PPCR & 0xf] * 100; return cclk_frequency_100khz[PPCR & 0xf] * 100;
} }
EXPORT_SYMBOL(sa11x0_getspeed);
#else #else
/* /*
* We still need to provide this so building without cpufreq works. * We still need to provide this so building without cpufreq works.
......
...@@ -22,5 +22,5 @@ struct cpufreq_policy; ...@@ -22,5 +22,5 @@ struct cpufreq_policy;
extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
extern int sa11x0_verify_speed(struct cpufreq_policy *policy); extern int sa11x0_verify_speed(struct cpufreq_policy *policy);
extern unsigned int sa11x0_getspeed(void); extern unsigned int sa11x0_getspeed(unsigned int cpu);
extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx); extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx);
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