From: Archit Taneja <architt@codeaurora.org>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: dri-devel@lists.freedesktop.org,
Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 2/4] drm/bridge: dw-hdmi: add better clock disable control
Date: Fri, 4 Aug 2017 19:09:02 +0530 [thread overview]
Message-ID: <1a014928-8e94-b9db-e21f-746d8fd452c1@codeaurora.org> (raw)
In-Reply-To: <8bc9989d-d385-a8f9-d433-b8abe6e53fe9@xs4all.nl>
On 07/31/2017 08:56 PM, Hans Verkuil wrote:
> On 07/31/2017 04:29 PM, Russell King wrote:
>> The video setup path aways sets the clock disable register to a specific
>> value, which has the effect of disabling the CEC engine. When we add the
>> CEC driver, this becomes a problem.
>>
>> Fix this by only setting/clearing the bits that the video path needs to.
>>
>> Reviewed-by: Jose Abreu <joabreu@synopsys.com>
>> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
>
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Queued to drm-misc-next.
Thanks,
Archit
>
> Regards,
>
> Hans
>
>> ---
>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 29 ++++++++++++++++++-----------
>> 1 file changed, 18 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> index 82e55ee8e4fa..b08cc0c95590 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> @@ -166,6 +166,7 @@ struct dw_hdmi {
>> bool bridge_is_on; /* indicates the bridge is on */
>> bool rxsense; /* rxsense state */
>> u8 phy_mask; /* desired phy int mask settings */
>> + u8 mc_clkdis; /* clock disable register */
>>
>> spinlock_t audio_lock;
>> struct mutex audio_mutex;
>> @@ -551,8 +552,11 @@ EXPORT_SYMBOL_GPL(dw_hdmi_set_sample_rate);
>>
>> static void hdmi_enable_audio_clk(struct dw_hdmi *hdmi, bool enable)
>> {
>> - hdmi_modb(hdmi, enable ? 0 : HDMI_MC_CLKDIS_AUDCLK_DISABLE,
>> - HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS);
>> + if (enable)
>> + hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_AUDCLK_DISABLE;
>> + else
>> + hdmi->mc_clkdis |= HDMI_MC_CLKDIS_AUDCLK_DISABLE;
>> + hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
>> }
>>
>> static void dw_hdmi_ahb_audio_enable(struct dw_hdmi *hdmi)
>> @@ -1574,8 +1578,6 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
>> /* HDMI Initialization Step B.4 */
>> static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi)
>> {
>> - u8 clkdis;
>> -
>> /* control period minimum duration */
>> hdmi_writeb(hdmi, 12, HDMI_FC_CTRLDUR);
>> hdmi_writeb(hdmi, 32, HDMI_FC_EXCTRLDUR);
>> @@ -1587,17 +1589,21 @@ static void dw_hdmi_enable_video_path(struct dw_hdmi *hdmi)
>> hdmi_writeb(hdmi, 0x21, HDMI_FC_CH2PREAM);
>>
>> /* Enable pixel clock and tmds data path */
>> - clkdis = 0x7F;
>> - clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
>> - hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
>> + hdmi->mc_clkdis |= HDMI_MC_CLKDIS_HDCPCLK_DISABLE |
>> + HDMI_MC_CLKDIS_CSCCLK_DISABLE |
>> + HDMI_MC_CLKDIS_AUDCLK_DISABLE |
>> + HDMI_MC_CLKDIS_PREPCLK_DISABLE |
>> + HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
>> + hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE;
>> + hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
>>
>> - clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
>> - hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
>> + hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE;
>> + hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
>>
>> /* Enable csc path */
>> if (is_color_space_conversion(hdmi)) {
>> - clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
>> - hdmi_writeb(hdmi, clkdis, HDMI_MC_CLKDIS);
>> + hdmi->mc_clkdis &= ~HDMI_MC_CLKDIS_CSCCLK_DISABLE;
>> + hdmi_writeb(hdmi, hdmi->mc_clkdis, HDMI_MC_CLKDIS);
>> }
>>
>> /* Enable color space conversion if needed */
>> @@ -2272,6 +2278,7 @@ __dw_hdmi_probe(struct platform_device *pdev,
>> hdmi->disabled = true;
>> hdmi->rxsense = true;
>> hdmi->phy_mask = (u8)~(HDMI_PHY_HPD | HDMI_PHY_RX_SENSE);
>> + hdmi->mc_clkdis = 0x7f;
>>
>> mutex_init(&hdmi->mutex);
>> mutex_init(&hdmi->audio_mutex);
>>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-08-04 13:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 14:29 [PATCH v2 0/4] dw-hdmi CEC support Russell King - ARM Linux
2017-07-31 14:29 ` [PATCH v2 1/4] drm/bridge: dw-hdmi: add cec notifier support Russell King
2017-07-31 14:33 ` Neil Armstrong
2017-07-31 15:25 ` Hans Verkuil
2017-08-04 13:36 ` Archit Taneja
2017-08-05 9:23 ` Hans Verkuil
2017-08-07 3:59 ` Archit Taneja
2017-08-02 14:11 ` Laurent Pinchart
2017-08-02 14:17 ` Hans Verkuil
2017-08-02 17:44 ` Russell King - ARM Linux
2017-07-31 14:29 ` [PATCH v2 2/4] drm/bridge: dw-hdmi: add better clock disable control Russell King
2017-07-31 15:26 ` Hans Verkuil
2017-08-04 13:39 ` Archit Taneja [this message]
2017-07-31 14:29 ` [PATCH v2 3/4] drm/bridge: dw-hdmi: add cec driver Russell King
2017-07-31 15:35 ` Hans Verkuil
2017-08-01 22:32 ` Laurent Pinchart
2017-08-02 6:47 ` Hans Verkuil
2017-08-02 13:14 ` Laurent Pinchart
2017-08-02 13:27 ` Russell King - ARM Linux
2017-08-02 13:34 ` Hans Verkuil
2017-08-02 14:22 ` Laurent Pinchart
2017-08-02 17:43 ` Russell King - ARM Linux
2017-08-02 14:17 ` Neil Armstrong
2017-07-31 14:29 ` [PATCH v2 4/4] drm/bridge: dw-hdmi: remove CEC engine register definitions Russell King
2017-07-31 15:26 ` Hans Verkuil
2017-08-01 22:29 ` [PATCH v2 0/4] dw-hdmi CEC support Laurent Pinchart
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=1a014928-8e94-b9db-e21f-746d8fd452c1@codeaurora.org \
--to=architt@codeaurora.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=rmk+kernel@armlinux.org.uk \
/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