Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Cyril Chao <Cyril.Chao@mediatek.com>,
	Darren Ye <darren.ye@mediatek.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Rosen Penev <rosenp@gmail.com>,
	bui duc phuc <phucduc.bui@gmail.com>,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v5 4/4] ASoC: airoha: Add AFE and machine driver for Airoha AN7581
Date: Sat, 8 Aug 2026 00:56:53 +0200	[thread overview]
Message-ID: <6a7662b8.6220df5f.3c6b34.4460@mx.google.com> (raw)
In-Reply-To: <8146f434-1e16-4ebd-80a4-b9c27bfa45af@sirena.org.uk>

On Fri, Aug 07, 2026 at 11:52:58PM +0100, Mark Brown wrote:
> On Fri, Aug 07, 2026 at 10:09:34PM +0200, Christian Marangi wrote:
> > Add support for the Sound system present on Airoha AN7581 SoC. This is
> > based on the mediatek AFE drivers.
> 
> > Also add the machine driver to create an actual sound card for the AFE.
> 
> This should be more patches, the machine driver should be a separate
> patch at a minimum.  Possibly PCM and ETDM drivers too.
> 

Sooo you are suggesting 3 patch? one for machine, one for basic pcm and one
for etdm?

> > +static int an7581_afe_pcm_dev_probe(struct platform_device *pdev)
> > +{
> > +	struct an7581_afe_private *afe_priv;
> > +	struct reset_control *reset;
> > +	struct mtk_base_afe *afe;
> > +	struct device *dev;
> > +	int i, irq_id, ret;
> > +	void *base;
> > +
> > +	afe = devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL);
> > +	if (!afe)
> > +		return -ENOMEM;
> 
> We allocate afe here with devm_kzalloc() so everything is zero...
> 
> > +	afe->irqs = devm_kcalloc(dev, afe->irqs_size, sizeof(*afe->irqs),
> > +				 GFP_KERNEL);
> > +	if (!afe->irqs)
> > +		return -ENOMEM;
> 
> ...then we allocate an array using a size read from the struct which must
> therefore have zero elements.  We also didn't assign dev, either we
> should assign it and use it consistently or we should drop it and use
> &pdev->dev like the first allocation.
>

Nono these were just my mistake with moving code... I already fixed them...
sorry for the mistake.
 
> > +	/* register component */
> > +	ret = devm_snd_soc_register_component(&pdev->dev,
> > +					      &mtk_afe_pcm_platform,
> > +					      NULL, 0);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Cannot register AFE component\n");
> > +
> > +	ret = devm_snd_soc_register_component(afe->dev,
> > +					      &an7581_afe_pcm_dai_component,
> > +					      afe->dai_drivers,
> > +					      afe->num_dai_drivers);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "Cannot register PCM DAI component\n");
> > +
> > +	platform_set_drvdata(pdev, afe);
> 
> The component registration might result in a card being instantiated so
> we need the driver data initialized before we try to register.

Sorry this was asked to be moved in the previous revision by another
review. I will revert following the pattern done in other AFE driver...

-- 
	Ansuel

  reply	other threads:[~2026-08-07 22:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 20:09 [PATCH v5 0/4] ASoC: Add support for Airoha AN7581 Christian Marangi
2026-08-07 20:09 ` [PATCH v5 1/4] ASoC: dt-bindings: Add Airoha AN7581 AFE Sound card Christian Marangi
2026-08-07 20:09 ` [PATCH v5 2/4] ASoC: dt-bindings: Add Airoha AN7581 AFE with WM8960 Codec schema Christian Marangi
2026-08-07 20:09 ` [PATCH v5 3/4] ASoC: mediatek: common: permit to provide dedicated regmap for irq Christian Marangi
2026-08-07 20:09 ` [PATCH v5 4/4] ASoC: airoha: Add AFE and machine driver for Airoha AN7581 Christian Marangi
2026-08-07 22:52   ` Mark Brown
2026-08-07 22:56     ` Christian Marangi [this message]
2026-08-07 23:05       ` Mark Brown

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=6a7662b8.6220df5f.3c6b34.4460@mx.google.com \
    --to=ansuelsmth@gmail.com \
    --cc=Cyril.Chao@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=darren.ye@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=phucduc.bui@gmail.com \
    --cc=robh@kernel.org \
    --cc=rosenp@gmail.com \
    --cc=tiwai@suse.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