summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>2025-09-03 21:51:03 +0300
committerHeiko Stuebner <heiko@sntech.de>2025-10-15 22:28:07 +0200
commit33ea4d520fbda505e2cfe5b36ebf522de1f3f5e9 (patch)
treef0c4fe944fef40519c0297c0a1b588aa08bbd1e2
parent9baa02327adf2b1e919e95af23036102cfd0133f (diff)
drm/rockchip: dw_hdmi_qp: Provide ref clock rate in dw_hdmi_qp_plat_data
In order to support correct initialization of the timer base in the HDMI QP IP block, setup platform data to include the required reference clock rate. While at it, ensure plat_data is zero-initialized in dw_hdmi_qp_rockchip_bind(). Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250903-rk3588-hdmi-cec-v4-5-fa25163c4b08@collabora.com
-rw-r--r--drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
index 9191a74a568f..931343b072ad 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
@@ -429,14 +429,15 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
void *data)
{
struct platform_device *pdev = to_platform_device(dev);
+ struct dw_hdmi_qp_plat_data plat_data = {};
const struct rockchip_hdmi_qp_cfg *cfg;
- struct dw_hdmi_qp_plat_data plat_data;
struct drm_device *drm = data;
struct drm_connector *connector;
struct drm_encoder *encoder;
struct rockchip_hdmi_qp *hdmi;
struct resource *res;
struct clk_bulk_data *clks;
+ struct clk *ref_clk;
int ret, irq, i;
if (!pdev->dev.of_node)
@@ -506,6 +507,14 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master,
if (ret < 0)
return dev_err_probe(hdmi->dev, ret, "Failed to get clocks\n");
+ ref_clk = clk_get(hdmi->dev, "ref");
+ if (IS_ERR(ref_clk))
+ return dev_err_probe(hdmi->dev, PTR_ERR(ref_clk),
+ "Failed to get ref clock\n");
+
+ plat_data.ref_clk_rate = clk_get_rate(ref_clk);
+ clk_put(ref_clk);
+
hdmi->enable_gpio = devm_gpiod_get_optional(hdmi->dev, "enable",
GPIOD_OUT_HIGH);
if (IS_ERR(hdmi->enable_gpio))