diff options
author | Thomas Abraham <thomas.ab@samsung.com> | 2010-05-12 20:27:09 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-12 21:42:46 -0400 |
commit | e4f44f82691e927a2f5eb582793454e052b920c7 (patch) | |
tree | 4ce5d7ec1cb887da2d7429b52512b603a06dfa22 /arch/arm/mach-s5p6440 | |
parent | 9c72d016e2b556e7d8f739b21404f32333fbc5e4 (diff) |
ARM: S5P6440: Remove usage of clk_h and add clk_hclk clock
The clk_h clock is of type 'struct clk' whereas on S5P6440,
the hclk is more suitable to be of type 'struct clksrc_clk'
(since hclk clock is divided version of armclk)
This patch modifies the following.
1. Adds the 'clk_hclk' clock which is of type 'struct clksrc_clk'.
2. Removes all references to the clk_h clock.
3. Addes clk_hclk into the list of sysclks.
4. The clock rate 'hclk' is modified to be derived from clk_hclk.
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-s5p6440')
-rw-r--r-- | arch/arm/mach-s5p6440/clock.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-s5p6440/clock.c b/arch/arm/mach-s5p6440/clock.c index 2c6dd544ff62..bc0458e6d420 100644 --- a/arch/arm/mach-s5p6440/clock.c +++ b/arch/arm/mach-s5p6440/clock.c | |||
@@ -266,6 +266,15 @@ static struct clksrc_clk clk_dout_mpll = { | |||
266 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 4, .size = 1 }, | 266 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 4, .size = 1 }, |
267 | }; | 267 | }; |
268 | 268 | ||
269 | static struct clksrc_clk clk_hclk = { | ||
270 | .clk = { | ||
271 | .name = "clk_hclk", | ||
272 | .id = -1, | ||
273 | .parent = &clk_armclk.clk, | ||
274 | }, | ||
275 | .reg_div = { .reg = S5P_CLK_DIV0, .shift = 8, .size = 4 }, | ||
276 | }; | ||
277 | |||
269 | int s5p6440_clk48m_ctrl(struct clk *clk, int enable) | 278 | int s5p6440_clk48m_ctrl(struct clk *clk, int enable) |
270 | { | 279 | { |
271 | unsigned long flags; | 280 | unsigned long flags; |
@@ -321,7 +330,7 @@ static struct clk init_clocks_disable[] = { | |||
321 | { | 330 | { |
322 | .name = "nand", | 331 | .name = "nand", |
323 | .id = -1, | 332 | .id = -1, |
324 | .parent = &clk_h, | 333 | .parent = &clk_hclk.clk, |
325 | .enable = s5p6440_mem_ctrl, | 334 | .enable = s5p6440_mem_ctrl, |
326 | .ctrlbit = S5P_CLKCON_MEM0_HCLK_NFCON, | 335 | .ctrlbit = S5P_CLKCON_MEM0_HCLK_NFCON, |
327 | }, { | 336 | }, { |
@@ -580,6 +589,7 @@ static struct clksrc_clk *sysclks[] = { | |||
580 | &clk_mout_mpll, | 589 | &clk_mout_mpll, |
581 | &clk_dout_mpll, | 590 | &clk_dout_mpll, |
582 | &clk_armclk, | 591 | &clk_armclk, |
592 | &clk_hclk, | ||
583 | }; | 593 | }; |
584 | 594 | ||
585 | void __init_or_cpufreq s5p6440_setup_clocks(void) | 595 | void __init_or_cpufreq s5p6440_setup_clocks(void) |
@@ -628,7 +638,7 @@ void __init_or_cpufreq s5p6440_setup_clocks(void) | |||
628 | print_mhz(apll), print_mhz(mpll), print_mhz(epll)); | 638 | print_mhz(apll), print_mhz(mpll), print_mhz(epll)); |
629 | 639 | ||
630 | fclk = clk_get_rate(&clk_armclk.clk); | 640 | fclk = clk_get_rate(&clk_armclk.clk); |
631 | hclk = fclk / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK); | 641 | hclk = clk_get_rate(&clk_hclk.clk); |
632 | pclk = hclk / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK); | 642 | pclk = hclk / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK); |
633 | 643 | ||
634 | if (__raw_readl(S5P_OTHERS) & S5P_OTHERS_HCLK_LOW_SEL_MPLL) { | 644 | if (__raw_readl(S5P_OTHERS) & S5P_OTHERS_HCLK_LOW_SEL_MPLL) { |