]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: hdmi: fix parent clock search
authorIvan Raul Guadarrama <iguadarrama@nvidia.com>
Tue, 25 Nov 2014 11:44:34 +0000 (13:44 +0200)
committerMatthew Pedro <mapedro@nvidia.com>
Wed, 18 Mar 2015 15:56:41 +0000 (08:56 -0700)
Fix the parent clock search for the display
controller. It addresses the corner case when
the divider difference is just smaller than the
chosen precision and wrongly assumed zero.
An explicit ceiling function is applied for
corretness.

Bug 1580265
Bug 1552739

Change-Id: I47312116c19813260941abcae42e4067a57f3d2c
Signed-off-by: Ivan Raul Guadarrama <iguadarrama@nvidia.com>
Reviewed-on: http://git-master/r/714972
GVS: Gerrit_Virtual_Submit
Reviewed-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/video/tegra/dc/hdmi.c

index 79eb956f692dabd82758e9c3db9838ad312bc55e..cdacfd366471819dd28a613b0d921e6fcc3d0a82 100644 (file)
@@ -2187,7 +2187,7 @@ static unsigned long  tegra12x_hdmi_determine_parent(
        for (n = 4; (ref / 2 * n) <= pmax; n++) {
                if ((ref / 2 * n) < pmin)  /* too low */
                        continue;
-               m = (ref / 2 * n) / (pclk / 1000);
+               m = DIV_ROUND_UP((ref / 2 * n), (pclk / 1000));
                if (m <= 1700)  /* for 2 <= m */
                        continue;
                f = m % 1000;  /* fractional parts */