Move enable PLL from pre_enable to sn65dsi83_atomic_pre_enable.

The base clocks may not be ready when pre_enable is called.

commit c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable
                and post-disable") points out that pre_enable hook definition 
says that
"The display pipe (i.e. clocks and timing signals) feeding this bridge
will not yet be running when this callback is called".

Signed-off-by: Jan Remmet <[email protected]>
---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 
033c44326552ab167d4e8d9b74957c585e4c6fb7..4cbdbafc3e85821ef6fcd9f74bf07faf6b9f84ff
 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -474,7 +474,6 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge 
*bridge,
        struct drm_crtc *crtc;
        bool lvds_format_24bpp;
        bool lvds_format_jeida;
-       unsigned int pval;
        __le16 le16val;
        u16 val;
        int ret;
@@ -614,6 +613,14 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge 
*bridge,
        regmap_write(ctx->regmap, REG_VID_CHA_VERTICAL_FRONT_PORCH,
                     mode->vsync_start - mode->vdisplay);
        regmap_write(ctx->regmap, REG_VID_CHA_TEST_PATTERN, 0x00);
+}
+
+static void sn65dsi83_atomic_enable(struct drm_bridge *bridge,
+                                   struct drm_atomic_state *state)
+{
+       struct sn65dsi83 *ctx = bridge_to_sn65dsi83(bridge);
+       unsigned int pval;
+       int ret;
 
        /* Enable PLL */
        regmap_write(ctx->regmap, REG_RC_PLL_EN, REG_RC_PLL_EN_PLL_EN);
@@ -633,13 +640,6 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge 
*bridge,
 
        /* Wait for 10ms after soft reset as specified in datasheet */
        usleep_range(10000, 12000);
-}
-
-static void sn65dsi83_atomic_enable(struct drm_bridge *bridge,
-                                   struct drm_atomic_state *state)
-{
-       struct sn65dsi83 *ctx = bridge_to_sn65dsi83(bridge);
-       unsigned int pval;
 
        /* Clear all errors that got asserted during initialization. */
        regmap_read(ctx->regmap, REG_IRQ_STAT, &pval);

-- 
2.43.0

Reply via email to