aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-03-01 11:18:39 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 04:35:38 -0400
commit9bf5b2ef673237e0e43161c56f70ac8bf24e43f9 (patch)
tree6b75855102d54da6ff6d7023ae00e25610e44f92 /arch/arm/mach-integrator
parent3081e43b97cb50a80ebd98ce4b60e4853ad38424 (diff)
ARM: Indirect round/set_rate operations through clk structure
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/impd1.c10
-rw-r--r--arch/arm/mach-integrator/include/mach/clkdev.h4
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c8
3 files changed, 17 insertions, 5 deletions
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 2f9de622d1fa..1a0ee93e4519 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -71,6 +71,12 @@ static void impd1_setvco(struct clk *clk, struct icst_vco vco)
71#endif 71#endif
72} 72}
73 73
74static const struct clk_ops impd1_clk_ops = {
75 .round = icst_clk_round,
76 .set = icst_clk_set,
77 .setvco = impd1_setvco,
78};
79
74void impd1_tweak_control(struct device *dev, u32 mask, u32 val) 80void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
75{ 81{
76 struct impd1_module *impd1 = dev_get_drvdata(dev); 82 struct impd1_module *impd1 = dev_get_drvdata(dev);
@@ -366,10 +372,10 @@ static int impd1_probe(struct lm_device *dev)
366 (unsigned long)dev->resource.start); 372 (unsigned long)dev->resource.start);
367 373
368 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { 374 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
375 impd1->vcos[i].ops = &impd1_clk_ops,
369 impd1->vcos[i].owner = THIS_MODULE, 376 impd1->vcos[i].owner = THIS_MODULE,
370 impd1->vcos[i].params = &impd1_vco_params, 377 impd1->vcos[i].params = &impd1_vco_params,
371 impd1->vcos[i].data = impd1, 378 impd1->vcos[i].data = impd1;
372 impd1->vcos[i].setvco = impd1_setvco;
373 } 379 }
374 impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1; 380 impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1;
375 impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2; 381 impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2;
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h
index ed67e8edc0d1..bfe07679faec 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/icst.h> 5#include <plat/clock.h>
6 6
7struct clk { 7struct clk {
8 unsigned long rate; 8 unsigned long rate;
9 const struct clk_ops *ops;
9 struct module *owner; 10 struct module *owner;
10 const struct icst_params *params; 11 const struct icst_params *params;
11 void __iomem *vcoreg; 12 void __iomem *vcoreg;
12 void (*setvco)(struct clk *, struct icst_vco vco);
13 void *data; 13 void *data;
14}; 14};
15 15
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 590858004ef6..54edb6b8504f 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -293,10 +293,16 @@ static void cp_auxvco_set(struct clk *clk, struct icst_vco vco)
293 writel(0, CM_LOCK); 293 writel(0, CM_LOCK);
294} 294}
295 295
296static const struct clk_ops cp_auxclk_ops = {
297 .round = icst_clk_round,
298 .set = icst_clk_set,
299 .setvco = cp_auxvco_set,
300};
301
296static struct clk cp_auxclk = { 302static struct clk cp_auxclk = {
303 .ops = &cp_auxclk_ops,
297 .params = &cp_auxvco_params, 304 .params = &cp_auxvco_params,
298 .vcoreg = CM_AUXOSC, 305 .vcoreg = CM_AUXOSC,
299 .setvco = cp_auxvco_set,
300}; 306};
301 307
302static struct clk_lookup cp_lookups[] = { 308static struct clk_lookup cp_lookups[] = {