drm/rockchip: dw_hdmi: Hold a reference to the dw-hdmi bridge

Take a reference on the dw-hdmi bridge during bind and drop it again
from unbind to ensure the bridge is kept alive for the lifetime of the
encoder component.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Heiko Stuebner <heiko@sntech.de> #rk3328
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260518193748.2482823-6-jonas@kwiboo.se
This commit is contained in:
Jonas Karlman 2026-05-18 19:37:39 +00:00 committed by Heiko Stuebner
parent c19830fba3
commit f80fa58179

View File

@ -79,6 +79,7 @@ struct rockchip_hdmi {
struct clk *hdmiphy_clk;
struct clk *ref_clk;
struct clk *grf_clk;
struct drm_bridge *bridge;
struct dw_hdmi *hdmi;
struct phy *phy;
};
@ -611,6 +612,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
return dev_err_probe(dev, PTR_ERR(hdmi->hdmi),
"failed to probe dw-hdmi bridge\n");
hdmi->bridge = of_drm_find_and_get_bridge(np);
if (!hdmi->bridge) {
dw_hdmi_unbind(hdmi->hdmi);
return dev_err_probe(dev, -ENODEV,
"failed to find dw-hdmi bridge\n");
}
return 0;
}
@ -619,6 +627,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
{
struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
drm_bridge_put(hdmi->bridge);
dw_hdmi_unbind(hdmi->hdmi);
}