From patchwork Sun Feb 25 06:19:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13570727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41BC6C47DD9 for ; Sun, 25 Feb 2024 06:29:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 859DA10E268; Sun, 25 Feb 2024 06:29:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=atomide.com header.i=@atomide.com header.b="jFki21+n"; dkim-atps=neutral Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id D651310E25F for ; Sun, 25 Feb 2024 06:29:20 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id BC6626058D; Sun, 25 Feb 2024 06:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1708842560; bh=VERCIMMDwj5lwKKcADSnyxcjQigwJ3k/cdfbfunsFPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFki21+nM/4h9YcgPTCs3+gS3/dLXKuPuMiSxI8kuOiAIyqcoY48O+Zil2nRgDbHK q8A+2GHh/P3fyfKZ1YLkLL90AeNQo8kmZF+msKVPdXwfiM8i1AeUo7nubqrbhU9MVo acuwIWRo7GTNTMuOzbWAk9EG3K29I241CMOqpwEWQ3rbzDQMjdkkjLjk5JF9SMugBU DvJGXp1vjCbojDb3G68m77ZgjTYqKCwRVoWd+Qe2Dv1Fv9uS4kYoyoDzD6J6GYKsd7 fyMz5Q1/lEq5H7brY+oblijxmUgf5DS8U2+XTyUeioA0Wls3SOexfew+gUaFyqLHuP ebTy9UOHSvjIA== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Cc: Dmitry Baryshkov , Krzysztof Kozlowski , Michael Walle , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v5 10/10] drm/bridge: tc358775: Configure hs_rate and lp_rate Date: Sun, 25 Feb 2024 08:19:39 +0200 Message-ID: <20240225062008.33191-11-tony@atomide.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240225062008.33191-1-tony@atomide.com> References: <20240225062008.33191-1-tony@atomide.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The hs_rate and lp_rate may be used by the dsi host for timing calculations. The tc358775 has a maximum bit rate of 1 Gbps/lane, tc358765 has maximurate of 800 Mbps per lane. Reviewed-by: Michael Walle Signed-off-by: Tony Lindgren --- drivers/gpu/drm/bridge/tc358775.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -637,6 +637,19 @@ static int tc_attach_host(struct tc_data *tc) dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM; + /* + * The hs_rate and lp_rate are data rate values. The HS mode is + * differential, while the LP mode is single ended. As the HS mode + * uses DDR, the DSI clock frequency is half the hs_rate. The 10 Mbs + * data rate for LP mode is not specified in the bridge data sheet, + * but seems to be part of the MIPI DSI spec. + */ + if (tc->type == TC358765) + dsi->hs_rate = 800000000; + else + dsi->hs_rate = 1000000000; + dsi->lp_rate = 10000000; + ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { dev_err(dev, "failed to attach dsi to host\n");