All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Peter Geis <pgwipeout@gmail.com>,
	Piotr Oniszczuk <piotr.oniszczuk@gmail.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Robert Foss" <robert.foss@linaro.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Pierre-Hugues Husson" <phh@phh.me>,
	"Archit Taneja" <architt@codeaurora.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Heiko Stübner" <heiko@sntech.de>,
	dri-devel@lists.freedesktop.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate
Date: Mon, 14 Mar 2022 11:31:45 +0000	[thread overview]
Message-ID: <c6766e6e-3c90-f0e6-86b3-4afdf41fbbb1@arm.com> (raw)
In-Reply-To: <CAMdYzYq06QSmFAwCuTmBYy4LfQAQDxzx2PGc8HOB1iEjxXHGyg@mail.gmail.com>

On 2022-03-13 12:56, Peter Geis wrote:
> On Sun, Mar 13, 2022 at 6:13 AM Piotr Oniszczuk
> <piotr.oniszczuk@gmail.com> wrote:
>>
>>
>>
>>> Wiadomość napisana przez Peter Geis <pgwipeout@gmail.com> w dniu 26.01.2022, o godz. 21:24:
>>>
>>> The hdmi-cec clock must be 32khz in order for cec to work correctly.
>>> Ensure after enabling the clock we set it in order for the hardware to
>>> work as expected.
>>> Warn on failure, in case this is a static clock that is slighty off.
>>> Fixes hdmi-cec support on Rockchip devices.
>>>
>>> Fixes: ebe32c3e282a ("drm/bridge: synopsys/dw-hdmi: Enable cec clock")
>>>
>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>>> ---
>>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++
>>> 1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> index 54d8fdad395f..1a96da60e357 100644
>>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> @@ -48,6 +48,9 @@
>>>
>>> #define HDMI14_MAX_TMDSCLK    340000000
>>>
>>> +/* HDMI CEC needs a clock rate of 32khz */
>>> +#define HDMI_CEC_CLK_RATE    32768
>>> +
>>> enum hdmi_datamap {
>>>        RGB444_8B = 0x01,
>>>        RGB444_10B = 0x03,
>>> @@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>>>                                ret);
>>>                        goto err_iahb;
>>>                }
>>> +
>>> +             ret = clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE);
>>> +             if (ret)
>>> +                     dev_warn(hdmi->dev, "Cannot set HDMI cec clock rate: %d\n", ret);
>>>        }
>>>
>>>        /* Product and revision IDs */
>>> --
>>> 2.25.1
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
>> Peter,
>>
>> On my 5.17-rc7 with applied rk356x VOP2 v8 series - this patch makes CEC working on rk3566.
>> Unfortunately it breaks working ok CEC on rk3399 rockpi-4b.
>>
>> Reverting this patch brings back CEC on rk3399 - but rk3366 becomes with non working CEC
>>
>> I'm not sure how to move forward with this....
> 
> I was worried about that, thanks for testing it.
> Can you send me the cec_clk rate before and after this patch?

Hmm, looks like there might be a bug in the RK3399 clock driver - 
although it's treated as having mux_pll_p as parents, according to the 
public TRM the CEC clock appears unique in being backwards compared to 
every other mux of those two inputs. I'm now tempted to test this on my 
board tonight and see if I can see 24MHz on the CEC pin... :)

Robin.

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Peter Geis <pgwipeout@gmail.com>,
	Piotr Oniszczuk <piotr.oniszczuk@gmail.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	"Robert Foss" <robert.foss@linaro.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Pierre-Hugues Husson" <phh@phh.me>,
	"Archit Taneja" <architt@codeaurora.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Heiko Stübner" <heiko@sntech.de>,
	dri-devel@lists.freedesktop.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate
Date: Mon, 14 Mar 2022 11:31:45 +0000	[thread overview]
Message-ID: <c6766e6e-3c90-f0e6-86b3-4afdf41fbbb1@arm.com> (raw)
In-Reply-To: <CAMdYzYq06QSmFAwCuTmBYy4LfQAQDxzx2PGc8HOB1iEjxXHGyg@mail.gmail.com>

