From mboxrd@z Thu Jan 1 00:00:00 1970 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 22D90FED2CC for ; Thu, 12 Mar 2026 04:38:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BE0510E954; Thu, 12 Mar 2026 04:38:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KQ7pZP6J"; dkim-atps=neutral Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id D73E110E954 for ; Thu, 12 Mar 2026 04:38:57 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-35a08ce49dcso515383a91.2 for ; Wed, 11 Mar 2026 21:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773290337; x=1773895137; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BA5hockTvoyEWmo1vDE20MMnx+5hM0Z4ohhNVG+T9i0=; b=KQ7pZP6Jpu/lbusaq0/VJW5J+EEJj61THGWedesW7d5DuaexP1ir0isyjBgKZzuLD7 Qje5zvzO1ZhFqNmF/GQvDWn1YT9dqnHhdWYkWrCzHR4gL1+W3gxUNc7fXvFVuDz33LyA 905aoE4GIRCHyoP07px/HGSmMy/87ZQEzGEO5v/9EMuYcxDnzGOdaFsOQx76lzbK+K4M AS/ZQ5om0ip/GqlgazpVrrJSSGhJbvyJPflNVwG+514z+J/CT0juddQ3gtg4R9CF7Nkf Bs92ok+zSGTIRuTZH6MclJ3PSnDSSNanfpFFg6EHxEoqfTVy5BOJGbxvbpY8OUvotDUL RNgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773290337; x=1773895137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BA5hockTvoyEWmo1vDE20MMnx+5hM0Z4ohhNVG+T9i0=; b=UHMfYvp3pTYLJcGR4sIFqzhPJgBILX1RGv/AYxKiOb6QpST/m0nr48mnuxwFFvjdn7 nkLHPbMJhlMhNiiox3L3ew9tKf/0hO8Uog45yXWcKKsMzl+HWvwWSlfqau8KNVz2bPv3 eKtOGXbTBe19nhd0qgU1oRRGKNzjZEShg7J9dE/AEZwFc2TDF2CoX+ql42QtsLZ6CQsV 2lpWlz1LzpGZzi6WcJ+Xi+9N/aOXQAyCY9t3ILC6FPibYk6udmyJFN8MTM6kJUnIiBVp JtoPbkktbpBjgQLddGirz91Uk+IQQfBPBvlIGdIxADoj57h/7gTb4AJJ4m+aC44V3xOw 9akQ== X-Forwarded-Encrypted: i=1; AJvYcCVBPZ+7cGUKWw/nD7nv2qCsQ2WstNzHOgKOztQAodwhwM+CUjSG7cmCUqNwnJjxUfkDVIykp0nSrCk=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yz8dvQbjno6V3/zAE18vNY800/GIYnEZm0LVH9DzK2O1g0YpwNg 7MTsDe8RlAddpi57lgusGUpOyQiU2teETSlCanI1LWKlEhAPyn3AWZHe X-Gm-Gg: ATEYQzzx85HrGxmwejQ5zs7QaOCTrM9fTRMNJNW4TfbnwlK0X6jAVD0vQCR8JvVCt7c tOwKSQ3fLV47cIwGlp7GH9FjOFvqKZk0vTt/aPGCtxn5CmLT1n+rmbSyd/34ehhDuvmOeqx3qnb gJCW/yibE6uDohwyi/BlMPu2Cq9pwCaKGWRJaA1I5WphFCzBYfBS6TtY/nGl3rQjSZIvBD/aboF NZDrsxhK8JNRohuRoY2+fsgTT4IQiE5fPHsuPxyKgF4v5W5aArp4/Lea2sRZUF07vNHY1W/c5/F t6Uk9SXQt9m5Tf+RzeS33vkEgctuSSC+Bt1ulftw8TvZH58Ni1tG5XXGUe0csro2LB1/qXSN+wR UVJHLM0tF/x9WddQRcsESU+SEhTqpxRbR2z9KpB1w3ywxukIBaXQW41V2jZRsBAoqIXve0XLR1B HthpPa6WcRluzcLnJq3CeG5aBoi02L7HWn2gMYKCkup2DH5erw X-Received: by 2002:a17:90a:e7d2:b0:359:fa1e:2bc3 with SMTP id 98e67ed59e1d1-35a011a566fmr5084635a91.6.1773290337293; Wed, 11 Mar 2026 21:38:57 -0700 (PDT) Received: from test-HP-Desktop-Pro-G3.. ([103.218.174.23]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a030490b9sm3793460a91.17.2026.03.11.21.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 21:38:56 -0700 (PDT) From: Sudarshan Shetty To: andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, marex@denx.de, valentin@compulab.co.il, philippe.schenker@toradex.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Sudarshan Shetty Subject: [PATCH v2 2/2] drm: bridge: ti-sn65dsi83: Add support for dual-link LVDS video mode Date: Thu, 12 Mar 2026 10:07:43 +0530 Message-Id: <20260312043743.261475-3-tessolveupstream@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260312043743.261475-1-tessolveupstream@gmail.com> References: <20260312043743.261475-1-tessolveupstream@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" Some LVDS panels operating in dual-link mode require adjusted horizontal timing parameters when programmed into the SN65DSI84 bridge. According to TI documentation, horizontal timing values must be divided by two when operating in dual-link mode. Without this adjustment, the panel may fail to display or produce corrupted output. Add support for an optional DT property "ti,dual-link-video-mode" to enable configuration required for dual-link LVDS operation. These settings ensure correct LVDS output for panels that require this mode of operation. Signed-off-by: Sudarshan Shetty --- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 52 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c index f6736b4457bb..9b7d35487bd8 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c @@ -164,6 +164,7 @@ struct sn65dsi83 { int irq; struct delayed_work monitor_work; struct work_struct reset_work; + bool dual_link_video_mode; }; static const struct regmap_range sn65dsi83_readable_ranges[] = { @@ -667,8 +668,43 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge, mode->hsync_start - mode->hdisplay); regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_FRONT_PORCH, mode->vsync_start - mode->vdisplay); - regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00); + /* + * In dual-link LVDS mode, the SN65DSI84 requires the horizontal + * timing parameters to be adjusted before being programmed into + * the device. According to TI documentation, the horizontal timing + * values must be divided by two when operating in dual-link mode. + * Without this adjustment, the connected panel may fail to light up + * or display corrupted output. + * + * TI also provides recommended register settings for this mode, + * which were derived using the TI DSI-Tuner tool. When the optional + * DT property "ti,dual-link-video-mode" is present, apply these + * configuration settings to ensure correct dual-link LVDS operation. + */ + if (ctx->dual_link_video_mode) { + regmap_write(ctx->regmap, REG_RC_LVDS_PLL, 0x05); + regmap_write(ctx->regmap, REG_RC_PLL_EN, 0x00); + regmap_write(ctx->regmap, REG_DSI_CLK, 0x53); + regmap_write(ctx->regmap, REG_LVDS_FMT, 0x6f); + regmap_write(ctx->regmap, REG_LVDS_VCOM, 0x00); + regmap_write(ctx->regmap, + REG_VID_CHA_VERTICAL_DISPLAY_SIZE_LOW, 0x00); + regmap_write(ctx->regmap, + REG_VID_CHA_VERTICAL_DISPLAY_SIZE_HIGH, 0x00); + regmap_write(ctx->regmap, + REG_VID_CHA_HSYNC_PULSE_WIDTH_LOW, 0x10); + regmap_write(ctx->regmap, + REG_VID_CHA_HORIZONTAL_BACK_PORCH, 0x28); + regmap_write(ctx->regmap, + REG_VID_CHA_VERTICAL_BACK_PORCH, 0x00); + regmap_write(ctx->regmap, + REG_VID_CHA_HORIZONTAL_FRONT_PORCH, 0x00); + regmap_write(ctx->regmap, + REG_VID_CHA_VERTICAL_FRONT_PORCH, 0x00); + } + + regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00); /* Enable PLL */ regmap_write(ctx->regmap, REG_RC_PLL_EN, REG_RC_PLL_EN_PLL_EN); usleep_range(3000, 4000); @@ -965,9 +1001,15 @@ static int sn65dsi83_host_attach(struct sn65dsi83 *ctx) dsi->lanes = dsi_lanes; dsi->format = MIPI_DSI_FMT_RGB888; - dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_VIDEO_NO_HFP | MIPI_DSI_MODE_VIDEO_NO_HBP | - MIPI_DSI_MODE_VIDEO_NO_HSA | MIPI_DSI_MODE_NO_EOT_PACKET; + if (ctx->dual_link_video_mode) + dsi->mode_flags = MIPI_DSI_MODE_VIDEO; + else + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_VIDEO_NO_HFP | + MIPI_DSI_MODE_VIDEO_NO_HBP | + MIPI_DSI_MODE_VIDEO_NO_HSA | + MIPI_DSI_MODE_NO_EOT_PACKET; ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) { @@ -1021,6 +1063,8 @@ static int sn65dsi83_probe(struct i2c_client *client) if (ret) return ret; + ctx->dual_link_video_mode = + of_property_read_bool(dev->of_node, "ti,dual-link-video-mode"); ctx->regmap = devm_regmap_init_i2c(client, &sn65dsi83_regmap_config); if (IS_ERR(ctx->regmap)) return dev_err_probe(dev, PTR_ERR(ctx->regmap), "failed to get regmap\n"); -- 2.34.1