Re: [RFC PATCH] sound: airoha: add support for AN7581 PCM driver
From: Philipp Zabel
Date: Thu Oct 09 2025 - 04:33:32 EST
Hi Christian,
On Fr, 2025-10-03 at 03:54 +0200, Christian Marangi wrote:
> The Airoha AN7581 SoC have alternative Sound Card that expose PCM OPs
> dedicated for VoIP application.
>
> Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
> ---
> sound/Kconfig | 2 +
> sound/Makefile | 2 +-
> sound/airoha/Kconfig | 9 +
> sound/airoha/Makefile | 3 +
> sound/airoha/an7581-pcm.c | 637 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 652 insertions(+), 1 deletion(-)
> create mode 100644 sound/airoha/Kconfig
> create mode 100644 sound/airoha/Makefile
> create mode 100644 sound/airoha/an7581-pcm.c
>
[...]
> diff --git a/sound/airoha/an7581-pcm.c b/sound/airoha/an7581-pcm.c
> new file mode 100644
> index 000000000000..bf1fc447aed4
> --- /dev/null
> +++ b/sound/airoha/an7581-pcm.c
> @@ -0,0 +1,637 @@
[...]
> +static int an7581_pcm_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct an7581_pcm_priv *priv;
> + struct snd_card *card;
> + struct snd_pcm *pcm;
> + int irq;
> + int ret;
> +
> + ret = snd_devm_card_new(dev, 1, "AN7581 PCM SOUND",
> + THIS_MODULE, 0, &card);
> + if (ret)
> + return ret;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->map = device_node_to_regmap(dev->of_node);
> + if (!IS_ERR(priv->map))
> + return PTR_ERR(priv->map);
> +
> + priv->reset = devm_reset_control_get_exclusive(dev, "pcm1");
Is there more than one reset input per PCM module?
Lookup by name is only needed if there are multiple resets.
This question should be answered by a device tree binding document for
airoha,an7581-pcm.
regards
Philipp