From: "Heiko Stübner" <heiko@sntech.de>
To: Sandy Huang <hjc@rock-chips.com>,
Andy Yan <andy.yan@rock-chips.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/6] drm/bridge: dw-hdmi-qp: Fixup timer base setup
Date: Wed, 15 Oct 2025 17:44:01 +0200 [thread overview]
Message-ID: <2753758.X9hSmTKtgW@diego> (raw)
In-Reply-To: <20250903-rk3588-hdmi-cec-v4-2-fa25163c4b08@collabora.com>
Am Mittwoch, 3. September 2025, 20:51:00 Mitteleuropäische Sommerzeit schrieb Cristian Ciocaltea:
> Currently the TIMER_BASE_CONFIG0 register gets initialized to a fixed
> value as initially found in vendor driver code supporting the RK3588
> SoC. As a matter of fact the value matches the rate of the HDMI TX
> reference clock, which is roughly 428.57 MHz.
>
> However, on RK3576 SoC that rate is slightly lower, i.e. 396.00 MHz, and
> the incorrect register configuration breaks CEC functionality.
>
> Set the timer base according to the actual reference clock rate that
> shall be provided by the platform driver. Otherwise fallback to the
> vendor default.
>
> While at it, also drop the unnecessary empty lines in
> dw_hdmi_qp_init_hw().
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
This _does_ look ok to me, but as that touches the main bridge, could
we get a 2nd set of eyes?
Thanks
Heiko
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 12 +++++++++---
> include/drm/bridge/dw_hdmi_qp.h | 1 +
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> index fc98953672b6fb388d05201e280d24b8f214498a..4ba7b339eff62592aa748429a3bfca82494679d1 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
> @@ -161,6 +161,7 @@ struct dw_hdmi_qp {
> void *data;
> } phy;
>
> + unsigned long ref_clk_rate;
> struct regmap *regm;
>
> unsigned long tmds_char_rate;
> @@ -1210,13 +1211,11 @@ static void dw_hdmi_qp_init_hw(struct dw_hdmi_qp *hdmi)
> {
> dw_hdmi_qp_write(hdmi, 0, MAINUNIT_0_INT_MASK_N);
> dw_hdmi_qp_write(hdmi, 0, MAINUNIT_1_INT_MASK_N);
> - dw_hdmi_qp_write(hdmi, 428571429, TIMER_BASE_CONFIG0);
> + dw_hdmi_qp_write(hdmi, hdmi->ref_clk_rate, TIMER_BASE_CONFIG0);
>
> /* Software reset */
> dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
> -
> dw_hdmi_qp_write(hdmi, 0x085c085c, I2CM_FM_SCL_CONFIG0);
> -
> dw_hdmi_qp_mod(hdmi, 0, I2CM_FM_EN, I2CM_INTERFACE_CONTROL0);
>
> /* Clear DONE and ERROR interrupts */
> @@ -1262,6 +1261,13 @@ struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
> hdmi->phy.ops = plat_data->phy_ops;
> hdmi->phy.data = plat_data->phy_data;
>
> + if (plat_data->ref_clk_rate) {
> + hdmi->ref_clk_rate = plat_data->ref_clk_rate;
> + } else {
> + hdmi->ref_clk_rate = 428571429;
> + dev_warn(dev, "Set ref_clk_rate to vendor default\n");
> + }
> +
> dw_hdmi_qp_init_hw(hdmi);
>
> ret = devm_request_threaded_irq(dev, plat_data->main_irq,
> diff --git a/include/drm/bridge/dw_hdmi_qp.h b/include/drm/bridge/dw_hdmi_qp.h
> index b4a9b739734ec7b67013b683fe6017551aa19172..76ecf31301997718604a05f70ce9eab8695e26b5 100644
> --- a/include/drm/bridge/dw_hdmi_qp.h
> +++ b/include/drm/bridge/dw_hdmi_qp.h
> @@ -24,6 +24,7 @@ struct dw_hdmi_qp_plat_data {
> void *phy_data;
> int main_irq;
> int cec_irq;
> + unsigned long ref_clk_rate;
> };
>
> struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
>
>
next prev parent reply other threads:[~2025-10-15 15:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 18:50 [PATCH v4 0/6] Add HDMI CEC support to Rockchip RK3588/RK3576 SoCs Cristian Ciocaltea
2025-09-03 18:50 ` [PATCH v4 1/6] drm/bridge: dw-hdmi-qp: Add CEC support Cristian Ciocaltea
2025-09-03 18:51 ` [PATCH v4 2/6] drm/bridge: dw-hdmi-qp: Fixup timer base setup Cristian Ciocaltea
2025-10-15 15:44 ` Heiko Stübner [this message]
2025-10-15 16:33 ` Daniel Stone
2025-09-03 18:51 ` [PATCH v4 3/6] drm/rockchip: dw_hdmi_qp: Improve error handling with dev_err_probe() Cristian Ciocaltea
2025-09-03 18:51 ` [PATCH v4 4/6] drm/rockchip: dw_hdmi_qp: Provide CEC IRQ in dw_hdmi_qp_plat_data Cristian Ciocaltea
2025-09-03 18:51 ` [PATCH v4 5/6] drm/rockchip: dw_hdmi_qp: Provide ref clock rate " Cristian Ciocaltea
2025-09-03 18:51 ` [PATCH v4 6/6] arm64: defconfig: Enable DW HDMI QP CEC support Cristian Ciocaltea
2025-09-03 19:52 ` [PATCH v4 0/6] Add HDMI CEC support to Rockchip RK3588/RK3576 SoCs Cristian Ciocaltea
2025-10-14 15:15 ` Cristian Ciocaltea
2025-09-04 23:48 ` Dmitry Baryshkov
2025-09-05 6:32 ` Cristian Ciocaltea
2025-09-05 14:27 ` Dmitry Baryshkov
2025-10-15 20:31 ` (subset) " Heiko Stuebner
2025-10-15 20:33 ` Heiko Stuebner
2025-10-28 12:38 ` Mark Brown
2025-10-28 12:42 ` Cristian Ciocaltea
2025-10-28 14:57 ` Cristian Ciocaltea
2025-10-28 15:08 ` Mark Brown
2025-10-28 15:24 ` Cristian Ciocaltea
2025-10-28 15:35 ` Mark Brown
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=2753758.X9hSmTKtgW@diego \
--to=heiko@sntech.de \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=catalin.marinas@arm.com \
--cc=cristian.ciocaltea@collabora.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hjc@rock-chips.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).