diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-12-08 19:08:35 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-15 03:10:10 -0500 |
commit | 682e2b7d45878586ce84f6993da0b8a2981a399d (patch) | |
tree | 7d64665810dd9d2783067714e49f4c51c752b57b /arch/arm | |
parent | f3e0b724cc70ef5ee2a6e0d9dfafa2328c294ab3 (diff) |
ARM: S3C64XX: Avoid announcing clksrc clocks twice
The new code calls the clock setup code on registration which
can be before the clock system has been fully initialised. The
following code re-does this setup at the end of the clock
registration and thus we get two printings.
Update the calls to only print on the last pass or when doing
the necessary resume work.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-s3c64xx/s3c6400-clock.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/clock-clksrc.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/clock-clksrc.h | 10 |
3 files changed, 22 insertions, 8 deletions
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 555d1aa6b5a..cb2bf4bff05 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c | |||
@@ -486,10 +486,10 @@ void __init_or_cpufreq s3c6400_setup_clocks(void) | |||
486 | clk_f.rate = fclk; | 486 | clk_f.rate = fclk; |
487 | 487 | ||
488 | for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) | 488 | for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) |
489 | s3c_set_clksrc(init_parents[ptr]); | 489 | s3c_set_clksrc(init_parents[ptr], true); |
490 | 490 | ||
491 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) | 491 | for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) |
492 | s3c_set_clksrc(&clksrcs[ptr]); | 492 | s3c_set_clksrc(&clksrcs[ptr], true); |
493 | } | 493 | } |
494 | 494 | ||
495 | static struct clk *clks[] __initdata = { | 495 | static struct clk *clks[] __initdata = { |
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c index ad4e8723a81..12129f8e509 100644 --- a/arch/arm/plat-samsung/clock-clksrc.c +++ b/arch/arm/plat-samsung/clock-clksrc.c | |||
@@ -125,7 +125,7 @@ static unsigned long s3c_roundrate_clksrc(struct clk *clk, | |||
125 | 125 | ||
126 | /* Clock initialisation code */ | 126 | /* Clock initialisation code */ |
127 | 127 | ||
128 | void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk) | 128 | void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk, bool announce) |
129 | { | 129 | { |
130 | struct clksrc_sources *srcs = clk->sources; | 130 | struct clksrc_sources *srcs = clk->sources; |
131 | u32 mask = bit_mask(clk->reg_src.shift, clk->reg_src.size); | 131 | u32 mask = bit_mask(clk->reg_src.shift, clk->reg_src.size); |
@@ -145,9 +145,10 @@ void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk) | |||
145 | 145 | ||
146 | clk->clk.parent = srcs->sources[clksrc]; | 146 | clk->clk.parent = srcs->sources[clksrc]; |
147 | 147 | ||
148 | printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n", | 148 | if (announce) |
149 | clk->clk.name, clk->clk.parent->name, clksrc, | 149 | printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n", |
150 | clk_get_rate(&clk->clk)); | 150 | clk->clk.name, clk->clk.parent->name, clksrc, |
151 | clk_get_rate(&clk->clk)); | ||
151 | } | 152 | } |
152 | 153 | ||
153 | static struct clk_ops clksrc_ops = { | 154 | static struct clk_ops clksrc_ops = { |
@@ -166,7 +167,12 @@ void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size) | |||
166 | if (!clksrc->clk.ops) | 167 | if (!clksrc->clk.ops) |
167 | clksrc->clk.ops = &clksrc_ops; | 168 | clksrc->clk.ops = &clksrc_ops; |
168 | 169 | ||
169 | s3c_set_clksrc(clksrc); | 170 | /* setup the clocksource, but do not announce it |
171 | * as it may be re-set by the setup routines | ||
172 | * called after the rest of the clocks have been | ||
173 | * registered | ||
174 | */ | ||
175 | s3c_set_clksrc(clksrc, false); | ||
170 | 176 | ||
171 | ret = s3c24xx_register_clock(&clksrc->clk); | 177 | ret = s3c24xx_register_clock(&clksrc->clk); |
172 | 178 | ||
diff --git a/arch/arm/plat-samsung/include/plat/clock-clksrc.h b/arch/arm/plat-samsung/include/plat/clock-clksrc.h index 283dfa02875..50a8ca7c376 100644 --- a/arch/arm/plat-samsung/include/plat/clock-clksrc.h +++ b/arch/arm/plat-samsung/include/plat/clock-clksrc.h | |||
@@ -63,7 +63,15 @@ struct clksrc_clk { | |||
63 | struct clksrc_reg reg_div; | 63 | struct clksrc_reg reg_div; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | extern void s3c_set_clksrc(struct clksrc_clk *clk); | 66 | /** |
67 | * s3c_set_clksrc() - setup the clock from the register settings | ||
68 | * @clk: The clock to setup. | ||
69 | * @announce: true to announce the setting to printk(). | ||
70 | * | ||
71 | * Setup the clock from the current register settings, for when the | ||
72 | * kernel boots or if it is resuming from a possibly unknown state. | ||
73 | */ | ||
74 | extern void s3c_set_clksrc(struct clksrc_clk *clk, bool announce); | ||
67 | 75 | ||
68 | /** | 76 | /** |
69 | * s3c_register_clksrc() register clocks from an array of clksrc clocks | 77 | * s3c_register_clksrc() register clocks from an array of clksrc clocks |