Commit 04958bd1 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] arm-integrator ->get() implementation

arm-integrator had its ->get() implementation inside
integrator_cpufreq_init(). Move it to an extra function,
and add it as ->get() function.
parent bc301e11
......@@ -152,10 +152,10 @@ static int integrator_set_target(struct cpufreq_policy *policy,
return 0;
}
static int integrator_cpufreq_init(struct cpufreq_policy *policy)
static unsigned int integrator_get(unsigned int cpu)
{
unsigned long cpus_allowed;
unsigned int cpu = policy->cpu;
unsigned int current_freq;
u_int cm_osc;
struct icst525_vco vco;
......@@ -175,15 +175,22 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
vco.v = cm_osc & 255;
vco.r = 22;
current_freq = icst525_khz(&cclk_params, vco); /* current freq */
set_cpus_allowed(current, cpus_allowed);
return current_freq;
}
static int integrator_cpufreq_init(struct cpufreq_policy *policy)
{
/* set default policy and cpuinfo */
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.max_freq = 160000;
policy->cpuinfo.min_freq = 12000;
policy->cpuinfo.transition_latency = 1000000; /* 1 ms, assumed */
policy->cur = policy->min = policy->max =
icst525_khz(&cclk_params, vco); /* current freq */
set_cpus_allowed(current, cpus_allowed);
policy->cur = policy->min = policy->max = integrator_get(policy->cpu);
return 0;
}
......@@ -191,6 +198,7 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
static struct cpufreq_driver integrator_driver = {
.verify = integrator_verify_policy,
.target = integrator_set_target,
.get = integrator_get,
.init = integrator_cpufreq_init,
.name = "integrator",
};
......
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