The enable_audio() and disable_audio() callback pointers are in
plat_data structure, and the audio device driver needs to get plat_data
for assign these pointers. So add a function to export plat_data
structure.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++++++
include/drm/bridge/dw_hdmi.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 76c6570e2a85..3dfa42178f6c 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -198,6 +198,12 @@ struct dw_hdmi {
enum drm_connector_status last_connector_result;
};
+const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi)
+{
+ return hdmi->plat_data;
+}
+EXPORT_SYMBOL_GPL(dw_hdmi_to_plat_data);
+
#define HDMI_IH_PHY_STAT0_RX_SENSE \
(HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \
HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3)
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index 6a46baa0737c..a56a3519a22a 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -208,4 +208,5 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi);
+const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi);
#endif /* __IMX_HDMI_H__ */
--
2.34.1
Hi Shengjiu, On 07/18/2025, Shengjiu Wang wrote: > The enable_audio() and disable_audio() callback pointers are in > plat_data structure, and the audio device driver needs to get plat_data > for assign these pointers. So add a function to export plat_data {enable,disable}_audio pointers are directly assigned to plat_data in patch 2, instead of using dw_hdmi_to_plat_data(). dw_hdmi_to_plat_data() is only used in patch 2 to get hdmi_pai pointer through pdata->priv_audio. const struct dw_hdmi_plat_data *pdata = dw_hdmi_to_plat_data(dw_hdmi); struct imx8mp_hdmi_pai *hdmi_pai = (struct imx8mp_hdmi_pai *)pdata->priv_audio; > structure. > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++++++ > include/drm/bridge/dw_hdmi.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 76c6570e2a85..3dfa42178f6c 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -198,6 +198,12 @@ struct dw_hdmi { > enum drm_connector_status last_connector_result; > }; > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi) > +{ > + return hdmi->plat_data; > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_to_plat_data); > + > #define HDMI_IH_PHY_STAT0_RX_SENSE \ > (HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \ > HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3) > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > index 6a46baa0737c..a56a3519a22a 100644 > --- a/include/drm/bridge/dw_hdmi.h > +++ b/include/drm/bridge/dw_hdmi.h > @@ -208,4 +208,5 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > > bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi); > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi); Nit: Add a blank line as it was here. > #endif /* __IMX_HDMI_H__ */ -- Regards, Liu Ying
On Tue, Jul 22, 2025 at 3:38 PM Liu Ying <victor.liu@nxp.com> wrote: > > Hi Shengjiu, > > On 07/18/2025, Shengjiu Wang wrote: > > The enable_audio() and disable_audio() callback pointers are in > > plat_data structure, and the audio device driver needs to get plat_data > > for assign these pointers. So add a function to export plat_data > > {enable,disable}_audio pointers are directly assigned to plat_data in patch 2, > instead of using dw_hdmi_to_plat_data(). dw_hdmi_to_plat_data() is only > used in patch 2 to get hdmi_pai pointer through pdata->priv_audio. > > const struct dw_hdmi_plat_data *pdata = dw_hdmi_to_plat_data(dw_hdmi); > struct imx8mp_hdmi_pai *hdmi_pai = (struct imx8mp_hdmi_pai *)pdata->priv_audio; > will update this commit message. > > structure. > > > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++++++ > > include/drm/bridge/dw_hdmi.h | 1 + > > 2 files changed, 7 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > index 76c6570e2a85..3dfa42178f6c 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -198,6 +198,12 @@ struct dw_hdmi { > > enum drm_connector_status last_connector_result; > > }; > > > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi) > > +{ > > + return hdmi->plat_data; > > +} > > +EXPORT_SYMBOL_GPL(dw_hdmi_to_plat_data); > > + > > #define HDMI_IH_PHY_STAT0_RX_SENSE \ > > (HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \ > > HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3) > > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > > index 6a46baa0737c..a56a3519a22a 100644 > > --- a/include/drm/bridge/dw_hdmi.h > > +++ b/include/drm/bridge/dw_hdmi.h > > @@ -208,4 +208,5 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > > > > bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi); > > > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi); > > Nit: Add a blank line as it was here. will add blank line best regards Shengjiu Wang > > > #endif /* __IMX_HDMI_H__ */ > > -- > Regards, > Liu Ying
On Fri, Jul 18, 2025 at 06:11:47PM +0800, Shengjiu Wang wrote: > The enable_audio() and disable_audio() callback pointers are in > plat_data structure, and the audio device driver needs to get plat_data > for assign these pointers. So add a function to export plat_data > structure. drm/bridge: dw-hdmi: Add API dw_hdmi_to_plat_data() to get plat_data Add API dw_hdmi_to_plat_data() to fetch plat_data because audo device driver needs it to enabe(disable)_audio(). Frank > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++++++ > include/drm/bridge/dw_hdmi.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index 76c6570e2a85..3dfa42178f6c 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -198,6 +198,12 @@ struct dw_hdmi { > enum drm_connector_status last_connector_result; > }; > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi) > +{ > + return hdmi->plat_data; > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_to_plat_data); > + > #define HDMI_IH_PHY_STAT0_RX_SENSE \ > (HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \ > HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3) > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > index 6a46baa0737c..a56a3519a22a 100644 > --- a/include/drm/bridge/dw_hdmi.h > +++ b/include/drm/bridge/dw_hdmi.h > @@ -208,4 +208,5 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > > bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi); > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi); > #endif /* __IMX_HDMI_H__ */ > -- > 2.34.1 >
On Sat, Jul 19, 2025 at 12:15 AM Frank Li <Frank.li@nxp.com> wrote: > > On Fri, Jul 18, 2025 at 06:11:47PM +0800, Shengjiu Wang wrote: > > The enable_audio() and disable_audio() callback pointers are in > > plat_data structure, and the audio device driver needs to get plat_data > > for assign these pointers. So add a function to export plat_data > > structure. > > drm/bridge: dw-hdmi: Add API dw_hdmi_to_plat_data() to get plat_data > > Add API dw_hdmi_to_plat_data() to fetch plat_data because audo device > driver needs it to enabe(disable)_audio(). Thanks for comments. will update it to the next version. best regards Shengjiu Wang > > Frank > > > > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ++++++ > > include/drm/bridge/dw_hdmi.h | 1 + > > 2 files changed, 7 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > index 76c6570e2a85..3dfa42178f6c 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -198,6 +198,12 @@ struct dw_hdmi { > > enum drm_connector_status last_connector_result; > > }; > > > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi) > > +{ > > + return hdmi->plat_data; > > +} > > +EXPORT_SYMBOL_GPL(dw_hdmi_to_plat_data); > > + > > #define HDMI_IH_PHY_STAT0_RX_SENSE \ > > (HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \ > > HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3) > > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > > index 6a46baa0737c..a56a3519a22a 100644 > > --- a/include/drm/bridge/dw_hdmi.h > > +++ b/include/drm/bridge/dw_hdmi.h > > @@ -208,4 +208,5 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data); > > > > bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi); > > > > +const struct dw_hdmi_plat_data *dw_hdmi_to_plat_data(struct dw_hdmi *hdmi); > > #endif /* __IMX_HDMI_H__ */ > > -- > > 2.34.1 > >
© 2016 - 2025 Red Hat, Inc.