Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1228681rwr; Fri, 5 May 2023 10:51:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VGNEqjq9n65vW9yAwRdABfR8cFeRD9Lo6HZRFWEetyNg/SjHXx2JajS35L0K48CCS75nC X-Received: by 2002:a17:902:ce81:b0:1a6:e564:6046 with SMTP id f1-20020a170902ce8100b001a6e5646046mr2778524plg.46.1683309106837; Fri, 05 May 2023 10:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683309106; cv=none; d=google.com; s=arc-20160816; b=kQyevcm4YvESIoliGaMuE8tO6jlie8BVEygGK1ujutMloNPtlUt7x/5OBgYAffn2X/ CD6ijl7cnGwNh+efYGMU4noqKk9N+A+iyJ82ue+f7A4dN7nnoRKwTkrLk/U15yeQk1wc bnABqAu3DAL2GDYJigedM2622Om0QiA7uRl3pe++qmpkrja8Rm1aCo7zYFWOM+wI0QJe T8Hvc7vpbpYpPAfNDeAreaf9249OE31pNZ9gV4SAz0oK+HOmLW+fNyuM+9VcX4cAa0dz oz8GoARB0PHmT6/tmi3AEDGy9cf8aUFw8/VQ6VEE8AJ4hxIr3T+UrM5CrzeY7e8Z7snt //MA== 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=ATum4AnsLwdCjznCnMZGboqAb1fU6clL3FmMBAAj5Zg=; b=dETjnN3gQXYHHVRZctsksflHSqUwlwTrRWyBLvu8vHfuRY1T4PYv/UFytUUFldAdJj DGVbrvq6nt51DtwWBgg7GoHhLjv5dN49UazR+EqP+zTB8JcvfyssfhW2Uoyyr+qQGeVC eoiQwrjuqldPE1N4BX5NQuULJfMPrGx4FlmawCscgrYlPcOLZVZtJV1cHHD+8eOSvlOo 2+akHBRadEQR61LdiWI/+Nv4EGbBWjtdOyEPPPURf5drJFSyYU+VdOv1GWSGx244Kv6m CQ8Z5vHY+QibPJXm3laC0af4W6MxZ9j0G7/S7mMZi8+ophJrARyi8N7mhSzHnDZwvtL0 ZGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SoSkJRVp; 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 e5-20020a17090301c500b0019c354055d0si2223618plh.304.2023.05.05.10.51.30; Fri, 05 May 2023 10:51:46 -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=SoSkJRVp; 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 S232287AbjEERlT (ORCPT + 99 others); Fri, 5 May 2023 13:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbjEERlR (ORCPT ); Fri, 5 May 2023 13:41:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6A34F1 for ; Fri, 5 May 2023 10:41:16 -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 6A71F61486 for ; Fri, 5 May 2023 17:41:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0438C433D2 for ; Fri, 5 May 2023 17:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683308475; bh=VXIPbVt5ooPbkAjjpZpHqh7KRKHYkPDMpipRC+g/0v0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SoSkJRVpidOcO8iGxxBhTDA6YM3VT93vI4KfhxkA9ESb4doBNTMO9HTEYKNYlgJ5q UmurNPr6kzsBAQ39jWnzonFivakdo8CJH2QHhVrx5qmHqfLigk2YLiWJ9hWj5IbGXO Ofsfd0aVFji9X/WTatbIP5IIZI6kn9LBin6QjmAmle6KnHvuxa5MMpPRnqg3dBiWQH MoTAym7TofKO/8QcuVNL7yq2hQ1BH3YCDwMCBIrpS7+La+mLrTvBxFgAQ3rdFfBnit P+hOaJeoxk6tSr+gaTlquPGBVA6Y01+V+zaSo2TPI+RNZ06eMIOi/m2NEy/n3rFZMO kF+YgcjIRGayw== Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-52160f75920so1408586a12.2 for ; Fri, 05 May 2023 10:41:15 -0700 (PDT) X-Gm-Message-State: AC+VfDxPrfEWQgnUMmZEEAKIbprFrA1JqAIKjAVsiXcAYoWa2cWfCFp5 E+OA3dRHFcx6id22Iy4UBm2qQqXAfTTLK49n3JRlkQ== X-Received: by 2002:a17:90b:3a8d:b0:23f:9fac:6b35 with SMTP id om13-20020a17090b3a8d00b0023f9fac6b35mr2173471pjb.39.1683308475334; Fri, 05 May 2023 10:41:15 -0700 (PDT) MIME-Version: 1.0 References: <20230427142934.55435-1-francesco@dolcini.it> <20230427142934.55435-5-francesco@dolcini.it> In-Reply-To: <20230427142934.55435-5-francesco@dolcini.it> From: Robert Foss Date: Fri, 5 May 2023 19:41:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 4/9] drm/bridge: tc358768: fix TCLK_ZEROCNT 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 , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 > > Correct computation of TCLK_ZEROCNT register. > > This register must be set to a value that ensure that > (TCLK-PREPARECNT + TCLK-ZERO) > 300ns > > with the actual value of (TCLK-PREPARECNT + TCLK-ZERO) being > > (1 to 2) + (TCLK_ZEROCNT + 1)) x HSByteClkCycle + (PHY output delay) > > with PHY output delay being about > > (2 to 3) x MIPIBitClk cycle in the BitClk conversion. > > Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") > Signed-off-by: Francesco Dolcini > --- > drivers/gpu/drm/bridge/tc358768.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/t= c358768.c > index dba1bf3912f1..aff400c36066 100644 > --- a/drivers/gpu/drm/bridge/tc358768.c > +++ b/drivers/gpu/drm/bridge/tc358768.c > @@ -742,10 +742,10 @@ static void tc358768_bridge_pre_enable(struct drm_b= ridge *bridge) > > /* 38ns < TCLK_PREPARE < 95ns */ > val =3D tc358768_ns_to_cnt(65, dsibclk_nsk) - 1; > - /* TCLK_PREPARE > 300ns */ > - val2 =3D tc358768_ns_to_cnt(300 + tc358768_to_ns(3 * ui_nsk), > - dsibclk_nsk); > - val |=3D (val2 - tc358768_to_ns(phy_delay_nsk - dsibclk_nsk)) << = 8; > + /* TCLK_PREPARE + TCLK_ZERO > 300ns */ > + val2 =3D tc358768_ns_to_cnt(300 - tc358768_to_ns(2 * ui_nsk), > + dsibclk_nsk) - 2; > + val |=3D val2 << 8; > dev_dbg(priv->dev, "TCLK_HEADERCNT: 0x%x\n", val); > tc358768_write(priv, TC358768_TCLK_HEADERCNT, val); > > -- > 2.25.1 > Reviewed-by: Robert Foss