diff options
Diffstat (limited to 'arch/arm/mach-omap2/dpll3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index fc56745676fa..f0f10beeffe8 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -142,7 +142,8 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) | |||
142 | 142 | ||
143 | ai = omap3_dpll_autoidle_read(clk); | 143 | ai = omap3_dpll_autoidle_read(clk); |
144 | 144 | ||
145 | omap3_dpll_deny_idle(clk); | 145 | if (ai) |
146 | omap3_dpll_deny_idle(clk); | ||
146 | 147 | ||
147 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); | 148 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); |
148 | 149 | ||
@@ -186,8 +187,6 @@ static int _omap3_noncore_dpll_bypass(struct clk *clk) | |||
186 | 187 | ||
187 | if (ai) | 188 | if (ai) |
188 | omap3_dpll_allow_idle(clk); | 189 | omap3_dpll_allow_idle(clk); |
189 | else | ||
190 | omap3_dpll_deny_idle(clk); | ||
191 | 190 | ||
192 | return r; | 191 | return r; |
193 | } | 192 | } |
@@ -216,8 +215,6 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) | |||
216 | 215 | ||
217 | if (ai) | 216 | if (ai) |
218 | omap3_dpll_allow_idle(clk); | 217 | omap3_dpll_allow_idle(clk); |
219 | else | ||
220 | omap3_dpll_deny_idle(clk); | ||
221 | 218 | ||
222 | return 0; | 219 | return 0; |
223 | } | 220 | } |
@@ -519,6 +516,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk) | |||
519 | 516 | ||
520 | dd = clk->dpll_data; | 517 | dd = clk->dpll_data; |
521 | 518 | ||
519 | if (!dd->autoidle_reg) | ||
520 | return -EINVAL; | ||
521 | |||
522 | v = __raw_readl(dd->autoidle_reg); | 522 | v = __raw_readl(dd->autoidle_reg); |
523 | v &= dd->autoidle_mask; | 523 | v &= dd->autoidle_mask; |
524 | v >>= __ffs(dd->autoidle_mask); | 524 | v >>= __ffs(dd->autoidle_mask); |
@@ -545,6 +545,12 @@ void omap3_dpll_allow_idle(struct clk *clk) | |||
545 | 545 | ||
546 | dd = clk->dpll_data; | 546 | dd = clk->dpll_data; |
547 | 547 | ||
548 | if (!dd->autoidle_reg) { | ||
549 | pr_debug("clock: DPLL %s: autoidle not supported\n", | ||
550 | clk->name); | ||
551 | return; | ||
552 | } | ||
553 | |||
548 | /* | 554 | /* |
549 | * REVISIT: CORE DPLL can optionally enter low-power bypass | 555 | * REVISIT: CORE DPLL can optionally enter low-power bypass |
550 | * by writing 0x5 instead of 0x1. Add some mechanism to | 556 | * by writing 0x5 instead of 0x1. Add some mechanism to |
@@ -554,6 +560,7 @@ void omap3_dpll_allow_idle(struct clk *clk) | |||
554 | v &= ~dd->autoidle_mask; | 560 | v &= ~dd->autoidle_mask; |
555 | v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask); | 561 | v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask); |
556 | __raw_writel(v, dd->autoidle_reg); | 562 | __raw_writel(v, dd->autoidle_reg); |
563 | |||
557 | } | 564 | } |
558 | 565 | ||
559 | /** | 566 | /** |
@@ -572,6 +579,12 @@ void omap3_dpll_deny_idle(struct clk *clk) | |||
572 | 579 | ||
573 | dd = clk->dpll_data; | 580 | dd = clk->dpll_data; |
574 | 581 | ||
582 | if (!dd->autoidle_reg) { | ||
583 | pr_debug("clock: DPLL %s: autoidle not supported\n", | ||
584 | clk->name); | ||
585 | return; | ||
586 | } | ||
587 | |||
575 | v = __raw_readl(dd->autoidle_reg); | 588 | v = __raw_readl(dd->autoidle_reg); |
576 | v &= ~dd->autoidle_mask; | 589 | v &= ~dd->autoidle_mask; |
577 | v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask); | 590 | v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask); |