From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Priit Laes <plaes@plaes.org>
Cc: David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Chen-Yu Tsai <wens@csie.org>, Daniel Vetter <daniel@ffwll.ch>,
Priit Laes <priit.laes@paf.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drm/sun4i: hdmi: Fix usage of TMDS clock
Date: Tue, 22 Jan 2019 10:17:27 +0100 [thread overview]
Message-ID: <20190122091727.fksox7poqxvt5umu@flea> (raw)
In-Reply-To: <20190122073232.7240-1-plaes@plaes.org>
[-- Attachment #1.1: Type: text/plain, Size: 1823 bytes --]
On Tue, Jan 22, 2019 at 09:32:32AM +0200, Priit Laes wrote:
> From: Priit Laes <priit.laes@paf.com>
>
> 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: 9c5681011a0c ("drm/sun4i: Add HDMI support")
>
> Signed-off-by: Priit Laes <priit.laes@paf.com>
> ---
> drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> index 061d2e0d9011..25f4d676fd82 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
> @@ -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)
> @@ -112,6 +114,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder)
> val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE;
>
> writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
> +
> + clk_prepare_enable(hdmi->tmds_clk);
We'll probably need to enable that clock to send the infoframes as
well. I moved it earlier (and that allows the enable and disable
function to be symetric as well).
Thanks for figuring this out!
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-01-22 9:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 7:32 [PATCH] drm/sun4i: hdmi: Fix usage of TMDS clock Priit Laes
2019-01-22 9:17 ` Maxime Ripard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190122091727.fksox7poqxvt5umu@flea \
--to=maxime.ripard@bootlin.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plaes@plaes.org \
--cc=priit.laes@paf.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox