aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clkt_dpll.c
diff options
context:
space:
mode:
authorMike Turquette <mturquette@ti.com>2012-11-07 16:14:47 -0500
committerPaul Walmsley <paul@pwsan.com>2012-11-12 21:18:51 -0500
commitf9ae32a74f0242cbef76d9baa10993d707be1714 (patch)
tree4c9e616bd4a72879405b94b039ee26ca812bed14 /arch/arm/mach-omap2/clkt_dpll.c
parentf51e0f9862ccf8be71219763d51e7617b95faa10 (diff)
ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
Clean all #ifdef's added to common clock code. This code is no longer needed due to migration to the common clock framework. Signed-off-by: Mike Turquette <mturquette@ti.com> [paul@pwsan.com: clean up new ifdefs added in clockdomain.c] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clkt_dpll.c')
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index f343389fc6e8..924c230f8948 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -16,11 +16,7 @@
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#ifdef CONFIG_COMMON_CLK
20#include <linux/clk-provider.h> 19#include <linux/clk-provider.h>
21#else
22#include <linux/clk.h>
23#endif
24#include <linux/io.h> 20#include <linux/io.h>
25 21
26#include <asm/div64.h> 22#include <asm/div64.h>
@@ -80,11 +76,7 @@
80 * (assuming that it is counting N upwards), or -2 if the enclosing loop 76 * (assuming that it is counting N upwards), or -2 if the enclosing loop
81 * should skip to the next iteration (again assuming N is increasing). 77 * should skip to the next iteration (again assuming N is increasing).
82 */ 78 */
83#ifdef CONFIG_COMMON_CLK
84static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n) 79static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n)
85#else
86static int _dpll_test_fint(struct clk *clk, u8 n)
87#endif
88{ 80{
89 struct dpll_data *dd; 81 struct dpll_data *dd;
90 long fint, fint_min, fint_max; 82 long fint, fint_min, fint_max;
@@ -93,11 +85,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
93 dd = clk->dpll_data; 85 dd = clk->dpll_data;
94 86
95 /* DPLL divider must result in a valid jitter correction val */ 87 /* DPLL divider must result in a valid jitter correction val */
96#ifdef CONFIG_COMMON_CLK
97 fint = __clk_get_rate(__clk_get_parent(clk->hw.clk)) / n; 88 fint = __clk_get_rate(__clk_get_parent(clk->hw.clk)) / n;
98#else
99 fint = __clk_get_rate(__clk_get_parent(clk)) / n;
100#endif
101 89
102 if (cpu_is_omap24xx()) { 90 if (cpu_is_omap24xx()) {
103 /* Should not be called for OMAP2, so warn if it is called */ 91 /* Should not be called for OMAP2, so warn if it is called */
@@ -198,24 +186,15 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate,
198} 186}
199 187
200/* Public functions */ 188/* Public functions */
201#ifdef CONFIG_COMMON_CLK
202u8 omap2_init_dpll_parent(struct clk_hw *hw) 189u8 omap2_init_dpll_parent(struct clk_hw *hw)
203{ 190{
204 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 191 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
205#else
206void omap2_init_dpll_parent(struct clk *clk)
207{
208#endif
209 u32 v; 192 u32 v;
210 struct dpll_data *dd; 193 struct dpll_data *dd;
211 194
212 dd = clk->dpll_data; 195 dd = clk->dpll_data;
213 if (!dd) 196 if (!dd)
214#ifdef CONFIG_COMMON_CLK
215 return -EINVAL; 197 return -EINVAL;
216#else
217 return;
218#endif
219 198
220 v = __raw_readl(dd->control_reg); 199 v = __raw_readl(dd->control_reg);
221 v &= dd->enable_mask; 200 v &= dd->enable_mask;
@@ -225,34 +204,18 @@ void omap2_init_dpll_parent(struct clk *clk)
225 if (cpu_is_omap24xx()) { 204 if (cpu_is_omap24xx()) {
226 if (v == OMAP2XXX_EN_DPLL_LPBYPASS || 205 if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
227 v == OMAP2XXX_EN_DPLL_FRBYPASS) 206 v == OMAP2XXX_EN_DPLL_FRBYPASS)
228#ifdef CONFIG_COMMON_CLK
229 return 1; 207 return 1;
230#else
231 clk_reparent(clk, dd->clk_bypass);
232#endif
233 } else if (cpu_is_omap34xx()) { 208 } else if (cpu_is_omap34xx()) {
234 if (v == OMAP3XXX_EN_DPLL_LPBYPASS || 209 if (v == OMAP3XXX_EN_DPLL_LPBYPASS ||
235 v == OMAP3XXX_EN_DPLL_FRBYPASS) 210 v == OMAP3XXX_EN_DPLL_FRBYPASS)
236#ifdef CONFIG_COMMON_CLK
237 return 1; 211 return 1;
238#else
239 clk_reparent(clk, dd->clk_bypass);
240#endif
241 } else if (soc_is_am33xx() || cpu_is_omap44xx()) { 212 } else if (soc_is_am33xx() || cpu_is_omap44xx()) {
242 if (v == OMAP4XXX_EN_DPLL_LPBYPASS || 213 if (v == OMAP4XXX_EN_DPLL_LPBYPASS ||
243 v == OMAP4XXX_EN_DPLL_FRBYPASS || 214 v == OMAP4XXX_EN_DPLL_FRBYPASS ||
244 v == OMAP4XXX_EN_DPLL_MNBYPASS) 215 v == OMAP4XXX_EN_DPLL_MNBYPASS)
245#ifdef CONFIG_COMMON_CLK
246 return 1; 216 return 1;
247#else
248 clk_reparent(clk, dd->clk_bypass);
249#endif
250 } 217 }
251#ifdef CONFIG_COMMON_CLK
252 return 0; 218 return 0;
253#else
254 return;
255#endif
256} 219}
257 220
258/** 221/**
@@ -269,11 +232,7 @@ void omap2_init_dpll_parent(struct clk *clk)
269 * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0 232 * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0
270 * if the clock @clk is not a DPLL. 233 * if the clock @clk is not a DPLL.
271 */ 234 */
272#ifdef CONFIG_COMMON_CLK
273unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) 235unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
274#else
275u32 omap2_get_dpll_rate(struct clk *clk)
276#endif
277{ 236{
278 long long dpll_clk; 237 long long dpll_clk;
279 u32 dpll_mult, dpll_div, v; 238 u32 dpll_mult, dpll_div, v;
@@ -329,15 +288,10 @@ u32 omap2_get_dpll_rate(struct clk *clk)
329 * (expensive) function again. Returns ~0 if the target rate cannot 288 * (expensive) function again. Returns ~0 if the target rate cannot
330 * be rounded, or the rounded rate upon success. 289 * be rounded, or the rounded rate upon success.
331 */ 290 */
332#ifdef CONFIG_COMMON_CLK
333long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, 291long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
334 unsigned long *parent_rate) 292 unsigned long *parent_rate)
335{ 293{
336 struct clk_hw_omap *clk = to_clk_hw_omap(hw); 294 struct clk_hw_omap *clk = to_clk_hw_omap(hw);
337#else
338long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
339{
340#endif
341 int m, n, r, scaled_max_m; 295 int m, n, r, scaled_max_m;
342 unsigned long scaled_rt_rp; 296 unsigned long scaled_rt_rp;
343 unsigned long new_rate = 0; 297 unsigned long new_rate = 0;
@@ -351,11 +305,7 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
351 dd = clk->dpll_data; 305 dd = clk->dpll_data;
352 306
353 ref_rate = __clk_get_rate(dd->clk_ref); 307 ref_rate = __clk_get_rate(dd->clk_ref);
354#ifdef CONFIG_COMMON_CLK
355 clk_name = __clk_get_name(hw->clk); 308 clk_name = __clk_get_name(hw->clk);
356#else
357 clk_name = __clk_get_name(clk);
358#endif
359 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", 309 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n",
360 clk_name, target_rate); 310 clk_name, target_rate);
361 311