diff options
author | Magnus Damm <damm@opensource.se> | 2010-05-11 05:35:11 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-13 04:36:02 -0400 |
commit | 53041f020b31dd83aa4d0bdc78015bee58b1afe8 (patch) | |
tree | b7237fbe12d5ef30671d5d2211cc0865798b03c1 /arch/sh/kernel/cpu | |
parent | 914ebf0bbb24696cd7eecee8942efecca5653126 (diff) |
sh: switch legacy clocks to clkdev
This patch converts the legacy clocks to register
using clkdev. Also the clock name is removed.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu')
-rw-r--r-- | arch/sh/kernel/cpu/clock-cpg.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index 0b165f6ae08c..69c6472cdf58 100644 --- a/arch/sh/kernel/cpu/clock-cpg.c +++ b/arch/sh/kernel/cpu/clock-cpg.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <linux/slab.h> | 3 | #include <linux/slab.h> |
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | #include <asm/clkdev.h> | ||
5 | #include <asm/clock.h> | 6 | #include <asm/clock.h> |
6 | 7 | ||
7 | static int sh_clk_mstp32_enable(struct clk *clk) | 8 | static int sh_clk_mstp32_enable(struct clk *clk) |
@@ -299,25 +300,21 @@ int __init sh_clk_div4_reparent_register(struct clk *clks, int nr, | |||
299 | 300 | ||
300 | #ifdef CONFIG_SH_CLK_CPG_LEGACY | 301 | #ifdef CONFIG_SH_CLK_CPG_LEGACY |
301 | static struct clk master_clk = { | 302 | static struct clk master_clk = { |
302 | .name = "master_clk", | ||
303 | .flags = CLK_ENABLE_ON_INIT, | 303 | .flags = CLK_ENABLE_ON_INIT, |
304 | .rate = CONFIG_SH_PCLK_FREQ, | 304 | .rate = CONFIG_SH_PCLK_FREQ, |
305 | }; | 305 | }; |
306 | 306 | ||
307 | static struct clk peripheral_clk = { | 307 | static struct clk peripheral_clk = { |
308 | .name = "peripheral_clk", | ||
309 | .parent = &master_clk, | 308 | .parent = &master_clk, |
310 | .flags = CLK_ENABLE_ON_INIT, | 309 | .flags = CLK_ENABLE_ON_INIT, |
311 | }; | 310 | }; |
312 | 311 | ||
313 | static struct clk bus_clk = { | 312 | static struct clk bus_clk = { |
314 | .name = "bus_clk", | ||
315 | .parent = &master_clk, | 313 | .parent = &master_clk, |
316 | .flags = CLK_ENABLE_ON_INIT, | 314 | .flags = CLK_ENABLE_ON_INIT, |
317 | }; | 315 | }; |
318 | 316 | ||
319 | static struct clk cpu_clk = { | 317 | static struct clk cpu_clk = { |
320 | .name = "cpu_clk", | ||
321 | .parent = &master_clk, | 318 | .parent = &master_clk, |
322 | .flags = CLK_ENABLE_ON_INIT, | 319 | .flags = CLK_ENABLE_ON_INIT, |
323 | }; | 320 | }; |
@@ -332,6 +329,16 @@ static struct clk *onchip_clocks[] = { | |||
332 | &cpu_clk, | 329 | &cpu_clk, |
333 | }; | 330 | }; |
334 | 331 | ||
332 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } | ||
333 | |||
334 | static struct clk_lookup lookups[] = { | ||
335 | /* main clocks */ | ||
336 | CLKDEV_CON_ID("master_clk", &master_clk), | ||
337 | CLKDEV_CON_ID("peripheral_clk", &peripheral_clk), | ||
338 | CLKDEV_CON_ID("bus_clk", &bus_clk), | ||
339 | CLKDEV_CON_ID("cpu_clk", &cpu_clk), | ||
340 | }; | ||
341 | |||
335 | int __init __deprecated cpg_clk_init(void) | 342 | int __init __deprecated cpg_clk_init(void) |
336 | { | 343 | { |
337 | int i, ret = 0; | 344 | int i, ret = 0; |
@@ -343,6 +350,8 @@ int __init __deprecated cpg_clk_init(void) | |||
343 | ret |= clk_register(clk); | 350 | ret |= clk_register(clk); |
344 | } | 351 | } |
345 | 352 | ||
353 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
354 | |||
346 | clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); | 355 | clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); |
347 | clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); | 356 | clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); |
348 | clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); | 357 | clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); |