lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQ35d3ehnW6Pi+BT@hu-nlaad-hyd.qualcomm.com>
Date: Fri, 7 Nov 2025 19:21:51 +0530
From: Nilesh Laad <nilesh.laad@....qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Robert Foss <rfoss@...nel.org>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Jonas Karlman <jonas@...boo.se>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        venkata.valluru@....qualcomm.com, jessica.zhang@....qualcomm.com,
        Yi Zhang <zhanyi@....qualcomm.com>
Subject: Re: [PATCH] drm/bridge: add support for lontium lt9211c bridge

On Mon, Sep 15, 2025 at 04:19:57AM +0300, Dmitry Baryshkov wrote:
> On Thu, Sep 11, 2025 at 08:25:27PM +0530, Nilesh Laad wrote:
> > From: Yi Zhang <zhanyi@....qualcomm.com>
> > 
> > LT9211c is a Single/Dual-Link DSI/LVDS or Single DPI input to
> > Single-link/Dual-Link DSI/LVDS or Single DPI output bridge chip.
> > Add support for DSI to LVDS bridge configuration.
> > 
> > Signed-off-by: Yi Zhang <zhanyi@....qualcomm.com>
> > Signed-off-by: Nilesh Laad <nilesh.laad@....qualcomm.com>
> 
> Please send the driver together with the bindings, in one series.
Addressed in https://lore.kernel.org/lkml/20251107-add-lt9211c-bridge-v2-0-b0616e23407c@oss.qualcomm.com/
> 
> The driver looks pretty similar to the existing LT9211 driver. Please
> explain why you can't extend that one.
LT9211 and LT9211C differ completely in register programming sequences.
Even lontium mentioned that register configuration are different for lt9211 and lt9211c.
Nearly every function would require duplicated logic with if (chip_type) branching,
as register sequence are completely different.
Having both sequences in single file is not looking good, hence want to merge as separate driver.
> 
> > ---
> >  drivers/gpu/drm/bridge/Kconfig           |   13 +
> >  drivers/gpu/drm/bridge/Makefile          |    1 +
> >  drivers/gpu/drm/bridge/lontium-lt9211c.c | 1105 ++++++++++++++++++++++++++++++
> >  3 files changed, 1119 insertions(+)
> > 
> > +	const struct reg_sequence lt9211c_tx_ssc_seq[] = {
> > +		{ 0x8234, 0x00 },
> > +		{ 0x856e, 0x10 },
> > +		{ 0x8181, 0x15 },
> > +		{ 0x871e, 0x00 },
> > +		{ 0x8717, 0x02 },
> > +		{ 0x8718, 0x04 },
> > +		{ 0x8719, 0xd4 },
> > +		{ 0x871A, 0x00 },
> > +		{ 0x871B, 0x12 },
> > +		{ 0x871C, 0x00 },
> > +		{ 0x871D, 0x24 },
> > +		{ 0x871F, 0x1c },
> 
> lowercase the hex, please.
> 
> > +		{ 0x8720, 0x00 },
> > +		{ 0x8721, 0x00 },
> > +		{ 0x871e, 0x02 },
> > +	};
> > +
> 
> [...]
> 
> > +
> > +static void lt9211c_atomic_enable(struct drm_bridge *bridge,
> > +				struct drm_atomic_state *state)
> > +{
> > +	struct lt9211c *ctx = bridge_to_lt9211c(bridge);
> > +	const struct drm_bridge_state *bridge_state;
> > +	const struct drm_crtc_state *crtc_state;
> > +	struct drm_connector *connector;
> > +	struct drm_crtc *crtc;
> > +	u32 bus_flags;
> > +	int ret;
> > +
> > +	ret = regulator_enable(ctx->vccio);
> > +	if (ret) {
> > +		dev_err(ctx->dev, "Failed to enable vccio: %d\n", ret);
> > +		return;
> > +	}
> > +
> > +	/* Deassert reset */
> > +	gpiod_set_value(ctx->reset_gpio, 1);
> > +	usleep_range(20000, 21000);	/* Very long post-reset delay. */
> > +
> > +	/* Get the LVDS format from the bridge state. */
> > +	bridge_state = drm_atomic_get_new_bridge_state(state, bridge);
> > +	bus_flags = bridge_state->output_bus_cfg.flags;
> > +	ctx->de = !!(bus_flags & DRM_BUS_FLAG_DE_HIGH);
> > +
> > +	switch (bridge_state->output_bus_cfg.format) {
> > +	case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
> > +		ctx->bpp24 = false;
> > +		ctx->jeida = true;
> > +		break;
> > +	case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
> > +		ctx->bpp24 = true;
> > +		ctx->jeida = true;
> > +		break;
> > +	case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
> > +		ctx->bpp24 = true;
> > +		ctx->jeida = false;
> > +		break;
> > +	default:
> > +		/*
> > +		 * Some bridges still don't set the correct
> > +		 * LVDS bus format, use SPWG24 default
> > +		 * format until those are fixed.
> > +		 */
> > +		ctx->bpp24 = true;
> > +		ctx->jeida = false;
> > +		dev_warn(ctx->dev,
> > +			 "Unsupported LVDS bus format 0x%04x\n",
> > +			 bridge_state->output_bus_cfg.format);
> > +		break;
> > +	}
> > +
> > +	/*
> > +	 * Retrieve the CRTC adjusted mode. This requires a little dance to go
> > +	 * from the bridge to the encoder, to the connector and to the CRTC.
> > +	 */
> > +	connector = drm_atomic_get_new_connector_for_encoder(state,
> > +							     bridge->encoder);
> > +	crtc = drm_atomic_get_new_connector_state(state, connector)->crtc;
> > +	crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> > +	drm_mode_copy(&ctx->mode, &crtc_state->adjusted_mode);
> > +
> > +	dev_dbg(ctx->dev, "width=%d,height=%d,clock=%d\n",
> > +			ctx->mode.hdisplay,
> > +			ctx->mode.vdisplay,
> > +			ctx->mode.clock);
> > +
> > +	ret = lt9211c_read_chipid(ctx);
> > +	if (ret)
> > +		return;
> > +
> > +	/* Lt9211c must enable after mipi clock enable */
> > +	queue_delayed_work(ctx->wq, &ctx->lt9211c_dw,
> > +		msecs_to_jiffies(100));
> 
> At this point MIPI clock should be enabled.
> 
Yes, MIPI clock is enabled here but a delay is required for lt9211c to
detect the mipi signals. Added queue_delayed_work() to defer execution
without blocking main thread.
> > +
> > +	dev_dbg(ctx->dev, "LT9211 enabled.\n");
> > +}
> > +
> 
> [...]
> 
> > +
> > +MODULE_DESCRIPTION("Lontium LT9211C DSI/LVDS/DPI bridge driver");
> > +MODULE_LICENSE("GPL");
> 
> Missing MODULE_AUTHOR
> 
> > 
> > ---
> > base-commit: f50b969bafafb2810a07f376387350c4c0d72a21
> > change-id: 20250911-lt9211c-bridge-support-9209f7cc7697
> > prerequisite-message-id: <20250910-add-lt9211c-bridge-v1-1-4f23740fe101@....qualcomm.com>
> > prerequisite-patch-id: 79524a1aaba6b39f49603db725539cf11176820b
> > 
> > Best regards,
> > --  
> > Nilesh Laad <nilesh.laad@....qualcomm.com>
> > 
> 
> -- 
> With best wishes
> Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