diff options
author | Rajendra Nayak <rnayak@ti.com> | 2009-12-08 20:47:17 -0500 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-12-11 19:00:47 -0500 |
commit | 911bd7395c4aa4e74b13aab790ca1500c59fae02 (patch) | |
tree | 6fdca6b205015558663dcfa523f87d6c6ffa7afa /arch/arm/mach-omap2/clock.c | |
parent | 16975a79c8e6ee424331f52649f2351d33c7b972 (diff) |
ARM: OMAP4: PM: Add init api for DPLL nodes
An api at init for all dpll nodes seem to be
needed to reparent the dpll clk node to its
bypass clk in case the dpll is in bypass.
If not done this causes sequencing issues at init
during propogate_rate.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 61ee23596ea8..759c72a48f7f 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -70,9 +70,41 @@ | |||
70 | u8 cpu_mask; | 70 | u8 cpu_mask; |
71 | 71 | ||
72 | /*------------------------------------------------------------------------- | 72 | /*------------------------------------------------------------------------- |
73 | * OMAP2/3 specific clock functions | 73 | * OMAP2/3/4 specific clock functions |
74 | *-------------------------------------------------------------------------*/ | 74 | *-------------------------------------------------------------------------*/ |
75 | 75 | ||
76 | void omap2_init_dpll_parent(struct clk *clk) | ||
77 | { | ||
78 | u32 v; | ||
79 | struct dpll_data *dd; | ||
80 | |||
81 | dd = clk->dpll_data; | ||
82 | if (!dd) | ||
83 | return; | ||
84 | |||
85 | /* Return bypass rate if DPLL is bypassed */ | ||
86 | v = __raw_readl(dd->control_reg); | ||
87 | v &= dd->enable_mask; | ||
88 | v >>= __ffs(dd->enable_mask); | ||
89 | |||
90 | /* Reparent in case the dpll is in bypass */ | ||
91 | if (cpu_is_omap24xx()) { | ||
92 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
93 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
94 | clk_reparent(clk, dd->clk_bypass); | ||
95 | } else if (cpu_is_omap34xx()) { | ||
96 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
97 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
98 | clk_reparent(clk, dd->clk_bypass); | ||
99 | } else if (cpu_is_omap44xx()) { | ||
100 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
101 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
102 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
103 | clk_reparent(clk, dd->clk_bypass); | ||
104 | } | ||
105 | return; | ||
106 | } | ||
107 | |||
76 | /** | 108 | /** |
77 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware | 109 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware |
78 | * @clk: struct clk * | 110 | * @clk: struct clk * |