diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2010-05-06 05:47:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-06 15:17:20 -0400 |
commit | dc6048c7f97beaf8c5bb97ed772f43330d04727a (patch) | |
tree | 8a76888f2316ffd18099b132224799b571f77d9b /arch/arm/mach-nomadik | |
parent | 2210d6453b4d888c122b2b1c236f50b0a2d30bfa (diff) |
ARM: 6103/1: nomadik: define clocks statically
Add a table for clocks to be defined statically, so that new clocks can
be added without having to call nmdk_clk_create() for each of them.
Remove the now unused nmdk_clk_create() function.
Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-nomadik')
-rw-r--r-- | arch/arm/mach-nomadik/board-nhk8815.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/clock.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/clock.h | 1 |
3 files changed, 21 insertions, 18 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index ab3712c86d2b..841d459ad59d 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <mach/setup.h> | 32 | #include <mach/setup.h> |
33 | #include <mach/nand.h> | 33 | #include <mach/nand.h> |
34 | #include <mach/fsmc.h> | 34 | #include <mach/fsmc.h> |
35 | #include "clock.h" | ||
36 | 35 | ||
37 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ | 36 | /* Initial value for SRC control register: all timers use MXTAL/8 source */ |
38 | #define SRC_CR_INIT_MASK 0x00007fff | 37 | #define SRC_CR_INIT_MASK 0x00007fff |
@@ -202,11 +201,6 @@ static struct amba_device *amba_devs[] __initdata = { | |||
202 | &uart1_device, | 201 | &uart1_device, |
203 | }; | 202 | }; |
204 | 203 | ||
205 | /* We have a fixed clock alone, by now */ | ||
206 | static struct clk nhk8815_clk_48 = { | ||
207 | .rate = 48*1000*1000, | ||
208 | }; | ||
209 | |||
210 | static struct resource nhk8815_eth_resources[] = { | 204 | static struct resource nhk8815_eth_resources[] = { |
211 | { | 205 | { |
212 | .name = "smc91x-regs", | 206 | .name = "smc91x-regs", |
@@ -276,10 +270,8 @@ static void __init nhk8815_platform_init(void) | |||
276 | platform_add_devices(nhk8815_platform_devices, | 270 | platform_add_devices(nhk8815_platform_devices, |
277 | ARRAY_SIZE(nhk8815_platform_devices)); | 271 | ARRAY_SIZE(nhk8815_platform_devices)); |
278 | 272 | ||
279 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { | 273 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
280 | nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name); | ||
281 | amba_device_register(amba_devs[i], &iomem_resource); | 274 | amba_device_register(amba_devs[i], &iomem_resource); |
282 | } | ||
283 | } | 275 | } |
284 | 276 | ||
285 | MACHINE_START(NOMADIK, "NHK8815") | 277 | MACHINE_START(NOMADIK, "NHK8815") |
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c index 9f92502a0083..7af785017782 100644 --- a/arch/arm/mach-nomadik/clock.c +++ b/arch/arm/mach-nomadik/clock.c | |||
@@ -32,14 +32,26 @@ void clk_disable(struct clk *clk) | |||
32 | } | 32 | } |
33 | EXPORT_SYMBOL(clk_disable); | 33 | EXPORT_SYMBOL(clk_disable); |
34 | 34 | ||
35 | /* Create a clock structure with the given name */ | 35 | /* We have a fixed clock alone, for now */ |
36 | int nmdk_clk_create(struct clk *clk, const char *dev_id) | 36 | static struct clk clk_48 = { |
37 | { | 37 | .rate = 48 * 1000 * 1000, |
38 | struct clk_lookup *clkdev; | 38 | }; |
39 | |||
40 | #define CLK(_clk, dev) \ | ||
41 | { \ | ||
42 | .clk = _clk, \ | ||
43 | .dev_id = dev, \ | ||
44 | } | ||
45 | |||
46 | static struct clk_lookup lookups[] = { | ||
47 | CLK(&clk_48, "uart0"), | ||
48 | CLK(&clk_48, "uart1"), | ||
49 | }; | ||
39 | 50 | ||
40 | clkdev = clkdev_alloc(clk, NULL, dev_id); | 51 | static int __init clk_init(void) |
41 | if (!clkdev) | 52 | { |
42 | return -ENOMEM; | 53 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
43 | clkdev_add(clkdev); | ||
44 | return 0; | 54 | return 0; |
45 | } | 55 | } |
56 | |||
57 | arch_initcall(clk_init); | ||
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h index 235faec7f627..5563985a2cc7 100644 --- a/arch/arm/mach-nomadik/clock.h +++ b/arch/arm/mach-nomadik/clock.h | |||
@@ -11,4 +11,3 @@ | |||
11 | struct clk { | 11 | struct clk { |
12 | unsigned long rate; | 12 | unsigned long rate; |
13 | }; | 13 | }; |
14 | extern int nmdk_clk_create(struct clk *clk, const char *dev_id); | ||