summaryrefslogtreecommitdiff
path: root/drivers/video/am335x-fb.c
diff options
context:
space:
mode:
authorDario Binacchi <dariobin@libero.it>2020-02-22 14:05:43 +0100
committerLokesh Vutla <lokeshvutla@ti.com>2020-03-03 13:08:14 +0530
commit9d7f53c1e50f0c32a62d5ab76b47f34791b571f3 (patch)
tree874f9cafbced4767887ce64822e3863b6160e6cf /drivers/video/am335x-fb.c
parent9aead9ae09416f4c54dfb7a4a076dd2147561ba3 (diff)
video: omap: add loop exit conditions to the dpll setup
In case of null error, round rate is equal to target rate, so it is useless to continue to search the DPLL setup parameters to get the desidered pixel clock rate. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'drivers/video/am335x-fb.c')
-rw-r--r--drivers/video/am335x-fb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c
index bbe965af84..684223f275 100644
--- a/drivers/video/am335x-fb.c
+++ b/drivers/video/am335x-fb.c
@@ -160,7 +160,7 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
err = panel->pxl_clk;
err_r = err;
- for (d = 2; d < 255; d++) {
+ for (d = 2; err_r && d < 255; d++) {
for (m = 2; m < 2047; m++) {
if ((V_OSCK * m) < (panel->pxl_clk * d))
continue;
@@ -176,6 +176,8 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
dpll_disp.m = m;
dpll_disp.n = n;
best_d = d;
+ if (err_r == 0)
+ break;
}
}
}