On 2022-03-13 12:56, Peter Geis wrote:
> On Sun, Mar 13, 2022 at 6:13 AM Piotr Oniszczuk
> <piotr.oniszczuk@gmail.com> wrote:
>>
>>
>>
>>> Wiadomość napisana przez Peter Geis <pgwipeout@gmail.com> w dniu 26.01.2022, o godz. 21:24:
>>>
>>> The hdmi-cec clock must be 32khz in order for cec to work correctly.
>>> Ensure after enabling the clock we set it in order for the hardware to
>>> work as expected.
>>> Warn on failure, in case this is a static clock that is slighty off.
>>> Fixes hdmi-cec support on Rockchip devices.
>>>
>>> Fixes: ebe32c3e282a ("drm/bridge: synopsys/dw-hdmi: Enable cec clock")
>>>
>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>>> ---
>>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++
>>> 1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> index 54d8fdad395f..1a96da60e357 100644
>>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> @@ -48,6 +48,9 @@
>>>
>>> #define HDMI14_MAX_TMDSCLK    340000000
>>>
>>> +/* HDMI CEC needs a clock rate of 32khz */
>>> +#define HDMI_CEC_CLK_RATE    32768
>>> +
>>> enum hdmi_datamap {
>>>        RGB444_8B = 0x01,
>>>        RGB444_10B = 0x03,
>>> @@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>>>                                ret);
>>>                        goto err_iahb;
>>>                }
>>> +
>>> +             ret = clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE);
>>> +             if (ret)
>>> +                     dev_warn(hdmi->dev, "Cannot set HDMI cec clock rate: %d\n", ret);
>>>        }
>>>
>>>        /* Product and revision IDs */
>>> --
>>> 2.25.1
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
>> Peter,
>>
>> On my 5.17-rc7 with applied rk356x VOP2 v8 series - this patch makes CEC working on rk3566.
>> Unfortunately it breaks working ok CEC on rk3399 rockpi-4b.
>>
>> Reverting this patch brings back CEC on rk3399 - but rk3366 becomes with non working CEC
>>
>> I'm not sure how to move forward with this....
> 
> I was worried about that, thanks for testing it.
> Can you send me the cec_clk rate before and after this patch?

Hmm, looks like there might be a bug in the RK3399 clock driver - 
although it's treated as having mux_pll_p as parents, according to the 
public TRM the CEC clock appears unique in being backwards compared to 
every other mux of those two inputs. I'm now tempted to test this on my 
board tonight and see if I can see 24MHz on the CEC pin... :)

Robin.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Peter Geis <pgwipeout@gmail.com>,
	Piotr Oniszczuk <piotr.oniszczuk@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	Archit Taneja <architt@codeaurora.org>,
	Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
	Robert Foss <robert.foss@linaro.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Neil Armstrong <narmstrong@baylibre.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Pierre-Hugues Husson <phh@phh.me>
