Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp738573rwr; Thu, 27 Apr 2023 07:35:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58o4NUDScr2uzaMrLf8GxuKu/a8zQpQIWUp5dGlkB0p6W/CnyGPChJA3/0egOIPiC33deU X-Received: by 2002:a05:6a00:478e:b0:638:abf4:d49c with SMTP id dh14-20020a056a00478e00b00638abf4d49cmr2428333pfb.3.1682606123929; Thu, 27 Apr 2023 07:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682606123; cv=none; d=google.com; s=arc-20160816; b=cGKCWUsgq3EwyRqXE6TdX1wmJbk9uQxfGsvz805VX+SSrYjknZHXLaSjLQs//iR0Pu tPOZVyMKpeOSqkZlO8nw+Be3p2p9Nw56CnhXs4VeeMPqhOVCim2T0zEdIz0FmtXiMmyq ry4oue0m8s25LXm2Ps9fuGeAw+capMns8BncZZeXYw22x58pCalHqrXU/rifj8J1K/c5 X2/ZoHe4cuQi+y4FN71k3Q5+ONiyiTHwagQ7qnr4oBJQ1trAHAUKQXo1hfg/4FOIOwAi tDLRfpIUQc7Cc1EXSKYxUn259aMu+1+oqnEQ8ckYJV9RzSGz4i0bwKWYXoog9+DY17EC DLSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bnSEKJhxyb5H7QAPnywOp1AiY7+kJ6kaYnC0KoBqutU=; b=hkZrhVnDZJQDc0GaDvRYkl+KNdOhzvFN+LOW619sIHigPIUR52JGwQjww1ulV6oMui 9JU/E5WQ3L89r7VOWIDElCTlpMt4aYMhFQQxflWjOdk3SfUVTfuBMPATzT3i4EYReezC z60P2lSQScWNIq+dYEa3OhsMkO7kKYtOWSv30LG5knnrJjcPQSz+MBLlXkt+c7VUFkOz YPXkZdCY9n47iHSnEbChAyxMIR7+ROKKmqbhUE63XEKRiOziBGxK2bhWNGCKzb2rvhd2 xAOUNkRCturjn58k8a1fmCkHNSbdkGuc9oiESHLFsLXmgTDQGiblfwZNd4obt4id5BXb O2xQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020aa796aa000000b0063b7465b6f8si18546108pfk.80.2023.04.27.07.35.11; Thu, 27 Apr 2023 07:35:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244108AbjD0Oau (ORCPT + 99 others); Thu, 27 Apr 2023 10:30:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244111AbjD0OaZ (ORCPT ); Thu, 27 Apr 2023 10:30:25 -0400 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA88E4696 for ; Thu, 27 Apr 2023 07:30:19 -0700 (PDT) Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id B1F6B20B60; Thu, 27 Apr 2023 16:29:42 +0200 (CEST) From: Francesco Dolcini To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , tomi.valkeinen@ideasonboard.com, dri-devel@lists.freedesktop.org Cc: Francesco Dolcini , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: [PATCH v1 7/9] drm/bridge: tc358768: fix TXTAGOCNT computation Date: Thu, 27 Apr 2023 16:29:32 +0200 Message-Id: <20230427142934.55435-8-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230427142934.55435-1-francesco@dolcini.it> References: <20230427142934.55435-1-francesco@dolcini.it> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 From: Francesco Dolcini Correct computation of TXTAGOCNT register. This register must be set to a value that ensure that the TTA-GO period = (4 x TLPX) with the actual value of TTA-GO being 4 x (TXTAGOCNT + 1) x (HSByteClk cycle) Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Signed-off-by: Francesco Dolcini --- drivers/gpu/drm/bridge/tc358768.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c index 36e33cba59a2..854fc04f08d0 100644 --- a/drivers/gpu/drm/bridge/tc358768.c +++ b/drivers/gpu/drm/bridge/tc358768.c @@ -795,7 +795,7 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge) /* TXTAGOCNT[26:16] RXTASURECNT[10:0] */ val = tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk * 4); - val = tc358768_ns_to_cnt(val, dsibclk_nsk) - 1; + val = tc358768_ns_to_cnt(val, dsibclk_nsk) / 4 - 1; val2 = tc358768_ns_to_cnt(tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk), dsibclk_nsk) - 2; val = val << 16 | val2; -- 2.25.1