]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: video: mipi: Fix phy frequency setting
authorRichard Röjfors <richard.rojfors@gmail.com>
Wed, 14 Nov 2018 13:13:53 +0000 (14:13 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fri, 30 Nov 2018 18:03:16 +0000 (19:03 +0100)
There was an incorrect check when looping and finding the first
fast enough frequency in the freq_rang table. The code did
actually return the first that was either exactly correct or
too slow.

Signed-off-by: Richard Röjfors <richard@puffinpack.se>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/video/rockchip/rk_mipi.c

index 88bf56ea098e3b016214582202c5d12b767ff87b..4f1a0f3a5f7ffcc1a117e5f07a6f328962e44ba7 100644 (file)
@@ -241,7 +241,7 @@ int rk_mipi_phy_enable(struct udevice *dev)
 
        /* select the suitable value for fsfreqrang reg */
        for (i = 0; i < ARRAY_SIZE(freq_rang); i++) {
-               if (ddr_clk / (MHz) >= freq_rang[i][0])
+               if (ddr_clk / (MHz) <= freq_rang[i][0])
                        break;
        }
        if (i == ARRAY_SIZE(freq_rang)) {