[PATCH 6/8] drm/bridge: tc358762: Improve DPI enable handling

From: Tomi Valkeinen

Date: Thu Mar 26 2026 - 09:16:13 EST


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>
---
drivers/gpu/drm/bridge/tc358762.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
index 52e2f3a73721..cc1c5ff42cbd 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,9 @@ static void tc358762_post_disable(struct drm_bridge *bridge,

ctx->pre_enabled = false;

+ /* Turn off the DPI output */
+ tc358762_write(ctx, LCDCTRL, 0);
+
if (ctx->reset_gpio)
gpiod_set_value_cansleep(ctx->reset_gpio, 0);


--
2.43.0