From patchwork Sun Feb 11 09:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 13552417 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 D6614C4829A for ; Sun, 11 Feb 2024 10:00:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2624610E584; Sun, 11 Feb 2024 10:00:34 +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="VYsyooBc"; dkim-atps=neutral Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4140410E584 for ; Sun, 11 Feb 2024 10:00:32 +0000 (UTC) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 61CCD6049B; Sun, 11 Feb 2024 09:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1707645631; bh=z77kUUxPWALrfsKKAEPCPtQ6fzajT+5D56pYe6z494c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VYsyooBchSHu4xNsPxcmZx6jIy9z/i+kD39f1I/TiQ39fofbwfZJ3kWQNySbqVB9H JqTNrvTE6C0UPRW5FYEmaXrHDYoLzwyIwCUADYOz2ZX02w7hKGNYeTGjueyGlFbhNR AZIv4tKqwEvs02jlxEFciw9ogA02npE/nrzsVffuXxVRwnACHhQIAcdEVr6H3bVia4 pU/uIHwVkFrpLYYSWD+Pae/7PI70o2F8kz81vdlRaDYwWAuTk1dmPegCc6lEttekk7 H7JgdBhxM89oBIykNkSs93uCwDM+9yGerWqm109OK4KSKow6/f/h9cbwMPGmQXpk6k 4QieNyO1FeliQ== From: Tony Lindgren To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simha BN , Sam Ravnborg Cc: Dmitry Baryshkov , Michael Walle , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 10/10] drm/bridge: tc358775: Configure hs_rate and lp_rate Date: Sun, 11 Feb 2024 11:51:15 +0200 Message-ID: <20240211095144.2589-11-tony@atomide.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240211095144.2589-1-tony@atomide.com> References: <20240211095144.2589-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. Signed-off-by: Tony Lindgren Reviewed-by: Michael Walle --- 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");