]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/bridge: tc358768: Support non-continuous clock
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 11 Mar 2026 07:48:15 +0000 (09:48 +0200)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Thu, 7 May 2026 09:38:45 +0000 (12:38 +0300)
The driver prints a warning if MIPI_DSI_CLOCK_NON_CONTINUOUS is set, and
falls back to continuous clock mode. This was added in commit
fbc5a90e82c1 ("drm/bridge: tc358768: Disable non-continuous clock mode").

However, there have been multiple changes to the driver since then, and
at least in my setup, non-continuous clock mode works: I can see an
image on the panel, and I can see the clock lanes being non-continuous
with an oscilloscope.

So, let's enable MIPI_DSI_CLOCK_NON_CONTINUOUS support.

Cc: Dmitry Osipenko <digetx@gmail.com>
Tested-by: João Paulo Gonçalves <joao.goncalves@toradex.com> # Toradex Verdin AM62
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://patch.msgid.link/20260311-tc358768-v2-4-e75a99131bd5@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/gpu/drm/bridge/tc358768.c

index 755ed6483b2edd29aed9171cea4f2fe84ea94db3..a276fbc75dde223bebaf7f5d9171690d88b35491 100644 (file)
@@ -722,7 +722,6 @@ static void tc358768_bridge_atomic_pre_enable(struct drm_bridge *bridge,
 {
        struct tc358768_priv *priv = bridge_to_tc358768(bridge);
        struct mipi_dsi_device *dsi_dev = priv->output.dev;
-       unsigned long mode_flags = dsi_dev->mode_flags;
        u32 val, mask, val2, lptxcnt, hact, data_type;
        s32 raw_val;
        struct drm_crtc_state *crtc_state;
@@ -744,11 +743,6 @@ static void tc358768_bridge_atomic_pre_enable(struct drm_bridge *bridge,
        u32 dsi_vsdly;
        const u32 internal_dly = 40;
 
-       if (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) {
-               dev_warn_once(dev, "Non-continuous mode unimplemented, falling back to continuous\n");
-               mode_flags &= ~MIPI_DSI_CLOCK_NON_CONTINUOUS;
-       }
-
        tc358768_hw_enable(priv);
 
        ret = tc358768_sw_reset(priv);
@@ -1032,7 +1026,7 @@ static void tc358768_bridge_atomic_pre_enable(struct drm_bridge *bridge,
        tc358768_write(priv, TC358768_HSTXVREGEN, val);
 
        tc358768_write(priv, TC358768_TXOPTIONCNTRL,
-                      (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) ? 0 : BIT(0));
+                      (dsi_dev->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) ? 0 : BIT(0));
 
        /* TXTAGOCNT[26:16] RXTASURECNT[10:0] */
        val = tc358768_ps_to_ns((lptxcnt + 1) * hsbyteclk_ps * 4);
@@ -1099,7 +1093,7 @@ static void tc358768_bridge_atomic_pre_enable(struct drm_bridge *bridge,
 
        val |= TC358768_DSI_CONTROL_TXMD;
 
-       if (!(mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
+       if (!(dsi_dev->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
                val |= TC358768_DSI_CONTROL_HSCKMD;
 
        if (dsi_dev->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)