aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock24xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/clock24xx.c')
-rw-r--r--arch/arm/mach-omap2/clock24xx.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index e4cef333e291..c442fe9f998a 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -233,6 +233,8 @@ static struct prcm_config *curr_prcm_set;
233static struct clk *vclk; 233static struct clk *vclk;
234static struct clk *sclk; 234static struct clk *sclk;
235 235
236static void __iomem *prcm_clksrc_ctrl;
237
236/*------------------------------------------------------------------------- 238/*-------------------------------------------------------------------------
237 * Omap24xx specific clock functions 239 * Omap24xx specific clock functions
238 *-------------------------------------------------------------------------*/ 240 *-------------------------------------------------------------------------*/
@@ -269,10 +271,9 @@ static int omap2_enable_osc_ck(struct clk *clk)
269{ 271{
270 u32 pcc; 272 u32 pcc;
271 273
272 pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 274 pcc = __raw_readl(prcm_clksrc_ctrl);
273 275
274 __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, 276 __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
275 OMAP24XX_PRCM_CLKSRC_CTRL);
276 277
277 return 0; 278 return 0;
278} 279}
@@ -281,10 +282,9 @@ static void omap2_disable_osc_ck(struct clk *clk)
281{ 282{
282 u32 pcc; 283 u32 pcc;
283 284
284 pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 285 pcc = __raw_readl(prcm_clksrc_ctrl);
285 286
286 __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, 287 __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
287 OMAP24XX_PRCM_CLKSRC_CTRL);
288} 288}
289 289
290static const struct clkops clkops_oscck = { 290static const struct clkops clkops_oscck = {
@@ -654,7 +654,7 @@ static u32 omap2_get_sysclkdiv(void)
654{ 654{
655 u32 div; 655 u32 div;
656 656
657 div = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL); 657 div = __raw_readl(prcm_clksrc_ctrl);
658 div &= OMAP_SYSCLKDIV_MASK; 658 div &= OMAP_SYSCLKDIV_MASK;
659 div >>= OMAP_SYSCLKDIV_SHIFT; 659 div >>= OMAP_SYSCLKDIV_SHIFT;
660 660
@@ -714,10 +714,13 @@ int __init omap2_clk_init(void)
714 struct omap_clk *c; 714 struct omap_clk *c;
715 u32 clkrate; 715 u32 clkrate;
716 716
717 if (cpu_is_omap242x()) 717 if (cpu_is_omap242x()) {
718 prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
718 cpu_mask = RATE_IN_242X; 719 cpu_mask = RATE_IN_242X;
719 else if (cpu_is_omap2430()) 720 } else if (cpu_is_omap2430()) {
721 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
720 cpu_mask = RATE_IN_243X; 722 cpu_mask = RATE_IN_243X;
723 }
721 724
722 clk_init(&omap2_clk_functions); 725 clk_init(&omap2_clk_functions);
723 726