diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-11-08 15:08:08 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-11-27 07:38:22 -0500 |
commit | d72fbdf01fc77628c0b837d0dd2fd564fa26ede6 (patch) | |
tree | 5ea1ba4f2771cfaf454621f8a2f6bdd616aa8e88 /arch/arm/mach-integrator/impd1.c | |
parent | cf30fb4a4f2d261a6527a654a7fdc8636f1e5b16 (diff) |
[ARM] integrator: convert to clkdev and lookup clocks by device name
People often point to the Integrator/Versatile/Realview
implementations to justify using the consumer name as the sole
selector for clocks.
Eliminate this excuse by changing the Integrator implementation, so
it provides a better example of how it should be done.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator/impd1.c')
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 172299a78302..0058c937719e 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -22,13 +22,13 @@ | |||
22 | #include <linux/amba/clcd.h> | 22 | #include <linux/amba/clcd.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <asm/clkdev.h> | ||
26 | #include <mach/clkdev.h> | ||
25 | #include <asm/hardware/icst525.h> | 27 | #include <asm/hardware/icst525.h> |
26 | #include <mach/lm.h> | 28 | #include <mach/lm.h> |
27 | #include <mach/impd1.h> | 29 | #include <mach/impd1.h> |
28 | #include <asm/sizes.h> | 30 | #include <asm/sizes.h> |
29 | 31 | ||
30 | #include "clock.h" | ||
31 | |||
32 | static int module_id; | 32 | static int module_id; |
33 | 33 | ||
34 | module_param_named(lmid, module_id, int, 0444); | 34 | module_param_named(lmid, module_id, int, 0444); |
@@ -37,6 +37,7 @@ MODULE_PARM_DESC(lmid, "logic module stack position"); | |||
37 | struct impd1_module { | 37 | struct impd1_module { |
38 | void __iomem *base; | 38 | void __iomem *base; |
39 | struct clk vcos[2]; | 39 | struct clk vcos[2]; |
40 | struct clk_lookup *clks[3]; | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | static const struct icst525_params impd1_vco_params = { | 43 | static const struct icst525_params impd1_vco_params = { |
@@ -339,9 +340,8 @@ static struct impd1_device impd1_devs[] = { | |||
339 | } | 340 | } |
340 | }; | 341 | }; |
341 | 342 | ||
342 | static const char *impd1_vconames[2] = { | 343 | static struct clk fixed_14745600 = { |
343 | "CLCDCLK", | 344 | .rate = 14745600, |
344 | "AUXVCO2", | ||
345 | }; | 345 | }; |
346 | 346 | ||
347 | static int impd1_probe(struct lm_device *dev) | 347 | static int impd1_probe(struct lm_device *dev) |
@@ -374,14 +374,20 @@ static int impd1_probe(struct lm_device *dev) | |||
374 | 374 | ||
375 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { | 375 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { |
376 | impd1->vcos[i].owner = THIS_MODULE, | 376 | impd1->vcos[i].owner = THIS_MODULE, |
377 | impd1->vcos[i].name = impd1_vconames[i], | ||
378 | impd1->vcos[i].params = &impd1_vco_params, | 377 | impd1->vcos[i].params = &impd1_vco_params, |
379 | impd1->vcos[i].data = impd1, | 378 | impd1->vcos[i].data = impd1, |
380 | impd1->vcos[i].setvco = impd1_setvco; | 379 | impd1->vcos[i].setvco = impd1_setvco; |
381 | |||
382 | clk_register(&impd1->vcos[i]); | ||
383 | } | 380 | } |
384 | 381 | ||
382 | impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", | ||
383 | dev->id); | ||
384 | impd1->clks[1] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00100", | ||
385 | dev->id); | ||
386 | impd1->clks[2] = clkdev_alloc(&fixed_14745600, NULL, "lm%x:00200", | ||
387 | dev->id); | ||
388 | for (i = 0; i < ARRAY_SIZE(impd1->clks); i++) | ||
389 | clkdev_add(impd1->clks[i]); | ||
390 | |||
385 | for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { | 391 | for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { |
386 | struct impd1_device *idev = impd1_devs + i; | 392 | struct impd1_device *idev = impd1_devs + i; |
387 | struct amba_device *d; | 393 | struct amba_device *d; |
@@ -434,8 +440,8 @@ static void impd1_remove(struct lm_device *dev) | |||
434 | 440 | ||
435 | device_for_each_child(&dev->dev, NULL, impd1_remove_one); | 441 | device_for_each_child(&dev->dev, NULL, impd1_remove_one); |
436 | 442 | ||
437 | for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) | 443 | for (i = 0; i < ARRAY_SIZE(impd1->clks); i++) |
438 | clk_unregister(&impd1->vcos[i]); | 444 | clkdev_drop(impd1->clks[i]); |
439 | 445 | ||
440 | lm_set_drvdata(dev, NULL); | 446 | lm_set_drvdata(dev, NULL); |
441 | 447 | ||