diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-01-16 12:28:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-02 04:35:31 -0400 |
commit | 64fceb1dcd1aa6a9f2e53cf8830b38bb007b375b (patch) | |
tree | ccf7b5a9fc9bbf65962b6bc7ba0d4adac0206c8e /arch/arm/mach-integrator | |
parent | 4de2edbd15ff70c77e1d018611d06f7801fc2b72 (diff) |
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.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-integrator/cpu.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c index bb70b64a656..a4f80d33429 100644 --- a/arch/arm/mach-integrator/clock.c +++ b/arch/arm/mach-integrator/clock.c | |||
@@ -38,8 +38,8 @@ EXPORT_SYMBOL(clk_get_rate); | |||
38 | long clk_round_rate(struct clk *clk, unsigned long rate) | 38 | long clk_round_rate(struct clk *clk, unsigned long rate) |
39 | { | 39 | { |
40 | struct icst_vco vco; | 40 | struct icst_vco vco; |
41 | vco = icst525_khz_to_vco(clk->params, rate / 1000); | 41 | vco = icst525_hz_to_vco(clk->params, rate); |
42 | return icst525_khz(clk->params, vco) * 1000; | 42 | return icst525_hz(clk->params, vco); |
43 | } | 43 | } |
44 | EXPORT_SYMBOL(clk_round_rate); | 44 | EXPORT_SYMBOL(clk_round_rate); |
45 | 45 | ||
@@ -50,8 +50,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
50 | if (clk->setvco) { | 50 | if (clk->setvco) { |
51 | struct icst_vco vco; | 51 | struct icst_vco vco; |
52 | 52 | ||
53 | vco = icst525_khz_to_vco(clk->params, rate / 1000); | 53 | vco = icst525_hz_to_vco(clk->params, rate); |
54 | clk->rate = icst525_khz(clk->params, vco) * 1000; | 54 | clk->rate = icst525_hz(clk->params, vco); |
55 | clk->setvco(clk, vco); | 55 | clk->setvco(clk, vco); |
56 | ret = 0; | 56 | ret = 0; |
57 | } | 57 | } |
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c index 1671b4a363b..3ebb785f30c 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; | |||
32 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) | 32 | #define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) |
33 | 33 | ||
34 | static const struct icst_params lclk_params = { | 34 | static const struct icst_params lclk_params = { |
35 | .ref = 24000, | 35 | .ref = 24000000, |
36 | .vco_max = ICST525_VCO_MAX_5V, | 36 | .vco_max = ICST525_VCO_MAX_5V, |
37 | .vd_min = 8, | 37 | .vd_min = 8, |
38 | .vd_max = 132, | 38 | .vd_max = 132, |
@@ -41,7 +41,7 @@ static const struct icst_params lclk_params = { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | static const struct icst_params cclk_params = { | 43 | static const struct icst_params cclk_params = { |
44 | .ref = 24000, | 44 | .ref = 24000000, |
45 | .vco_max = ICST525_VCO_MAX_5V, | 45 | .vco_max = ICST525_VCO_MAX_5V, |
46 | .vd_min = 12, | 46 | .vd_min = 12, |
47 | .vd_max = 160, | 47 | .vd_max = 160, |
@@ -60,11 +60,11 @@ static int integrator_verify_policy(struct cpufreq_policy *policy) | |||
60 | policy->cpuinfo.min_freq, | 60 | policy->cpuinfo.min_freq, |
61 | policy->cpuinfo.max_freq); | 61 | policy->cpuinfo.max_freq); |
62 | 62 | ||
63 | vco = icst525_khz_to_vco(&cclk_params, policy->max); | 63 | vco = icst525_hz_to_vco(&cclk_params, policy->max * 1000); |
64 | policy->max = icst525_khz(&cclk_params, vco); | 64 | policy->max = icst525_hz(&cclk_params, vco) / 1000; |
65 | 65 | ||
66 | vco = icst525_khz_to_vco(&cclk_params, policy->min); | 66 | vco = icst525_hz_to_vco(&cclk_params, policy->min * 1000); |
67 | policy->min = icst525_khz(&cclk_params, vco); | 67 | policy->min = icst525_hz(&cclk_params, vco) / 1000; |
68 | 68 | ||
69 | cpufreq_verify_within_limits(policy, | 69 | cpufreq_verify_within_limits(policy, |
70 | policy->cpuinfo.min_freq, | 70 | policy->cpuinfo.min_freq, |
@@ -106,17 +106,17 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
106 | } | 106 | } |
107 | vco.v = cm_osc & 255; | 107 | vco.v = cm_osc & 255; |
108 | vco.r = 22; | 108 | vco.r = 22; |
109 | freqs.old = icst525_khz(&cclk_params, vco); | 109 | freqs.old = icst525_hz(&cclk_params, vco) / 1000; |
110 | 110 | ||
111 | /* icst525_khz_to_vco rounds down -- so we need the next | 111 | /* icst525_hz_to_vco rounds down -- so we need the next |
112 | * larger freq in case of CPUFREQ_RELATION_L. | 112 | * larger freq in case of CPUFREQ_RELATION_L. |
113 | */ | 113 | */ |
114 | if (relation == CPUFREQ_RELATION_L) | 114 | if (relation == CPUFREQ_RELATION_L) |
115 | target_freq += 999; | 115 | target_freq += 999; |
116 | if (target_freq > policy->max) | 116 | if (target_freq > policy->max) |
117 | target_freq = policy->max; | 117 | target_freq = policy->max; |
118 | vco = icst525_khz_to_vco(&cclk_params, target_freq); | 118 | vco = icst525_hz_to_vco(&cclk_params, target_freq * 1000); |
119 | freqs.new = icst525_khz(&cclk_params, vco); | 119 | freqs.new = icst525_hz(&cclk_params, vco) / 1000; |
120 | 120 | ||
121 | freqs.cpu = policy->cpu; | 121 | freqs.cpu = policy->cpu; |
122 | 122 | ||
@@ -174,7 +174,7 @@ static unsigned int integrator_get(unsigned int cpu) | |||
174 | vco.v = cm_osc & 255; | 174 | vco.v = cm_osc & 255; |
175 | vco.r = 22; | 175 | vco.r = 22; |
176 | 176 | ||
177 | current_freq = icst525_khz(&cclk_params, vco); /* current freq */ | 177 | current_freq = icst525_hz(&cclk_params, vco) / 1000; /* current freq */ |
178 | 178 | ||
179 | set_cpus_allowed(current, cpus_allowed); | 179 | set_cpus_allowed(current, cpus_allowed); |
180 | 180 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 5aca7ebea3c..ecce3eb8fe0 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -41,7 +41,7 @@ struct impd1_module { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | static const struct icst_params impd1_vco_params = { | 43 | static const struct icst_params impd1_vco_params = { |
44 | .ref = 24000, /* 24 MHz */ | 44 | .ref = 24000000, /* 24 MHz */ |
45 | .vco_max = ICST525_VCO_MAX_3V, | 45 | .vco_max = ICST525_VCO_MAX_3V, |
46 | .vd_min = 12, | 46 | .vd_min = 12, |
47 | .vd_max = 519, | 47 | .vd_max = 519, |
@@ -73,8 +73,8 @@ static void impd1_setvco(struct clk *clk, struct icst_vco vco) | |||
73 | vco.r = (val >> 9) & 0x7f; | 73 | vco.r = (val >> 9) & 0x7f; |
74 | vco.s = (val >> 16) & 7; | 74 | vco.s = (val >> 16) & 7; |
75 | 75 | ||
76 | pr_debug("IM-PD1: VCO%d clock is %ld kHz\n", | 76 | pr_debug("IM-PD1: VCO%d clock is %ld Hz\n", |
77 | vconr, icst525_khz(&impd1_vco_params, vco)); | 77 | vconr, icst525_hz(&impd1_vco_params, vco)); |
78 | #endif | 78 | #endif |
79 | } | 79 | } |
80 | 80 | ||
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 27f95106b47..335af99acb7 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) | |||
269 | #define CM_AUXOSC IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x1c) | 269 | #define CM_AUXOSC IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x1c) |
270 | 270 | ||
271 | static const struct icst_params cp_auxvco_params = { | 271 | static const struct icst_params cp_auxvco_params = { |
272 | .ref = 24000, | 272 | .ref = 24000000, |
273 | .vco_max = ICST525_VCO_MAX_5V, | 273 | .vco_max = ICST525_VCO_MAX_5V, |
274 | .vd_min = 8, | 274 | .vd_min = 8, |
275 | .vd_max = 263, | 275 | .vd_max = 263, |