summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-16 18:28:44 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 10:35:31 +0200
commit64fceb1dcd1aa6a9f2e53cf8830b38bb007b375b (patch)
treeccf7b5a9fc9bbf65962b6bc7ba0d4adac0206c8e /arch/arm/mach-integrator
parentARM: ICST: provide definitions for max/min VCO frequencies (diff)
downloadlinux-64fceb1dcd1aa6a9f2e53cf8830b38bb007b375b.tar.xz
linux-64fceb1dcd1aa6a9f2e53cf8830b38bb007b375b.zip
ARM: ICST: use Hz instead of kHz
This makes the ICST support fit more nicely with the clk API, eliminating the need to *1000 and /1000 in places. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r--arch/arm/mach-integrator/clock.c8
-rw-r--r--arch/arm/mach-integrator/cpu.c22
-rw-r--r--arch/arm/mach-integrator/impd1.c6
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c2
4 files changed, 19 insertions, 19 deletions
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c
index bb70b64a6563..a4f80d33429d 100644
--- a/arch/arm/mach-integrator/clock.c
+++ b/arch/arm/mach-integrator/clock.c
@@ -38,8 +38,8 @@ EXPORT_SYMBOL(clk_get_rate);
long clk_round_rate(struct clk *clk, unsigned long rate)
{
struct icst_vco vco;
- vco = icst525_khz_to_vco(clk->params, rate / 1000);
- return icst525_khz(clk->params, vco) * 1000;
+ vco = icst525_hz_to_vco(clk->params, rate);
+ return icst525_hz(clk->params, vco);
}
EXPORT_SYMBOL(clk_round_rate);
@@ -50,8 +50,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (clk->setvco) {
struct icst_vco vco;
- vco = icst525_khz_to_vco(clk->params, rate / 1000);
- clk->rate = icst525_khz(clk->params, vco) * 1000;
+ vco = icst525_hz_to_vco(clk->params, rate);
+ clk->rate = icst525_hz(clk->params, vco);
clk->setvco(clk, vco);
ret = 0;
}
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index 1671b4a363b1..3ebb785f30c1 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -32,7 +32,7 @@ static struct cpufreq_driver integrator_driver;
#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK)
static const struct icst_params lclk_params = {
- .ref = 24000,
+ .ref = 24000000,
.vco_max = ICST525_VCO_MAX_5V,
.vd_min = 8,
.vd_max = 132,
@@ -41,7 +41,7 @@ static const struct icst_params lclk_params = {
};
static const struct icst_params cclk_params = {
- .ref = 24000,
+ .ref = 24000000,
.vco_max = ICST525_VCO_MAX_5V,
.vd_min = 12,
.vd_max = 160,
@@ -60,11 +60,11 @@ static int integrator_verify_policy(struct cpufreq_policy *policy)
policy->cpuinfo.min_freq,
policy->cpuinfo.max_freq);
- vco = icst525_khz_to_vco(&cclk_params, policy->max);
- policy->max = icst525_khz(&cclk_params, vco);
+ vco = icst525_hz_to_vco(&cclk_params, policy->max * 1000);
+ policy->max = icst525_hz(&cclk_params, vco) / 1000;
- vco = icst525_khz_to_vco(&cclk_params, policy->min);
- policy->min = icst525_khz(&cclk_params, vco);
+ vco = icst525_hz_to_vco(&cclk_params, policy->min * 1000);
+ policy->min = icst525_hz(&cclk_params, vco) / 1000;
cpufreq_verify_within_limits(policy,
policy->cpuinfo.min_freq,
@@ -106,17 +106,17 @@ static int integrator_set_target(struct cpufreq_policy *policy,
}
vco.v = cm_osc & 255;
vco.r = 22;
- freqs.old = icst525_khz(&cclk_params, vco);
+ freqs.old = icst525_hz(&cclk_params, vco) / 1000;
- /* icst525_khz_to_vco rounds down -- so we need the next
+ /* icst525_hz_to_vco rounds down -- so we need the next
* larger freq in case of CPUFREQ_RELATION_L.
*/
if (relation == CPUFREQ_RELATION_L)
target_freq += 999;
if (target_freq > policy->max)
target_freq = policy->max;
- vco = icst525_khz_to_vco(&cclk_params, target_freq);
- freqs.new = icst525_khz(&cclk_params, vco);
+ vco = icst525_hz_to_vco(&cclk_params, target_freq * 1000);
+ freqs.new = icst525_hz(&cclk_params, vco) / 1000;
freqs.cpu = policy->cpu;
@@ -174,7 +174,7 @@ static unsigned int integrator_get(unsigned int cpu)
vco.v = cm_osc & 255;
vco.r = 22;
- current_freq = icst525_khz(&cclk_params, vco); /* current freq */
+ current_freq = icst525_hz(&cclk_params, vco) / 1000; /* current freq */
set_cpus_allowed(current, cpus_allowed);
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 5aca7ebea3ce..ecce3eb8fe00 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -41,7 +41,7 @@ struct impd1_module {
};
static const struct icst_params impd1_vco_params = {
- .ref = 24000, /* 24 MHz */
+ .ref = 24000000, /* 24 MHz */
.vco_max = ICST525_VCO_MAX_3V,
.vd_min = 12,
.vd_max = 519,
@@ -73,8 +73,8 @@ static void impd1_setvco(struct clk *clk, struct icst_vco vco)
vco.r = (val >> 9) & 0x7f;
vco.s = (val >> 16) & 7;
- pr_debug("IM-PD1: VCO%d clock is %ld kHz\n",
- vconr, icst525_khz(&impd1_vco_params, vco));
+ pr_debug("IM-PD1: VCO%d clock is %ld Hz\n",
+ vconr, icst525_hz(&impd1_vco_params, vco));
#endif
}
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 27f95106b47c..335af99acb79 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -269,7 +269,7 @@ static void __init intcp_init_irq(void)
#define CM_AUXOSC IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x1c)
static const struct icst_params cp_auxvco_params = {
- .ref = 24000,
+ .ref = 24000000,
.vco_max = ICST525_VCO_MAX_5V,
.vd_min = 8,
.vd_max = 263,