Re: [PATCH v6 06/13] drm/bridge: tc358762: Improve DPI enable handling

From: Andreas Kemnade

Date: Tue Nov 24 2026 - 05:41:14 EST


On Tue, 24 Nov 2026 12:07:57 +0200
Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx> wrote:

> The HW reset defaults has DPIENABLE bit as set. In the current driver we
> configure and enable various things while DPIENABLE is set. This results
> in a temporary DPI output with wrong timings, which may cause artifacts
> on the panel.
>
> Fix this by clearing DPIEANBLE as the first thing when we start to
> enable the display. DPIENABLE is set later with the rest of the LCDCTRL
> configuration, and at that time we have done all the other
> configurations.
>
> Also, for symmetry and possibly improving the DPI output at disable
> time, explicitly disable DPIENABLE when disabling the bridge.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
Reviewed-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
> ---
> drivers/gpu/drm/bridge/tc358762.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
> index 91bc79d36a74..0933fc974a7c 100644
> --- a/drivers/gpu/drm/bridge/tc358762.c
> +++ b/drivers/gpu/drm/bridge/tc358762.c
> @@ -134,6 +134,12 @@ static int tc358762_init(struct tc358762 *ctx)
> {
> u32 lcdctrl;
>
> + /*
> + * DPIENABLE has reset default of 1. Make sure we don't output on
> + * DPI until we have finished the coniguration.
> + */
> + tc358762_write(ctx, LCDCTRL, 0);
> +
> tc358762_write(ctx, SYSCTRL,
> FIELD_PREP(SYSCTRL_DPIDATA_IO_MASK, SYSCTRL_DPIDATA_IO_4MA) |
> FIELD_PREP(SYSCTRL_DPISTB_IO_MASK, SYSCTRL_DPISTB_IO_4MA) |
> @@ -185,6 +191,13 @@ static void tc358762_post_disable(struct drm_bridge *bridge,
>
> ctx->pre_enabled = false;
>
> + /* Turn off the DPI output */
> + tc358762_write(ctx, LCDCTRL, 0);
> +
> + ret = tc358762_clear_error(ctx);
> + if (ret < 0)
> + dev_err(ctx->dev, "error disabling DPI output (%d)\n", ret);
> +
> if (ctx->reset_gpio)
> gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>
>