aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-16 11:27:28 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 04:35:29 -0400
commit39c0cb02db5b8fdfac76d506b7a008b70bc960e9 (patch)
tree30e79dcadb5f6c26bba5fcf585cc309e240ff948 /arch/arm
parentb830b9b5b3d04bc22f0b9ded85b713f7d3c11b7f (diff)
ARM: ICST: merge common ICST VCO structures
The structures for the ICST307 and ICST525 VCO devices are identical, so merge them together. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/common/icst307.c14
-rw-r--r--arch/arm/common/icst525.c14
-rw-r--r--arch/arm/include/asm/hardware/icst.h32
-rw-r--r--arch/arm/include/asm/hardware/icst307.h21
-rw-r--r--arch/arm/include/asm/hardware/icst525.h21
-rw-r--r--arch/arm/mach-integrator/clock.c5
-rw-r--r--arch/arm/mach-integrator/cpu.c10
-rw-r--r--arch/arm/mach-integrator/impd1.c4
-rw-r--r--arch/arm/mach-integrator/include/mach/clkdev.h6
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c4
-rw-r--r--arch/arm/mach-realview/clock.c4
-rw-r--r--arch/arm/mach-realview/clock.h7
-rw-r--r--arch/arm/mach-realview/core.c4
-rw-r--r--arch/arm/mach-versatile/clock.c4
-rw-r--r--arch/arm/mach-versatile/clock.h7
-rw-r--r--arch/arm/mach-versatile/core.c4
16 files changed, 85 insertions, 76 deletions
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c
index 6d094c157540..2eebd960c01b 100644
--- a/arch/arm/common/icst307.c
+++ b/arch/arm/common/icst307.c
@@ -24,7 +24,7 @@
24 */ 24 */
25static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 }; 25static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
26 26
27unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco) 27unsigned long icst307_khz(const struct icst_params *p, struct icst_vco vco)
28{ 28{
29 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); 29 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
30} 30}
@@ -36,10 +36,10 @@ EXPORT_SYMBOL(icst307_khz);
36 */ 36 */
37static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 }; 37static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
38 38
39struct icst307_vco 39struct icst_vco
40icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq) 40icst307_khz_to_vco(const struct icst_params *p, unsigned long freq)
41{ 41{
42 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; 42 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
43 unsigned long f; 43 unsigned long f;
44 unsigned int i = 0, rd, best = (unsigned int)-1; 44 unsigned int i = 0, rd, best = (unsigned int)-1;
45 45
@@ -96,10 +96,10 @@ icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq)
96 96
97EXPORT_SYMBOL(icst307_khz_to_vco); 97EXPORT_SYMBOL(icst307_khz_to_vco);
98 98
99struct icst307_vco 99struct icst_vco
100icst307_ps_to_vco(const struct icst307_params *p, unsigned long period) 100icst307_ps_to_vco(const struct icst_params *p, unsigned long period)
101{ 101{
102 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; 102 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
103 unsigned long f, ps; 103 unsigned long f, ps;
104 unsigned int i = 0, rd, best = (unsigned int)-1; 104 unsigned int i = 0, rd, best = (unsigned int)-1;
105 105
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c
index 3d377c5bdef6..fd5c2e7ed176 100644
--- a/arch/arm/common/icst525.c
+++ b/arch/arm/common/icst525.c
@@ -21,7 +21,7 @@
21 */ 21 */
22static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 }; 22static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
23 23
24unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco) 24unsigned long icst525_khz(const struct icst_params *p, struct icst_vco vco)
25{ 25{
26 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]); 26 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
27} 27}
@@ -33,10 +33,10 @@ EXPORT_SYMBOL(icst525_khz);
33 */ 33 */
34static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 }; 34static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 };
35 35
36struct icst525_vco 36struct icst_vco
37icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq) 37icst525_khz_to_vco(const struct icst_params *p, unsigned long freq)
38{ 38{
39 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; 39 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
40 unsigned long f; 40 unsigned long f;
41 unsigned int i = 0, rd, best = (unsigned int)-1; 41 unsigned int i = 0, rd, best = (unsigned int)-1;
42 42
@@ -94,10 +94,10 @@ icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq)
94 94
95EXPORT_SYMBOL(icst525_khz_to_vco); 95EXPORT_SYMBOL(icst525_khz_to_vco);
96 96
97struct icst525_vco 97struct icst_vco
98icst525_ps_to_vco(const struct icst525_params *p, unsigned long period) 98icst525_ps_to_vco(const struct icst_params *p, unsigned long period)
99{ 99{
100 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max }; 100 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
101 unsigned long f, ps; 101 unsigned long f, ps;
102 unsigned int i = 0, rd, best = (unsigned int)-1; 102 unsigned int i = 0, rd, best = (unsigned int)-1;
103 103
diff --git a/arch/arm/include/asm/hardware/icst.h b/arch/arm/include/asm/hardware/icst.h
new file mode 100644
index 000000000000..65b1edd4452b
--- /dev/null
+++ b/arch/arm/include/asm/hardware/icst.h
@@ -0,0 +1,32 @@
1/*
2 * arch/arm/include/asm/hardware/icst.h
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 */
14#ifndef ASMARM_HARDWARE_ICST_H
15#define ASMARM_HARDWARE_ICST_H
16
17struct icst_params {
18 unsigned long ref;
19 unsigned long vco_max; /* inclusive */
20 unsigned short vd_min; /* inclusive */
21 unsigned short vd_max; /* inclusive */
22 unsigned char rd_min; /* inclusive */
23 unsigned char rd_max; /* inclusive */
24};
25
26struct icst_vco {
27 unsigned short v;
28 unsigned char r;
29 unsigned char s;
30};
31
32#endif
diff --git a/arch/arm/include/asm/hardware/icst307.h b/arch/arm/include/asm/hardware/icst307.h
index 554f128a1046..85932e902e99 100644
--- a/arch/arm/include/asm/hardware/icst307.h
+++ b/arch/arm/include/asm/hardware/icst307.h
@@ -16,23 +16,10 @@
16#ifndef ASMARM_HARDWARE_ICST307_H 16#ifndef ASMARM_HARDWARE_ICST307_H
17#define ASMARM_HARDWARE_ICST307_H 17#define ASMARM_HARDWARE_ICST307_H
18 18
19struct icst307_params { 19#include <asm/hardware/icst.h>
20 unsigned long ref;
21 unsigned long vco_max; /* inclusive */
22 unsigned short vd_min; /* inclusive */
23 unsigned short vd_max; /* inclusive */
24 unsigned char rd_min; /* inclusive */
25 unsigned char rd_max; /* inclusive */
26};
27 20
28struct icst307_vco { 21unsigned long icst307_khz(const struct icst_params *p, struct icst_vco vco);
29 unsigned short v; 22struct icst_vco icst307_khz_to_vco(const struct icst_params *p, unsigned long freq);
30 unsigned char r; 23struct icst_vco icst307_ps_to_vco(const struct icst_params *p, unsigned long period);
31 unsigned char s;
32};
33
34unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco);
35struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq);
36struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period);
37 24
38#endif 25#endif
diff --git a/arch/arm/include/asm/hardware/icst525.h b/arch/arm/include/asm/hardware/icst525.h
index 58f0dc43e2ed..170deb2b605b 100644
--- a/arch/arm/include/asm/hardware/icst525.h
+++ b/arch/arm/include/asm/hardware/icst525.h
@@ -14,23 +14,10 @@
14#ifndef ASMARM_HARDWARE_ICST525_H 14#ifndef ASMARM_HARDWARE_ICST525_H
15#define ASMARM_HARDWARE_ICST525_H 15#define ASMARM_HARDWARE_ICST525_H
16 16
17struct icst525_params { 17#include <asm/hardware/icst.h>
18 unsigned long ref;
19 unsigned long vco_max; /* inclusive */
20 unsigned short vd_min; /* inclusive */
21 unsigned short vd_max; /* inclusive */
22 unsigned char rd_min; /* inclusive */
23 unsigned char rd_max; /* inclusive */
24};
25 18
26struct icst525_vco { 19unsigned long icst525_khz(const struct icst_params *p, struct icst_vco vco);
27 unsigned short v; 20struct icst_vco icst525_khz_to_vco(const struct icst_params *p, unsigned long freq);
28 unsigned char r; 21struct icst_vco icst525_ps_to_vco(const struct icst_params *p, unsigned long period);
29 unsigned char s;
30};
31
32unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco);
33struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq);
34struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period);
35 22
36#endif 23#endif
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c
index 989ecf5f5c46..bb70b64a6563 100644
--- a/arch/arm/mach-integrator/clock.c
+++ b/arch/arm/mach-integrator/clock.c
@@ -14,6 +14,7 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16 16
17#include <asm/hardware/icst525.h>
17#include <asm/clkdev.h> 18#include <asm/clkdev.h>
18#include <mach/clkdev.h> 19#include <mach/clkdev.h>
19 20
@@ -36,7 +37,7 @@ EXPORT_SYMBOL(clk_get_rate);
36 37
37long clk_round_rate(struct clk *clk, unsigned long rate) 38long clk_round_rate(struct clk *clk, unsigned long rate)
38{ 39{
39 struct icst525_vco vco; 40 struct icst_vco vco;
40 vco = icst525_khz_to_vco(clk->params, rate / 1000); 41 vco = icst525_khz_to_vco(clk->params, rate / 1000);
41 return icst525_khz(clk->params, vco) * 1000; 42 return icst525_khz(clk->params, vco) * 1000;
42} 43}
@@ -47,7 +48,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
47 int ret = -EIO; 48 int ret = -EIO;
48 49
49 if (clk->setvco) { 50 if (clk->setvco) {
50 struct icst525_vco vco; 51 struct icst_vco vco;
51 52
52 vco = icst525_khz_to_vco(clk->params, rate / 1000); 53 vco = icst525_khz_to_vco(clk->params, rate / 1000);
53 clk->rate = icst525_khz(clk->params, vco) * 1000; 54 clk->rate = icst525_khz(clk->params, vco) * 1000;
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index 7f1b73b776a7..c4e5debeb48c 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -31,7 +31,7 @@ static struct cpufreq_driver integrator_driver;
31#define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT) 31#define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT)
32#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) 32#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK)
33 33
34static const struct icst525_params lclk_params = { 34static const struct icst_params lclk_params = {
35 .ref = 24000, 35 .ref = 24000,
36 .vco_max = 320000, 36 .vco_max = 320000,
37 .vd_min = 8, 37 .vd_min = 8,
@@ -40,7 +40,7 @@ static const struct icst525_params lclk_params = {
40 .rd_max = 24, 40 .rd_max = 24,
41}; 41};
42 42
43static const struct icst525_params cclk_params = { 43static const struct icst_params cclk_params = {
44 .ref = 24000, 44 .ref = 24000,
45 .vco_max = 320000, 45 .vco_max = 320000,
46 .vd_min = 12, 46 .vd_min = 12,
@@ -54,7 +54,7 @@ static const struct icst525_params cclk_params = {
54 */ 54 */
55static int integrator_verify_policy(struct cpufreq_policy *policy) 55static int integrator_verify_policy(struct cpufreq_policy *policy)
56{ 56{
57 struct icst525_vco vco; 57 struct icst_vco vco;
58 58
59 cpufreq_verify_within_limits(policy, 59 cpufreq_verify_within_limits(policy,
60 policy->cpuinfo.min_freq, 60 policy->cpuinfo.min_freq,
@@ -80,7 +80,7 @@ static int integrator_set_target(struct cpufreq_policy *policy,
80{ 80{
81 cpumask_t cpus_allowed; 81 cpumask_t cpus_allowed;
82 int cpu = policy->cpu; 82 int cpu = policy->cpu;
83 struct icst525_vco vco; 83 struct icst_vco vco;
84 struct cpufreq_freqs freqs; 84 struct cpufreq_freqs freqs;
85 u_int cm_osc; 85 u_int cm_osc;
86 86
@@ -156,7 +156,7 @@ static unsigned int integrator_get(unsigned int cpu)
156 cpumask_t cpus_allowed; 156 cpumask_t cpus_allowed;
157 unsigned int current_freq; 157 unsigned int current_freq;
158 u_int cm_osc; 158 u_int cm_osc;
159 struct icst525_vco vco; 159 struct icst_vco vco;
160 160
161 cpus_allowed = current->cpus_allowed; 161 cpus_allowed = current->cpus_allowed;
162 162
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 0058c937719e..dfb961b67afa 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -40,7 +40,7 @@ struct impd1_module {
40 struct clk_lookup *clks[3]; 40 struct clk_lookup *clks[3];
41}; 41};
42 42
43static const struct icst525_params impd1_vco_params = { 43static const struct icst_params impd1_vco_params = {
44 .ref = 24000, /* 24 MHz */ 44 .ref = 24000, /* 24 MHz */
45 .vco_max = 200000, /* 200 MHz */ 45 .vco_max = 200000, /* 200 MHz */
46 .vd_min = 12, 46 .vd_min = 12,
@@ -49,7 +49,7 @@ static const struct icst525_params impd1_vco_params = {
49 .rd_max = 120, 49 .rd_max = 120,
50}; 50};
51 51
52static void impd1_setvco(struct clk *clk, struct icst525_vco vco) 52static void impd1_setvco(struct clk *clk, struct icst_vco vco)
53{ 53{
54 struct impd1_module *impd1 = clk->data; 54 struct impd1_module *impd1 = clk->data;
55 int vconr = clk - impd1->vcos; 55 int vconr = clk - impd1->vcos;
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h
index 9293e410832a..89ea93803998 100644
--- a/arch/arm/mach-integrator/include/mach/clkdev.h
+++ b/arch/arm/mach-integrator/include/mach/clkdev.h
@@ -2,14 +2,14 @@
2#define __ASM_MACH_CLKDEV_H 2#define __ASM_MACH_CLKDEV_H
3 3
4#include <linux/module.h> 4#include <linux/module.h>
5#include <asm/hardware/icst525.h> 5#include <asm/hardware/icst.h>
6 6
7struct clk { 7struct clk {
8 unsigned long rate; 8 unsigned long rate;
9 struct module *owner; 9 struct module *owner;
10 const struct icst525_params *params; 10 const struct icst_params *params;
11 void *data; 11 void *data;
12 void (*setvco)(struct clk *, struct icst525_vco vco); 12 void (*setvco)(struct clk *, struct icst_vco vco);
13}; 13};
14 14
15static inline int __clk_get(struct clk *clk) 15static inline int __clk_get(struct clk *clk)
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index c0161df9d9a2..15bfbe2e1df8 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -268,7 +268,7 @@ static void __init intcp_init_irq(void)
268#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK) 268#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK)
269#define CM_AUXOSC IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x1c) 269#define CM_AUXOSC IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x1c)
270 270
271static const struct icst525_params cp_auxvco_params = { 271static const struct icst_params cp_auxvco_params = {
272 .ref = 24000, 272 .ref = 24000,
273 .vco_max = 320000, 273 .vco_max = 320000,
274 .vd_min = 8, 274 .vd_min = 8,
@@ -277,7 +277,7 @@ static const struct icst525_params cp_auxvco_params = {
277 .rd_max = 65, 277 .rd_max = 65,
278}; 278};
279 279
280static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco) 280static void cp_auxvco_set(struct clk *clk, struct icst_vco vco)
281{ 281{
282 u32 val; 282 u32 val;
283 283
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c
index a7043115de72..83646579bc45 100644
--- a/arch/arm/mach-realview/clock.c
+++ b/arch/arm/mach-realview/clock.c
@@ -41,7 +41,7 @@ EXPORT_SYMBOL(clk_get_rate);
41 41
42long clk_round_rate(struct clk *clk, unsigned long rate) 42long clk_round_rate(struct clk *clk, unsigned long rate)
43{ 43{
44 struct icst307_vco vco; 44 struct icst_vco vco;
45 vco = icst307_khz_to_vco(clk->params, rate / 1000); 45 vco = icst307_khz_to_vco(clk->params, rate / 1000);
46 return icst307_khz(clk->params, vco) * 1000; 46 return icst307_khz(clk->params, vco) * 1000;
47} 47}
@@ -52,7 +52,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
52 int ret = -EIO; 52 int ret = -EIO;
53 53
54 if (clk->setvco) { 54 if (clk->setvco) {
55 struct icst307_vco vco; 55 struct icst_vco vco;
56 56
57 vco = icst307_khz_to_vco(clk->params, rate / 1000); 57 vco = icst307_khz_to_vco(clk->params, rate / 1000);
58 clk->rate = icst307_khz(clk->params, vco) * 1000; 58 clk->rate = icst307_khz(clk->params, vco) * 1000;
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h
index ebbb0f06b600..fa64c854258d 100644
--- a/arch/arm/mach-realview/clock.h
+++ b/arch/arm/mach-realview/clock.h
@@ -8,12 +8,13 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <asm/hardware/icst.h>
12
11struct module; 13struct module;
12struct icst307_params;
13 14
14struct clk { 15struct clk {
15 unsigned long rate; 16 unsigned long rate;
16 const struct icst307_params *params; 17 const struct icst_params *params;
17 void *data; 18 void *data;
18 void (*setvco)(struct clk *, struct icst307_vco vco); 19 void (*setvco)(struct clk *, struct icst_vco vco);
19}; 20};
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 90bd4ef71b2c..ac504745fed1 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -273,7 +273,7 @@ struct mmci_platform_data realview_mmc1_plat_data = {
273/* 273/*
274 * Clock handling 274 * Clock handling
275 */ 275 */
276static const struct icst307_params realview_oscvco_params = { 276static const struct icst_params realview_oscvco_params = {
277 .ref = 24000, 277 .ref = 24000,
278 .vco_max = 200000, 278 .vco_max = 200000,
279 .vd_min = 4 + 8, 279 .vd_min = 4 + 8,
@@ -282,7 +282,7 @@ static const struct icst307_params realview_oscvco_params = {
282 .rd_max = 127 + 2, 282 .rd_max = 127 + 2,
283}; 283};
284 284
285static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) 285static void realview_oscvco_set(struct clk *clk, struct icst_vco vco)
286{ 286{
287 void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; 287 void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET;
288 void __iomem *sys_osc; 288 void __iomem *sys_osc;
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
index c50a44ea7ee6..530e16aa7ad6 100644
--- a/arch/arm/mach-versatile/clock.c
+++ b/arch/arm/mach-versatile/clock.c
@@ -42,7 +42,7 @@ EXPORT_SYMBOL(clk_get_rate);
42 42
43long clk_round_rate(struct clk *clk, unsigned long rate) 43long clk_round_rate(struct clk *clk, unsigned long rate)
44{ 44{
45 struct icst307_vco vco; 45 struct icst_vco vco;
46 vco = icst307_khz_to_vco(clk->params, rate / 1000); 46 vco = icst307_khz_to_vco(clk->params, rate / 1000);
47 return icst307_khz(clk->params, vco) * 1000; 47 return icst307_khz(clk->params, vco) * 1000;
48} 48}
@@ -53,7 +53,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
53 int ret = -EIO; 53 int ret = -EIO;
54 54
55 if (clk->setvco) { 55 if (clk->setvco) {
56 struct icst307_vco vco; 56 struct icst_vco vco;
57 57
58 vco = icst307_khz_to_vco(clk->params, rate / 1000); 58 vco = icst307_khz_to_vco(clk->params, rate / 1000);
59 clk->rate = icst307_khz(clk->params, vco) * 1000; 59 clk->rate = icst307_khz(clk->params, vco) * 1000;
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h
index 03468fdc3e58..aed7e22d102b 100644
--- a/arch/arm/mach-versatile/clock.h
+++ b/arch/arm/mach-versatile/clock.h
@@ -8,13 +8,14 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <asm/hardware/icst.h>
12
11struct module; 13struct module;
12struct icst307_params;
13 14
14struct clk { 15struct clk {
15 unsigned long rate; 16 unsigned long rate;
16 const struct icst307_params *params; 17 const struct icst_params *params;
17 u32 oscoff; 18 u32 oscoff;
18 void *data; 19 void *data;
19 void (*setvco)(struct clk *, struct icst307_vco vco); 20 void (*setvco)(struct clk *, struct icst_vco vco);
20}; 21};
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index b77bc407b77d..ded71343553f 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -379,7 +379,7 @@ static struct mmci_platform_data mmc0_plat_data = {
379/* 379/*
380 * Clock handling 380 * Clock handling
381 */ 381 */
382static const struct icst307_params versatile_oscvco_params = { 382static const struct icst_params versatile_oscvco_params = {
383 .ref = 24000, 383 .ref = 24000,
384 .vco_max = 200000, 384 .vco_max = 200000,
385 .vd_min = 4 + 8, 385 .vd_min = 4 + 8,
@@ -388,7 +388,7 @@ static const struct icst307_params versatile_oscvco_params = {
388 .rd_max = 127 + 2, 388 .rd_max = 127 + 2,
389}; 389};
390 390
391static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) 391static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco)
392{ 392{
393 void __iomem *sys = __io_address(VERSATILE_SYS_BASE); 393 void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
394 void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET; 394 void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET;