aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-02-13 04:36:22 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-14 07:52:08 -0400
commitd0e224f9963b79610850b2a10622182176658022 (patch)
tree418881116f13641add903db6dc6dc4dc119fc044
parent8d018647e00876e0c0e8dba13c52c882be4e1678 (diff)
OMAPDSS: fix rounding when calculating fclk rate
"clk: divider: fix rate calculation for fractional rates" patch (and similar for TI specific divider) fixes the clk-divider's rounding. This patch updates the DSS driver to round the rates accordingly. This fixes the DSS's warnings about clock rate mismatch, and also fixes the wrong fclk rate being set. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Tested-by: Christoph Fritz <chf.fritz@googlemail.com> Tested-by: Marek Belisko <marek@goldelico.com>
-rw-r--r--drivers/video/omap2/dss/dss.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 825c019ddee7..d55266c0e029 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -457,7 +457,7 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
457 fckd_stop = max(DIV_ROUND_UP(prate * m, fck_hw_max), 1ul); 457 fckd_stop = max(DIV_ROUND_UP(prate * m, fck_hw_max), 1ul);
458 458
459 for (fckd = fckd_start; fckd >= fckd_stop; --fckd) { 459 for (fckd = fckd_start; fckd >= fckd_stop; --fckd) {
460 fck = prate / fckd * m; 460 fck = DIV_ROUND_UP(prate, fckd) * m;
461 461
462 if (func(fck, data)) 462 if (func(fck, data))
463 return true; 463 return true;
@@ -506,7 +506,7 @@ static int dss_setup_default_clock(void)
506 506
507 fck_div = DIV_ROUND_UP(prate * dss.feat->dss_fck_multiplier, 507 fck_div = DIV_ROUND_UP(prate * dss.feat->dss_fck_multiplier,
508 max_dss_fck); 508 max_dss_fck);
509 fck = prate / fck_div * dss.feat->dss_fck_multiplier; 509 fck = DIV_ROUND_UP(prate, fck_div) * dss.feat->dss_fck_multiplier;
510 } 510 }
511 511
512 r = dss_set_fck_rate(fck); 512 r = dss_set_fck_rate(fck);