Skip to content

Commit 5e1bc25

Browse files
plaesmripard
authored andcommitted
drm/sun4i: hdmi: Fix usage of TMDS clock
Although TMDS clock is required for HDMI to properly function, nobody called clk_prepare_enable(). This fixes reference counting issues and makes sure clock is running when it needs to be running. Due to TDMS clock being parent clock for DDC clock, TDMS clock was turned on/off for each EDID probe, causing spurious failures for certain HDMI/DVI screens. Fixes: 9c56810 ("drm/sun4i: Add HDMI support") Signed-off-by: Priit Laes <priit.laes@paf.com> [Maxime: Moved the TMDS clock enable earlier] Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190122073232.7240-1-plaes@plaes.org
1 parent 49a5785 commit 5e1bc25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder)
9292
val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
9393
val &= ~SUN4I_HDMI_VID_CTRL_ENABLE;
9494
writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
95+
96+
clk_disable_unprepare(hdmi->tmds_clk);
9597
}
9698

9799
static void sun4i_hdmi_enable(struct drm_encoder *encoder)
@@ -102,6 +104,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder)
102104

103105
DRM_DEBUG_DRIVER("Enabling the HDMI Output\n");
104106

107+
clk_prepare_enable(hdmi->tmds_clk);
108+
105109
sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
106110
val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
107111
val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);

0 commit comments

Comments
 (0)