From patchwork Wed Nov 14 13:13:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Richard_R=C3=B6jfors?= X-Patchwork-Id: 997735 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="St1GcBXF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42w4hl5qhTz9s9G for ; Thu, 15 Nov 2018 00:14:31 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 74B7BC220AE; Wed, 14 Nov 2018 13:14:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4D0B9C2206B; Wed, 14 Nov 2018 13:14:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 63E8DC2206B; Wed, 14 Nov 2018 13:14:26 +0000 (UTC) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by lists.denx.de (Postfix) with ESMTPS id 0049AC2201D for ; Wed, 14 Nov 2018 13:14:26 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id c16so11473953lfj.8 for ; Wed, 14 Nov 2018 05:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hnJwmOnzwd/DBLPdsazh8s/2nknLTanXUjqRV1X7nAs=; b=St1GcBXFBfzloL2JybJzvUDuseO5GlC6U7zxiKtO1ESrcZWKJ8q+Y5iBYJz+d5MBcL L7K8qJCa8Hbzq+Nxk4t8gx8H0QdyxVXa30XkCFVFpZCRVvcdNvNrWSQuk3WlIlFK9/Sv pYdfBu5B7ZtjvFS0qhrw0go5MqXu9zRQvd91P4Z8uVd7DUe//etIAgR0ek7fnzTIS3tO JfC2G2l6U8HNbNYcYqwXi49oDfUMB2Z7gM5UAzzr8yXp19m7F3gPWfMjZJgGkWuLLL6M slwa3bU/uC3gNUKiuve7EVKzGU5PKmzJw3fUO2xkLgSnA7KMF84dzpFGQKQlM77V4Ma6 55tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hnJwmOnzwd/DBLPdsazh8s/2nknLTanXUjqRV1X7nAs=; b=uMREEH/mi3vXHQQejs7qxMvWRdT4//Py1y2C5EdhTHklIJuCcBi80C5BQLiTRiQskJ E4TppSUSuwH0QG5GaApsvQO2SpJNoUUtdtDLtjhYDCLUrsK+Q9HbFA2qDnpcK0avwjNk mANmi592Gyty27xRXvJs4hrh9GXHHA47M6ALSadmVKdZF44LXieq0oKIMKN0SSCe5lTo wrl0WYqlpM+RH3aViq9RriCM/ILD4Y4vyg0iGsBxG32OhVqVtKaU2FzJATOvQ2lzGNET F67g3wna8pB22+/+Q/VYvI7aaZrSANOCOwe1T4fFqZyu/tUHfj8wPUbAB8WxcALRYuEU 9Tpw== X-Gm-Message-State: AGRZ1gKQWOviP/DpmNcPpFXSx2GmYypZW3KBsEY55PLoSkjUhlwmOtIo GqhBBZ/fEWGKs1KuSskyiJ14tw8f X-Google-Smtp-Source: AJdET5ctOREV3re3sCxEop091O1ejhEnqTrAfWMyKODb5ZWst85ZmdulD/460S+S7PtsxI/tnRq2vA== X-Received: by 2002:a19:2b54:: with SMTP id r81mr1091810lfr.34.1542201264895; Wed, 14 Nov 2018 05:14:24 -0800 (PST) Received: from xellan.lan (82-209-144-86.cust.bredband2.com. [82.209.144.86]) by smtp.gmail.com with ESMTPSA id m1sm3719886lfb.56.2018.11.14.05.14.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 05:14:24 -0800 (PST) From: "=?UTF-8?q?Richard=20R=C3=B6jfors?=" X-Google-Original-From: =?utf-8?q?Richard_R=C3=B6jfors?= To: u-boot@lists.denx.de Date: Wed, 14 Nov 2018 14:13:53 +0100 Message-Id: <20181114131353.29312-1-richard@puffinpack.se> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Cc: =?utf-8?q?Richard_R=C3=B6jfors?= Subject: [U-Boot] [PATCH] rockchip: video: mipi: Fix phy frequency setting X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" 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 Reviewed-by: Philipp Tomsich --- drivers/video/rockchip/rk_mipi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/rockchip/rk_mipi.c b/drivers/video/rockchip/rk_mipi.c index 4fe8f47441..4fc8c1f3b5 100644 --- a/drivers/video/rockchip/rk_mipi.c +++ b/drivers/video/rockchip/rk_mipi.c @@ -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)) {