diff options
author | Thomas Abraham <thomas.ab@samsung.com> | 2010-05-16 20:38:42 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-16 21:37:36 -0400 |
commit | 6ed91a202b3843d2fec51f00c31e65313ca00906 (patch) | |
tree | 7a999d4e9a0b28cf66fa6f1504f36adcd0a6f82b /arch/arm/mach-s5pv210 | |
parent | acfa245fc7777bc1935c70a8951ff699952921c5 (diff) |
ARM: S5PV210: Remove usage of clk_p100 and add clk_pclk_msys clock
The clk_p100 clock, which is the PCLK clock for MSYS domain, is of
type 'struct clk' whereas on S5PV210, this clock is suitable to be
of type clksrc_clk clock (since it has a choice of clock source
and a pre-divider). So this patch replaces the 'struct clk' type
clock to 'struct clksrc_clk' type clock for the PCLK MSYS clock.
This patch modifies the following.
1. Remove definitions and usage of 'clk_p100' clock.
2. Adds 'clk_pclk_msys' clock which is of type 'struct clksrc_clk'.
3. Replace all usage of clk_p100 with clk_pclk_msys clock.
4. Adds clk_pclk_msys into list of clocks to be registered.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r-- | arch/arm/mach-s5pv210/clock.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 7ed1d4e8ae0e..4791642f3e6e 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -87,6 +87,15 @@ static struct clksrc_clk clk_hclk_msys = { | |||
87 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 8, .size = 3 }, | 87 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 8, .size = 3 }, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static struct clksrc_clk clk_pclk_msys = { | ||
91 | .clk = { | ||
92 | .name = "pclk_msys", | ||
93 | .id = -1, | ||
94 | .parent = &clk_hclk_msys.clk, | ||
95 | }, | ||
96 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 12, .size = 3 }, | ||
97 | }; | ||
98 | |||
90 | static struct clksrc_clk clk_sclk_a2m = { | 99 | static struct clksrc_clk clk_sclk_a2m = { |
91 | .clk = { | 100 | .clk = { |
92 | .name = "sclk_a2m", | 101 | .name = "sclk_a2m", |
@@ -151,11 +160,6 @@ static struct clk clk_h100 = { | |||
151 | .id = -1, | 160 | .id = -1, |
152 | }; | 161 | }; |
153 | 162 | ||
154 | static struct clk clk_p100 = { | ||
155 | .name = "pclk100", | ||
156 | .id = -1, | ||
157 | }; | ||
158 | |||
159 | static struct clk clk_p83 = { | 163 | static struct clk clk_p83 = { |
160 | .name = "pclk83", | 164 | .name = "pclk83", |
161 | .id = -1, | 165 | .id = -1, |
@@ -168,7 +172,6 @@ static struct clk clk_p66 = { | |||
168 | 172 | ||
169 | static struct clk *sys_clks[] = { | 173 | static struct clk *sys_clks[] = { |
170 | &clk_h100, | 174 | &clk_h100, |
171 | &clk_p100, | ||
172 | &clk_p83, | 175 | &clk_p83, |
173 | &clk_p66 | 176 | &clk_p66 |
174 | }; | 177 | }; |
@@ -383,6 +386,7 @@ static struct clksrc_clk *sysclks[] = { | |||
383 | &clk_sclk_a2m, | 386 | &clk_sclk_a2m, |
384 | &clk_hclk_dsys, | 387 | &clk_hclk_dsys, |
385 | &clk_hclk_psys, | 388 | &clk_hclk_psys, |
389 | &clk_pclk_msys, | ||
386 | }; | 390 | }; |
387 | 391 | ||
388 | #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) | 392 | #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) |
@@ -395,7 +399,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) | |||
395 | unsigned long hclk_msys; | 399 | unsigned long hclk_msys; |
396 | unsigned long hclk_dsys; | 400 | unsigned long hclk_dsys; |
397 | unsigned long hclk_psys; | 401 | unsigned long hclk_psys; |
398 | unsigned long pclk100; | 402 | unsigned long pclk_msys; |
399 | unsigned long pclk83; | 403 | unsigned long pclk83; |
400 | unsigned long pclk66; | 404 | unsigned long pclk66; |
401 | unsigned long apll; | 405 | unsigned long apll; |
@@ -435,15 +439,14 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) | |||
435 | hclk_msys = clk_get_rate(&clk_hclk_msys.clk); | 439 | hclk_msys = clk_get_rate(&clk_hclk_msys.clk); |
436 | hclk_dsys = clk_get_rate(&clk_hclk_dsys.clk); | 440 | hclk_dsys = clk_get_rate(&clk_hclk_dsys.clk); |
437 | hclk_psys = clk_get_rate(&clk_hclk_psys.clk); | 441 | hclk_psys = clk_get_rate(&clk_hclk_psys.clk); |
438 | 442 | pclk_msys = clk_get_rate(&clk_pclk_msys.clk); | |
439 | pclk100 = hclk_msys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK100); | ||
440 | pclk83 = hclk_dsys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK83); | 443 | pclk83 = hclk_dsys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK83); |
441 | pclk66 = hclk_psys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66); | 444 | pclk66 = hclk_psys / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66); |
442 | 445 | ||
443 | printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld\n" | 446 | printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld\n" |
444 | "HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n", | 447 | "HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n", |
445 | armclk, hclk_msys, hclk_dsys, hclk_psys, | 448 | armclk, hclk_msys, hclk_dsys, hclk_psys, |
446 | pclk100, pclk83, pclk66); | 449 | pclk_msys, pclk83, pclk66); |
447 | 450 | ||
448 | clk_f.rate = armclk; | 451 | clk_f.rate = armclk; |
449 | clk_h.rate = hclk_psys; | 452 | clk_h.rate = hclk_psys; |