aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s5p
diff options
context:
space:
mode:
authorSeungwhan Youn <sw.youn@samsung.com>2010-10-13 21:39:08 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-25 03:05:56 -0400
commitd4b34c6c849d67b7afaa90d55dc7fab981c72950 (patch)
treec6b5c6bfe622832865a98fecec1159cb350bc18a /arch/arm/plat-s5p
parent900fa0196c564895bfa2eb412d2a83421d3f3444 (diff)
ARM: S5P: Reduce duplicated EPLL control codes
S5P Samsung SoCs has a EPLL to support various PLL clock sources for other H/W blocks. Until now, to control EPLL, each of SoCs make their own functions in 'mach-s5pxxx/clock.c'. But some of functions, 'xxx_epll_get_rate()' and 'xxx_epll_enable()', are exactly same in all S5P SoCs, so this patch move these duplicated codes to common EPLL functions that use platform wide. Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> Acked-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r--arch/arm/plat-s5p/clock.c20
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p-clock.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
index 818800962694..8d081d968c58 100644
--- a/arch/arm/plat-s5p/clock.c
+++ b/arch/arm/plat-s5p/clock.c
@@ -21,6 +21,8 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
24#include <mach/regs-clock.h>
25
24#include <plat/clock.h> 26#include <plat/clock.h>
25#include <plat/clock-clksrc.h> 27#include <plat/clock-clksrc.h>
26#include <plat/s5p-clock.h> 28#include <plat/s5p-clock.h>
@@ -148,6 +150,24 @@ int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable)
148 return 0; 150 return 0;
149} 151}
150 152
153int s5p_epll_enable(struct clk *clk, int enable)
154{
155 unsigned int ctrlbit = clk->ctrlbit;
156 unsigned int epll_con = __raw_readl(S5P_EPLL_CON) & ~ctrlbit;
157
158 if (enable)
159 __raw_writel(epll_con | ctrlbit, S5P_EPLL_CON);
160 else
161 __raw_writel(epll_con, S5P_EPLL_CON);
162
163 return 0;
164}
165
166unsigned long s5p_epll_get_rate(struct clk *clk)
167{
168 return clk->rate;
169}
170
151static struct clk *s5p_clks[] __initdata = { 171static struct clk *s5p_clks[] __initdata = {
152 &clk_ext_xtal_mux, 172 &clk_ext_xtal_mux,
153 &clk_48m, 173 &clk_48m,
diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-s5p/include/plat/s5p-clock.h
index 17036c898409..2b6dcff8ab2b 100644
--- a/arch/arm/plat-s5p/include/plat/s5p-clock.h
+++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h
@@ -43,4 +43,8 @@ extern struct clksrc_sources clk_src_dpll;
43 43
44extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable); 44extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable);
45 45
46/* Common EPLL operations for S5P platform */
47extern int s5p_epll_enable(struct clk *clk, int enable);
48extern unsigned long s5p_epll_get_rate(struct clk *clk);
49
46#endif /* __ASM_PLAT_S5P_CLOCK_H */ 50#endif /* __ASM_PLAT_S5P_CLOCK_H */