Subject: Re: [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate
Date: Mon, 14 Mar 2022 11:31:45 +0000	[thread overview]
Message-ID: <c6766e6e-3c90-f0e6-86b3-4afdf41fbbb1@arm.com> (raw)
In-Reply-To: <CAMdYzYq06QSmFAwCuTmBYy4LfQAQDxzx2PGc8HOB1iEjxXHGyg@mail.gmail.com>

On 2022-03-13 12:56, Peter Geis wrote:
> On Sun, Mar 13, 2022 at 6:13 AM Piotr Oniszczuk
> <piotr.oniszczuk@gmail.com> wrote:
>>
>>
>>
>>> Wiadomość napisana przez Peter Geis <pgwipeout@gmail.com> w dniu 26.01.2022, o godz. 21:24:
>>>
>>> The hdmi-cec clock must be 32khz in order for cec to work correctly.
>>> Ensure after enabling the clock we set it in order for the hardware to
>>> work as expected.
>>> Warn on failure, in case this is a static clock that is slighty off.
>>> Fixes hdmi-cec support on Rockchip devices.
>>>
>>> Fixes: ebe32c3e282a ("drm/bridge: synopsys/dw-hdmi: Enable cec clock")
>>>
>>> Signed-off-by: Peter Geis <pgwipeout@gmail.com>
>>> ---
>>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++
>>> 1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> index 54d8fdad395f..1a96da60e357 100644
>>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>> @@ -48,6 +48,9 @@
>>>
>>> #define HDMI14_MAX_TMDSCLK    340000000
>>>
>>> +/* HDMI CEC needs a clock rate of 32khz */
>>> +#define HDMI_CEC_CLK_RATE    32768
>>> +
>>> enum hdmi_datamap {
>>>        RGB444_8B = 0x01,
>>>        RGB444_10B = 0x03,
>>> @@ -3347,6 +3350,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>>>                                ret);
>>>                        goto err_iahb;
>>>                }
>>> +
>>> +             ret = clk_set_rate(hdmi->cec_clk, HDMI_CEC_CLK_RATE);
>>> +             if (ret)
>>> +                     dev_warn(hdmi->dev, "Cannot set HDMI cec clock rate: %d\n", ret);
>>>        }
>>>
>>>        /* Product and revision IDs */
>>> --
>>> 2.25.1
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
>> Peter,
>>
>> On my 5.17-rc7 with applied rk356x VOP2 v8 series - this patch makes CEC working on rk3566.
>> Unfortunately it breaks working ok CEC on rk3399 rockpi-4b.
>>
>> Reverting this patch brings back CEC on rk3399 - but rk3366 becomes with non working CEC
>>
>> I'm not sure how to move forward with this....
> 
> I was worried about that, thanks for testing it.
> Can you send me the cec_clk rate before and after this patch?

Hmm, looks like there might be a bug in the RK3399 clock driver - 
although it's treated as having mux_pll_p as parents, according to the 
public TRM the CEC clock appears unique in being backwards compared to 
every other mux of those two inputs. I'm now tempted to test this on my 
board tonight and see if I can see 24MHz on the CEC pin... :)

Robin.

  parent reply	other threads:[~2022-03-14 11:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 20:24 [PATCH] drm/bridge: synopsys/dw-hdmi: set cec clock rate Peter Geis
2022-01-26 20:24 ` Peter Geis
2022-01-26 20:24 ` Peter Geis
2022-01-26 20:32 ` Fabio Estevam
2022-01-26 20:32   ` Fabio Estevam
2022-01-26 20:32   ` Fabio Estevam
2022-01-27  9:33 ` Sascha Hauer
2022-01-27  9:33   ` Sascha Hauer
2022-01-27  9:33   ` Sascha Hauer
2022-01-28 19:03   ` Peter Geis
2022-01-28 19:03     ` Peter Geis
2022-01-28 19:03     ` Peter Geis
2022-03-13 10:12 ` Piotr Oniszczuk
2022-03-13 10:12   ` Piotr Oniszczuk
2022-03-13 10:12   ` Piotr Oniszczuk
2022-03-13 12:56   ` Peter Geis
2022-03-13 12:56     ` Peter Geis
2022-03-13 12:56     ` Peter Geis
2022-03-13 16:14     ` Piotr Oniszczuk
2022-03-13 16:14       ` Piotr Oniszczuk
2022-03-13 16:14       ` Piotr Oniszczuk
2022-03-14 11:31     ` Robin Murphy [this message]
2022-03-14 11:31       ` Robin Murphy
2022-03-14 11:31       ` Robin Murphy
2022-03-14 16:34       ` Robin Murphy
2022-03-14 16:34         ` Robin Murphy
2022-03-14 16:34         ` Robin Murphy

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=c6766e6e-3c90-f0e6-86b3-4afdf41fbbb1@arm.com \
    --to=robin.murphy@arm.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=architt@codeaurora.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=narmstrong@baylibre.com \
    --cc=pgwipeout@gmail.com \
    --cc=phh@phh.me \
    --cc=piotr.oniszczuk@gmail.com \
    --cc=robert.foss@linaro.org \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.