aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2014-07-02 04:47:43 -0400
committerPaul Walmsley <paul@pwsan.com>2014-07-15 16:09:10 -0400
commit2337c5b58b6e9fd2fb46ab64e7ccbc44dc0ba40a (patch)
tree5bd127df70fb561597491ca34d68554633eb585b
parent512d91cbd990c67df16d0a7b3ff5d35055ac6b39 (diff)
ARM: OMAP2+: clock/dpll: add jitter correction behind clk_features
Currently DPLL code uses runtime cpu_is_343x checks to see if the DPLL has freqsel fields in its control register or not. Instead, add a new flag to the clk_features.flags and use this during runtime. Allows eventual move of the DPLL code under clock driver. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r--arch/arm/mach-omap2/clock.c4
-rw-r--r--arch/arm/mach-omap2/clock.h3
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index e4384377d9f8..23b5f050c8a9 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -784,4 +784,8 @@ void __init ti_clk_init_features(void)
784 (1 << OMAP4XXX_EN_DPLL_FRBYPASS) | 784 (1 << OMAP4XXX_EN_DPLL_FRBYPASS) |
785 (1 << OMAP4XXX_EN_DPLL_MNBYPASS); 785 (1 << OMAP4XXX_EN_DPLL_MNBYPASS);
786 } 786 }
787
788 /* Jitter correction only available on OMAP343X */
789 if (cpu_is_omap343x())
790 ti_clk_features.flags |= TI_CLK_DPLL_HAS_FREQSEL;
787} 791}
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 7b2b099c6a83..d3ef147b32a1 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -234,6 +234,9 @@ struct ti_clk_features {
234 long fint_band2_min; 234 long fint_band2_min;
235 u8 dpll_bypass_vals; 235 u8 dpll_bypass_vals;
236}; 236};
237
238#define TI_CLK_DPLL_HAS_FREQSEL (1 << 0)
239
237extern struct ti_clk_features ti_clk_features; 240extern struct ti_clk_features ti_clk_features;
238 241
239extern const struct clkops clkops_omap2_dflt_wait; 242extern const struct clkops clkops_omap2_dflt_wait;
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 6d7ba37e2257..12ad0f5b15bf 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -310,7 +310,7 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
310 * Set jitter correction. Jitter correction applicable for OMAP343X 310 * Set jitter correction. Jitter correction applicable for OMAP343X
311 * only since freqsel field is no longer present on other devices. 311 * only since freqsel field is no longer present on other devices.
312 */ 312 */
313 if (cpu_is_omap343x()) { 313 if (ti_clk_features.flags & TI_CLK_DPLL_HAS_FREQSEL) {
314 v = omap2_clk_readl(clk, dd->control_reg); 314 v = omap2_clk_readl(clk, dd->control_reg);
315 v &= ~dd->freqsel_mask; 315 v &= ~dd->freqsel_mask;
316 v |= freqsel << __ffs(dd->freqsel_mask); 316 v |= freqsel << __ffs(dd->freqsel_mask);
@@ -512,7 +512,7 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
512 return -EINVAL; 512 return -EINVAL;
513 513
514 /* Freqsel is available only on OMAP343X devices */ 514 /* Freqsel is available only on OMAP343X devices */
515 if (cpu_is_omap343x()) { 515 if (ti_clk_features.flags & TI_CLK_DPLL_HAS_FREQSEL) {
516 freqsel = _omap3_dpll_compute_freqsel(clk, 516 freqsel = _omap3_dpll_compute_freqsel(clk,
517 dd->last_rounded_n); 517 dd->last_rounded_n);
518 WARN_ON(!freqsel); 518 WARN_ON(!freqsel);