diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-18 11:15:21 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-19 20:19:08 +0300 |
commit | c107751d12cf40a5288d47edda53b2c4de2ff21c (patch) | |
tree | 369d6bad67ada9ea05e34be3d5bde756061ae2c5 /drivers/gpu/drm/omapdrm/dss/pll.c | |
parent | drm/omap: move HDMI PLL calc function to pll.c (diff) | |
download | linux-dev-c107751d12cf40a5288d47edda53b2c4de2ff21c.tar.xz linux-dev-c107751d12cf40a5288d47edda53b2c4de2ff21c.zip |
drm/omap: generalize dss_pll_calc_b()
dss_pll_calc_b() takes HDMI TMDS clock rate as a parameter. To make
dss_pll_calc_b() usable for non-HDMI users, change the function to take
clkout rate as parameter, and also change the current users of
dss_pll_calc_b() to accommodate that.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/pll.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/pll.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/pll.c b/drivers/gpu/drm/omapdrm/dss/pll.c index bdfc88a7caaf..6daf7bc3a67a 100644 --- a/drivers/gpu/drm/omapdrm/dss/pll.c +++ b/drivers/gpu/drm/omapdrm/dss/pll.c @@ -248,18 +248,21 @@ bool dss_pll_calc_a(const struct dss_pll *pll, unsigned long clkin, return false; } +/* + * This calculates a PLL config that will provide the target_clkout rate + * for clkout. Additionally clkdco rate will be the same as clkout rate + * when clkout rate is >= min_clkdco. + */ bool dss_pll_calc_b(const struct dss_pll *pll, unsigned long clkin, - unsigned long target_tmds, struct dss_pll_clock_info *cinfo) + unsigned long target_clkout, struct dss_pll_clock_info *cinfo) { unsigned long fint, clkdco, clkout; - unsigned long target_bitclk, target_clkdco; + unsigned long target_clkdco; unsigned long min_dco; unsigned n, m, mf, m2, sd; const struct dss_pll_hw *hw = pll->hw; - DSSDBG("clkin %lu, target tmds %lu\n", clkin, target_tmds); - - target_bitclk = target_tmds * 10; + DSSDBG("clkin %lu, target clkout %lu\n", clkin, target_clkout); /* Fint */ n = DIV_ROUND_UP(clkin, hw->fint_max); @@ -267,11 +270,11 @@ bool dss_pll_calc_b(const struct dss_pll *pll, unsigned long clkin, /* adjust m2 so that the clkdco will be high enough */ min_dco = roundup(hw->clkdco_min, fint); - m2 = DIV_ROUND_UP(min_dco, target_bitclk); + m2 = DIV_ROUND_UP(min_dco, target_clkout); if (m2 == 0) m2 = 1; - target_clkdco = target_bitclk * m2; + target_clkdco = target_clkout * m2; m = target_clkdco / fint; clkdco = fint * m; |