From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org,
rfoss@kernel.org, Laurent.pinchart@ideasonboard.com,
jonas@kwiboo.se, jernej.skrabec@gmail.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
lumag@kernel.org, dianders@chromium.org,
cristian.ciocaltea@collabora.com, luca.ceresoli@bootlin.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
victor.liu@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de,
devicetree@vger.kernel.org, l.stach@pengutronix.de,
perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
Shengjiu Wang <shengjiu.wang@nxp.com>
Subject: Re: [PATCH v3 5/6] drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface
Date: Thu, 07 Aug 2025 08:48:35 +0200 [thread overview]
Message-ID: <3006103.e9J7NaK4W3@steina-w> (raw)
In-Reply-To: <CAA+D8AMqBqfRuR7oGLwH4CUrAdY4q1XGmnPXGQYUGndY0eS=yw@mail.gmail.com>
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.stein@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/
next prev parent reply other threads:[~2025-08-07 6:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 10:47 [PATCH v3 0/6] drm/bridge: imx: Add HDMI PAI driver on i.MX8MP Shengjiu Wang
2025-08-04 10:47 ` [PATCH v3 1/6] dt-bindings: display: imx: add HDMI PAI for i.MX8MP Shengjiu Wang
2025-08-05 6:35 ` Krzysztof Kozlowski
2025-08-04 10:47 ` [PATCH v3 2/6] ALSA: Add definitions for the bits in IEC958 subframe Shengjiu Wang
2025-08-04 10:47 ` [PATCH v3 3/6] drm/bridge: dw-hdmi: Add API dw_hdmi_to_plat_data() to get plat_data Shengjiu Wang
2025-08-05 9:00 ` Liu Ying
2025-08-04 10:47 ` [PATCH v3 4/6] drm/bridge: dw-hdmi: Add API dw_hdmi_set_sample_iec958() for iec958 format Shengjiu Wang
2025-08-04 10:47 ` [PATCH v3 5/6] drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface Shengjiu Wang
2025-08-05 7:09 ` Alexander Stein
2025-08-06 3:49 ` Shengjiu Wang
2025-08-07 6:48 ` Alexander Stein [this message]
2025-08-07 7:42 ` Shengjiu Wang
2025-08-05 8:56 ` Liu Ying
2025-08-06 5:42 ` Shengjiu Wang
2025-08-06 6:54 ` Liu Ying
2025-08-07 10:58 ` Shengjiu Wang
2025-08-08 6:34 ` Liu Ying
2025-08-08 6:45 ` Shengjiu Wang
2025-08-08 7:50 ` Liu Ying
2025-08-08 7:52 ` Shengjiu Wang
2025-08-06 6:00 ` Shengjiu Wang
2025-08-06 7:54 ` Liu Ying
2025-08-05 14:50 ` kernel test robot
2025-08-04 10:47 ` [PATCH v3 6/6] arm64: dts: imx8mp: Add hdmi parallel audio interface node Shengjiu Wang
2025-08-05 7:10 ` Alexander Stein
2025-08-06 3:49 ` Shengjiu Wang
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=3006103.e9J7NaK4W3@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=conor+dt@kernel.org \
--cc=cristian.ciocaltea@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=perex@perex.cz \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=simona@ffwll.ch \
--cc=tiwai@suse.com \
--cc=tzimmermann@suse.de \
--cc=victor.liu@nxp.com \
/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