From patchwork Sat Feb 22 13:05:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1242503 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2014 header.b=sRprSrXd; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48PpWz1mW7z9sPK for ; Sun, 23 Feb 2020 00:07:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6DF381C79; Sat, 22 Feb 2020 14:07:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="sRprSrXd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C469381C65; Sat, 22 Feb 2020 14:06:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FORGED_SPF_HELO, FREEMAIL_FROM, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-17-i2.italiaonline.it [213.209.12.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C8EB681C65 for ; Sat, 22 Feb 2020 14:06:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from localhost.localdomain ([5.90.75.199]) by smtp-17.iol.local with ESMTPA id 5UTkjGP1IReJd5UUHjishh; Sat, 22 Feb 2020 14:06:29 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1582376789; bh=W+M6OU12f/HN7MTr2Yur/tqtD/504gTi8R21s0//6j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sRprSrXdWly1sbImAmUkL7d5vhglbkFELB6NUWAooXnx5KM0vEduM6LbsqQDfeoCO eff6zcJIxs8sD5CgCXHw47sw3YCURD9w1biwjb9abPSehpuOT9fjCjQOW3GJduOKw+ iMqEQ6rPQhGvGm74doJYg7yLpUHO/dvgypfUQFvLy9TlJYokkJczaXeED2D/kkH4RR z9832O/txMV+AeEwjDBJo8ABekozBQNFlU2Mr+v4O1DhqldD9YJMAUPdhiiOfQsOKK 1quy8kn7tSo2wYO2CSZW4sc7JiHPCf9HttrE/Lg59HhjKndKRv85VKhRYr/M1VgEhF +2VIXNxC55qRw== X-CNFS-Analysis: v=2.3 cv=Qd8YQfTv c=1 sm=1 tr=0 a=Pj3pnR/5H+xJpJwmNtHN6w==:117 a=Pj3pnR/5H+xJpJwmNtHN6w==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=sozttTNsAAAA:8 a=Hlasj0uWh6_VJ9nccHgA:9 a=aeg5Gbbo78KNqacMgKqU:22 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Anatolij Gustschin , Lokesh Vutla Subject: [PATCH v3 07/13] video: omap: add loop exit conditions to the dpll setup Date: Sat, 22 Feb 2020 14:05:43 +0100 Message-Id: <20200222130549.25565-8-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200222130549.25565-1-dariobin@libero.it> References: <20200222130549.25565-1-dariobin@libero.it> X-CMAE-Envelope: MS4wfOvSWYB070sDQGiw5XKN1YTlAYqS+guHHaqfoEOZKmgY2Eu3SIuYyzoJ/JQv3x9uDB8K2ewGAKKNLG6Rz+XdIR6poa1vc3GlfOimX1iCexjSLezsPDhy lIIz5a4zIuxOKWIqa3ryyLKS4fBltI0hVZoy0jxASsqT6AWYRNPk9rhnpisozyMKhm4GjLhzUxkE1Kk3cKHdgzVUEX2zW5htnN5YUGlPaRaHRgGWXojKYSE0 tGts8eOASw8nIfLuvldcmg== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Lokesh Vutla --- Changes in v3: None Changes in v2: None drivers/video/am335x-fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } } }