Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
drm/sun4i: hdmi: Fix usage of TMDS clock
Browse files Browse the repository at this point in the history
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 <[email protected]>
[Maxime: Moved the TMDS clock enable earlier]
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
plaes authored and mripard committed Jan 22, 2019
1 parent 49a5785 commit 5e1bc25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder)
val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
val &= ~SUN4I_HDMI_VID_CTRL_ENABLE;
writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);

clk_disable_unprepare(hdmi->tmds_clk);
}

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

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

clk_prepare_enable(hdmi->tmds_clk);

sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);
Expand Down

0 comments on commit 5e1bc25

Please sign in to comment.