Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1230797rwr; Fri, 5 May 2023 10:53:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4IXssQvM/IkAFVREcHYh1CUZzmd7L7d7GQRvULeaaROoKQQWQzIiGpmf90CcUq0kY68sNX X-Received: by 2002:a05:6a20:12cb:b0:e7:4f8a:d04d with SMTP id v11-20020a056a2012cb00b000e74f8ad04dmr3006218pzg.57.1683309233917; Fri, 05 May 2023 10:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683309233; cv=none; d=google.com; s=arc-20160816; b=gZt+dhDmiUyLZVmHiaLjuFVhoBb2Dys0LD2+wmVuM+ZFQAQY6Yu/meZe9BBiunuGFL ixBpXASqP1IHCQp9yb6dzhyPx0lBtr/BFWU2AzQYbraeKB5N2voRSER/6ZOlzH8lpECu ePi8ZCimhy6yXguMOgvitXrgwHy7qrGf2wMjcCKl+GrSk9XDtY2HLU3cUC1DUMe0RyVK Bn5/xrBmmhiIr+g0znGXWu4pVuKMz922IRw+FYH+HHnoDgCrj2stCRaaG57tY1wCImV9 yYqxrho7cesQ1a/3K1nIZdhLoA0uNdtrF+BIJWU8G2G/JG/PTn856lPQ8zdafIM5kg5c 7AKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+WyMSxivXrVXrgUn/0R76leiJshLnbme34gLf7/ZS88=; b=sbkWiasiJf15H47VTyEMYvsVDi1kxnbl35ICjtjAIIp9K4nwp2ml2RHshze6MJQ6Z/ 8Bz29j1667JRtRK7jMxL4N6jM1MmgO6f5ze/sbNP4WaZeQkm6iiNgV4eBpY8odXlFtMb d8yVNgDgFidXsQmMQkoU18TjDwkrBwF+AWkWsLa2okjr/tBDEDLzyTMkpdmyOFmkxLtA OHKGqTc3C2VMPujlj2ozgQz8etUy/uR8zNjuMPjRAp4RkHJzEOi4Mj+P6re3Va8z7mmE YMK1FbzcRAUlazZz734yJBNfN3pojs8hhWLahXuVLbSG4muD7MDLvXqMC5iKlcpQiJPs cq+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j8TQNIHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a633c16000000b0050fae6024fcsi2409696pga.564.2023.05.05.10.53.40; Fri, 05 May 2023 10:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j8TQNIHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231822AbjEERgh (ORCPT + 99 others); Fri, 5 May 2023 13:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbjEERgg (ORCPT ); Fri, 5 May 2023 13:36:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8823546BD for ; Fri, 5 May 2023 10:36:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1D85063F8A for ; Fri, 5 May 2023 17:36:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84CAAC4339E for ; Fri, 5 May 2023 17:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683308194; bh=w4Z1MEcrGAUorgRMVjLaEf7C6XDfZ1w1NUIKHP+j/Es=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j8TQNIHvpjg5DuFZo7Wxzfx5mlTTF/ud0veNC2AVePcYLEMgPEqw+ZMmO0aen9ypu y1uWY9bLsmr0pDSj74rA5SeVgX2j/Yo0ryjAKaGIUdKPbsLtWY7RKiVKOjdFhUDBvo qMi+ISWkBs+0F2MsF5vOX9x4nCj4nvJ2OV5Jf+u8EviTA/I+gziP/1ypK6mslucP2z UbTop4F5lOeG9mnTSmVImhOim3F7nfn+dsvd2TXhQ5rmaszxGHlpN8PPy3QnuRmrY1 03ew6tXqpJfHVWdZ9BLxZnDSTC1INqG36brUyfbY3FQCKjCy5Hn/xYOIeB2078toqi asaRf9Tv8rqwQ== Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-24de2954bc5so1509542a91.1 for ; Fri, 05 May 2023 10:36:34 -0700 (PDT) X-Gm-Message-State: AC+VfDzz6vkcTMnEw3W/jFuK0hHNhlWZFxFICiJxvzbGlV1nsXgUamuF prKIpT/MTMAtaHfF2kHocYdp507mG2p43wvhU0ueJw== X-Received: by 2002:a17:90a:c282:b0:247:ad6d:7250 with SMTP id f2-20020a17090ac28200b00247ad6d7250mr2419176pjt.12.1683308194060; Fri, 05 May 2023 10:36:34 -0700 (PDT) MIME-Version: 1.0 References: <20230427142934.55435-1-francesco@dolcini.it> <20230427142934.55435-3-francesco@dolcini.it> In-Reply-To: <20230427142934.55435-3-francesco@dolcini.it> From: Robert Foss Date: Fri, 5 May 2023 19:36:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/9] drm/bridge: tc358768: fix PLL parameters computation To: Francesco Dolcini Cc: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , tomi.valkeinen@ideasonboard.com, dri-devel@lists.freedesktop.org, Francesco Dolcini , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 27, 2023 at 4:35=E2=80=AFPM Francesco Dolcini wrote: > > From: Francesco Dolcini > > According to Toshiba documentation the PLL input clock after the divider > should be not less than 4MHz, fix the PLL parameters computation > accordingly. > > Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") > Signed-off-by: Francesco Dolcini > --- > drivers/gpu/drm/bridge/tc358768.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/t= c358768.c > index 8f349bf4fc32..e9e3f9e02bba 100644 > --- a/drivers/gpu/drm/bridge/tc358768.c > +++ b/drivers/gpu/drm/bridge/tc358768.c > @@ -334,13 +334,17 @@ static int tc358768_calc_pll(struct tc358768_priv *= priv, > u32 fbd; > > for (fbd =3D 0; fbd < 512; ++fbd) { > - u32 pll, diff; > + u32 pll, diff, pll_in; > > pll =3D (u32)div_u64((u64)refclk * (fbd + 1), div= isor); > > if (pll >=3D max_pll || pll < min_pll) > continue; > > + pll_in =3D (u32)div_u64((u64)refclk, prd + 1); > + if (pll_in < 4000000) > + continue; > + > diff =3D max(pll, target_pll) - min(pll, target_p= ll); > > if (diff < best_diff) { > -- > 2.25.1 > Reviewed-by: Robert Foss