diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-01-26 01:10:38 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-02-20 17:34:02 -0500 |
commit | 55bf9267dd628c9369674ca75f5b00e275529289 (patch) | |
tree | f138ba2458981f554dafc6d04798fe16b466d5f7 /arch/arm/mach-s3c64xx/clock.c | |
parent | 62acb2f82dc27cd40729e7d4c2879e57fe41b927 (diff) |
ARM: S3C64XX: Combine the clock init code
Turn the init sequence of
s3c24xx_register_baseclocks(xtal);
s3c64xx_register_clocks();
s3c6400_register_clocks(S3C6410_CLKDIV0_ARM_MASK);
into a single call as this is now contained within one file.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c64xx/clock.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/clock.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c index 9b587e267422..7f5e1aa99ce1 100644 --- a/arch/arm/mach-s3c64xx/clock.c +++ b/arch/arm/mach-s3c64xx/clock.c | |||
@@ -748,19 +748,29 @@ static struct clk *clks1[] __initdata = { | |||
748 | &clk_arm, | 748 | &clk_arm, |
749 | }; | 749 | }; |
750 | 750 | ||
751 | static struct clk *clks[] __initdata = { | ||
752 | &clk_ext, | ||
753 | &clk_epll, | ||
754 | &clk_27m, | ||
755 | &clk_48m, | ||
756 | &clk_h2, | ||
757 | }; | ||
758 | |||
751 | /** | 759 | /** |
752 | * s3c6400_register_clocks - register clocks for s3c6400 and above | 760 | * s3c64xx_register_clocks - register clocks for s3c6400 and s3c6410 |
753 | * @armclk_divlimit: Divisor mask for ARMCLK | 761 | * @xtal: The rate for the clock crystal feeding the PLLs. |
762 | * @armclk_divlimit: Divisor mask for ARMCLK. | ||
754 | * | 763 | * |
755 | * Register the clocks for the S3C6400 and above SoC range, such | 764 | * Register the clocks for the S3C6400 and S3C6410 SoC range, such |
756 | * as ARMCLK and the clocks which have divider chains attached. | 765 | * as ARMCLK as well as the necessary parent clocks. |
757 | * | 766 | * |
758 | * This call does not setup the clocks, which is left to the | 767 | * This call does not setup the clocks, which is left to the |
759 | * s3c6400_setup_clocks() call which may be needed by the cpufreq | 768 | * s3c6400_setup_clocks() call which may be needed by the cpufreq |
760 | * or resume code to re-set the clocks if the bootloader has changed | 769 | * or resume code to re-set the clocks if the bootloader has changed |
761 | * them. | 770 | * them. |
762 | */ | 771 | */ |
763 | void __init s3c6400_register_clocks(unsigned armclk_divlimit) | 772 | void __init s3c64xx_register_clocks(unsigned long xtal, |
773 | unsigned armclk_divlimit) | ||
764 | { | 774 | { |
765 | struct clk *clkp; | 775 | struct clk *clkp; |
766 | int ret; | 776 | int ret; |
@@ -768,33 +778,9 @@ void __init s3c6400_register_clocks(unsigned armclk_divlimit) | |||
768 | 778 | ||
769 | armclk_mask = armclk_divlimit; | 779 | armclk_mask = armclk_divlimit; |
770 | 780 | ||
771 | for (ptr = 0; ptr < ARRAY_SIZE(clks1); ptr++) { | 781 | s3c24xx_register_baseclocks(xtal); |
772 | clkp = clks1[ptr]; | ||
773 | ret = s3c24xx_register_clock(clkp); | ||
774 | if (ret < 0) { | ||
775 | printk(KERN_ERR "Failed to register clock %s (%d)\n", | ||
776 | clkp->name, ret); | ||
777 | } | ||
778 | } | ||
779 | |||
780 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | ||
781 | } | ||
782 | |||
783 | static struct clk *clks[] __initdata = { | ||
784 | &clk_ext, | ||
785 | &clk_epll, | ||
786 | &clk_27m, | ||
787 | &clk_48m, | ||
788 | &clk_h2, | ||
789 | }; | ||
790 | |||
791 | void __init s3c64xx_register_clocks(void) | ||
792 | { | ||
793 | struct clk *clkp; | ||
794 | int ret; | ||
795 | int ptr; | ||
796 | |||
797 | s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); | 782 | s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); |
783 | |||
798 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 784 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
799 | 785 | ||
800 | clkp = init_clocks_disable; | 786 | clkp = init_clocks_disable; |
@@ -809,5 +795,7 @@ void __init s3c64xx_register_clocks(void) | |||
809 | (clkp->enable)(clkp, 0); | 795 | (clkp->enable)(clkp, 0); |
810 | } | 796 | } |
811 | 797 | ||
798 | s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); | ||
799 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | ||
812 | s3c_pwmclk_init(); | 800 | s3c_pwmclk_init(); |
813 | } | 801 | } |