Commit dd2116a3 authored by Mythri P K's avatar Mythri P K Committed by Tomi Valkeinen

OMAPDSS: HDMI: Add M2 divider while calculating clkout

While calculating regm and regmf value add using M2 divider in
the equation.
Formula for calculating:
Output clock on digital core domain:
	CLKOUT = (M / (N+1))*CLKINP*(1/M2)
Internal oscillator output clock on internal LDO domain:
	CLKDCOLDO = (M / (N+1))*CLKINP
The current code when allows variable M2 values as input
ignores using M2 divider values in calculation of regm and regmf.
so fix it by using M2 in calculation although the default value for
M2 is 1.
Signed-off-by: default avatarMythri P K <mythripk@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 0ba86d7e
...@@ -278,24 +278,24 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, ...@@ -278,24 +278,24 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
refclk = clkin / pi->regn; refclk = clkin / pi->regn;
/*
* multiplier is pixel_clk/ref_clk
* Multiplying by 100 to avoid fractional part removal
*/
pi->regm = (phy * 100 / (refclk)) / 100;
if (dssdev->clocks.hdmi.regm2 == 0) if (dssdev->clocks.hdmi.regm2 == 0)
pi->regm2 = HDMI_DEFAULT_REGM2; pi->regm2 = HDMI_DEFAULT_REGM2;
else else
pi->regm2 = dssdev->clocks.hdmi.regm2; pi->regm2 = dssdev->clocks.hdmi.regm2;
/*
* multiplier is pixel_clk/ref_clk
* Multiplying by 100 to avoid fractional part removal
*/
pi->regm = phy * pi->regm2 / refclk;
/* /*
* fractional multiplier is remainder of the difference between * fractional multiplier is remainder of the difference between
* multiplier and actual phy(required pixel clock thus should be * multiplier and actual phy(required pixel clock thus should be
* multiplied by 2^18(262144) divided by the reference clock * multiplied by 2^18(262144) divided by the reference clock
*/ */
mf = (phy - pi->regm * refclk) * 262144; mf = (phy - pi->regm / pi->regm2 * refclk) * 262144;
pi->regmf = mf / (refclk); pi->regmf = pi->regm2 * mf / refclk;
/* /*
* Dcofreq should be set to 1 if required pixel clock * Dcofreq should be set to 1 if required pixel clock
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment