aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMythri P K <mythripk@ti.com>2012-02-21 01:40:58 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-03-06 07:08:10 -0500
commitdd2116a35aa9a5a7b71e1d21f30aec8927434d19 (patch)
tree8ef49664dfd6eb538264abec6df545abd8d4738e /drivers
parent0ba86d7edea1f9f2d9497c31200910263e8b4128 (diff)
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: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/hdmi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a229d0f8365..c4b4f6950a9 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -278,24 +278,24 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
278 278
279 refclk = clkin / pi->regn; 279 refclk = clkin / pi->regn;
280 280
281 /*
282 * multiplier is pixel_clk/ref_clk
283 * Multiplying by 100 to avoid fractional part removal
284 */
285 pi->regm = (phy * 100 / (refclk)) / 100;
286
287 if (dssdev->clocks.hdmi.regm2 == 0) 281 if (dssdev->clocks.hdmi.regm2 == 0)
288 pi->regm2 = HDMI_DEFAULT_REGM2; 282 pi->regm2 = HDMI_DEFAULT_REGM2;
289 else 283 else
290 pi->regm2 = dssdev->clocks.hdmi.regm2; 284 pi->regm2 = dssdev->clocks.hdmi.regm2;
291 285
292 /* 286 /*
287 * multiplier is pixel_clk/ref_clk
288 * Multiplying by 100 to avoid fractional part removal
289 */
290 pi->regm = phy * pi->regm2 / refclk;
291
292 /*
293 * fractional multiplier is remainder of the difference between 293 * fractional multiplier is remainder of the difference between
294 * multiplier and actual phy(required pixel clock thus should be 294 * multiplier and actual phy(required pixel clock thus should be
295 * multiplied by 2^18(262144) divided by the reference clock 295 * multiplied by 2^18(262144) divided by the reference clock
296 */ 296 */
297 mf = (phy - pi->regm * refclk) * 262144; 297 mf = (phy - pi->regm / pi->regm2 * refclk) * 262144;
298 pi->regmf = mf / (refclk); 298 pi->regmf = pi->regm2 * mf / refclk;
299 299
300 /* 300 /*
301 * Dcofreq should be set to 1 if required pixel clock 301 * Dcofreq should be set to 1 if required pixel clock