Hi, Am Mittwoch, 6. August 2025, 05:49:13 CEST schrieb Shengjiu Wang: > On Tue, Aug 5, 2025 at 3:09 PM Alexander Stein > <alexander.st...@ew.tq-group.com> wrote: > [snip] > > > +static int imx8mp_dw_hdmi_bind(struct device *dev) > > > +{ > > > + struct dw_hdmi_plat_data *plat_data; > > > + struct imx8mp_hdmi *hdmi; > > > + int ret; > > > + > > > + hdmi = dev_get_drvdata(dev); > > > + plat_data = &hdmi->plat_data; > > > + > > > + ret = component_bind_all(dev, plat_data); > > > > Do you really need plat_data variable? > > yes, it is used in imx8mp_hdmi_pai_bind()
Sorry for not being clear. I'm not talking about struct dw_hdmi_plat_data, but the local variable plat_data. You can use ret = component_bind_all(dev, &hdmi->plat_data); directly. > > > > > > + if (ret) > > > + return dev_err_probe(dev, ret, "component_bind_all > > > failed!\n"); > > > + > > > + return 0; > > > +} > > > + > > > +static void imx8mp_dw_hdmi_unbind(struct device *dev) > > > +{ > > > + struct dw_hdmi_plat_data *plat_data; > > > + struct imx8mp_hdmi *hdmi; > > > + > > > + hdmi = dev_get_drvdata(dev); > > > + plat_data = &hdmi->plat_data; > > > + > > > + component_unbind_all(dev, plat_data); > > > > Do you really need plat_data variable? > > yes, it is used by imx8mp_hdmi_pai_unbind() Same as above. Call component_unbind_all(dev, &hdmi->plat_data) directly. Also consider assigning struct imx8mp_hdmi *hdmi = dev_get_drvdata(dev); directly. Best regards, Alexander > > > > > > +} > > > + > > > +static const struct component_master_ops imx8mp_dw_hdmi_ops = { > > > + .bind = imx8mp_dw_hdmi_bind, > > > + .unbind = imx8mp_dw_hdmi_unbind, > > > +}; > > > + > > > static int imx8mp_dw_hdmi_probe(struct platform_device *pdev) > > > { > > > struct device *dev = &pdev->dev; > > > struct dw_hdmi_plat_data *plat_data; > > > + struct component_match *match; > > > > Set match = NULL for drm_of_component_match_add (and subcalls) to allocate > > memory. > > Ok. > > best regards > Shengjiu wang. > > > > Best regards > > Alexander > > > > > + struct device_node *remote; > > > struct imx8mp_hdmi *hdmi; > > > + int ret; > > > > > > hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); > > > if (!hdmi) > > > @@ -108,6 +145,22 @@ static int imx8mp_dw_hdmi_probe(struct > > > platform_device *pdev) > > > > > > platform_set_drvdata(pdev, hdmi); > > > > > > + /* port@2 is for hdmi_pai device */ > > > + remote = of_graph_get_remote_node(pdev->dev.of_node, 2, 0); > > > + if (remote && of_device_is_available(remote)) { > > > + drm_of_component_match_add(dev, &match, > > > component_compare_of, remote); > > > + > > > + of_node_put(remote); > > > + > > > + ret = component_master_add_with_match(dev, > > > &imx8mp_dw_hdmi_ops, match); > > > + if (ret) > > > + dev_warn(dev, "Unable to register aggregate > > > driver\n"); > > > + /* > > > + * This audio function is optional for avoid blocking > > > display. > > > + * So just print warning message and no error is returned. > > > + */ > > > + } > > > + > > > return 0; > > > } > > > > > > @@ -115,6 +168,8 @@ static void imx8mp_dw_hdmi_remove(struct > > > platform_device *pdev) > > > { > > > struct imx8mp_hdmi *hdmi = platform_get_drvdata(pdev); > > > > > > + component_master_del(&pdev->dev, &imx8mp_dw_hdmi_ops); > > > + > > > dw_hdmi_remove(hdmi->dw_hdmi); > > > } > > > > > > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > > > index 095cdd9b7424..336f062e1f9d 100644 > > > --- a/include/drm/bridge/dw_hdmi.h > > > +++ b/include/drm/bridge/dw_hdmi.h > > > @@ -143,6 +143,12 @@ struct dw_hdmi_plat_data { > > > const struct drm_display_info > > > *info, > > > const struct drm_display_mode > > > *mode); > > > > > > + /* > > > + * priv_audio is specially used for additional audio device to get > > > + * driver data through this dw_hdmi_plat_data. > > > + */ > > > + void *priv_audio; > > > + > > > /* Platform-specific audio enable/disable (optional) */ > > > void (*enable_audio)(struct dw_hdmi *hdmi, int channel, > > > int width, int rate, int non_pcm, int iec958); > > > > > > > > > -- > > TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany > > Amtsgericht München, HRB 105018 > > Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider > > http://www.tq-group.com/ > > > > > -- TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider http://www.tq-group.com/