On Thu, Sep 11, 2025 at 08:25:27PM +0530, Nilesh Laad wrote:
> From: Yi Zhang <zha...@qti.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 <zha...@qti.qualcomm.com>
> Signed-off-by: Nilesh Laad <nilesh.l...@oss.qualcomm.com>

Please send the driver together with the bindings, in one series.

The driver looks pretty similar to the existing LT9211 driver. Please
explain why you can't extend that one.

> ---
>  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.

> +
> +     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-4f23740fe...@oss.qualcomm.com>
> prerequisite-patch-id: 79524a1aaba6b39f49603db725539cf11176820b
> 
> Best regards,
> --  
> Nilesh Laad <nilesh.l...@oss.qualcomm.com>
> 

-- 
With best wishes
Dmitry

Reply via email to