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.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 8ecd1751a3d8..e60d1c094a04 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -42,7 +42,8 @@
42#include "cm-regbits-24xx.h" 42#include "cm-regbits-24xx.h"
43 43
44static const struct clkops clkops_oscck; 44static const struct clkops clkops_oscck;
45static const struct clkops clkops_fixed; 45static const struct clkops clkops_apll96;
46static const struct clkops clkops_apll54;
46 47
47static void omap2430_clk_i2chs_find_idlest(struct clk *clk, 48static void omap2430_clk_i2chs_find_idlest(struct clk *clk,
48 void __iomem **idlest_reg, 49 void __iomem **idlest_reg,
@@ -338,7 +339,7 @@ static void omap2_sys_clk_recalc(struct clk * clk)
338#endif /* OLD_CK */ 339#endif /* OLD_CK */
339 340
340/* Enable an APLL if off */ 341/* Enable an APLL if off */
341static int omap2_clk_fixed_enable(struct clk *clk) 342static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
342{ 343{
343 u32 cval, apll_mask; 344 u32 cval, apll_mask;
344 345
@@ -353,12 +354,7 @@ static int omap2_clk_fixed_enable(struct clk *clk)
353 cval |= apll_mask; 354 cval |= apll_mask;
354 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 355 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
355 356
356 if (clk == &apll96_ck) 357 omap2_cm_wait_idlest(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), status_mask,
357 cval = OMAP24XX_ST_96M_APLL;
358 else if (clk == &apll54_ck)
359 cval = OMAP24XX_ST_54M_APLL;
360
361 omap2_cm_wait_idlest(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), cval,
362 clk->name); 358 clk->name);
363 359
364 /* 360 /*
@@ -368,8 +364,18 @@ static int omap2_clk_fixed_enable(struct clk *clk)
368 return 0; 364 return 0;
369} 365}
370 366
367static int omap2_clk_apll96_enable(struct clk *clk)
368{
369 return omap2_clk_apll_enable(clk, OMAP24XX_ST_96M_APLL);
370}
371
372static int omap2_clk_apll54_enable(struct clk *clk)
373{
374 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL);
375}
376
371/* Stop APLL */ 377/* Stop APLL */
372static void omap2_clk_fixed_disable(struct clk *clk) 378static void omap2_clk_apll_disable(struct clk *clk)
373{ 379{
374 u32 cval; 380 u32 cval;
375 381
@@ -378,9 +384,14 @@ static void omap2_clk_fixed_disable(struct clk *clk)
378 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 384 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
379} 385}
380 386
381static const struct clkops clkops_fixed = { 387static const struct clkops clkops_apll96 = {
382 .enable = &omap2_clk_fixed_enable, 388 .enable = &omap2_clk_apll96_enable,
383 .disable = &omap2_clk_fixed_disable, 389 .disable = &omap2_clk_apll_disable,
390};
391
392static const struct clkops clkops_apll54 = {
393 .enable = &omap2_clk_apll54_enable,
394 .disable = &omap2_clk_apll_disable,
384}; 395};
385 396
386/* 397/*