Re: [PATCH v7 2/2] ASoC: airoha: Add support for AN7581 PCM driver

From: Andreas Gnau

Date: Thu Nov 26 2026 - 17:34:16 EST


Hi Christian,

On 21/11/2026 00:46, Christian Marangi wrote:
The Airoha AN7581 SoC provides a PCM interface for VoIP applications,
supporting playback and capture at sample rates of 8 kHz and 16 kHz.
The driver configures the PCM bit clock to 2.048 KHz and supports
8-bit and 16-bit samples, with up to 32 channels.

Add an ASoC platform driver for the AN7581 PCM controller configured for
ZSI attached voice chip.

Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
---
MAINTAINERS | 7 +
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 1 +
sound/soc/airoha/Kconfig | 11 +
sound/soc/airoha/Makefile | 3 +
sound/soc/airoha/an7581-pcm.c | 929 ++++++++++++++++++++++++++++++++++
6 files changed, 952 insertions(+)
create mode 100644 sound/soc/airoha/Kconfig
create mode 100644 sound/soc/airoha/Makefile
create mode 100644 sound/soc/airoha/an7581-pcm.c


> <snip>

+ if ((unsigned long)rate * channels * bit_width > AN7581_PCM_DEFAULT_BCLK * HZ_PER_KHZ) {
+ dev_err(rtd->card->dev,
+ "%u channels at %u Hz and %d-bit exceed %u KHz BCLK\n",
+ channels, rate, bit_width,
+ AN7581_PCM_DEFAULT_BCLK);
+ mutex_unlock(&priv->user_lock);
+ return -EINVAL;
+ }
+
+ if (priv->users <= 1) {
+ /* one bit delay for ZSI */
+ regmap_set_bits(priv->map, AN7581_PCM_PICR, AN7581_PCM_ONE_BIT_DELAY);

Sorry for coming so late with this and maybe it is not a big issue and maybe you already thought about this:

ZSI (Zarlink Serial Interface) is a Microsemi/Microchip/Zarlink protocol that multiplexes the control channel of the SLIC over the PCM pins.
Assuming that a conventionally connected SLIC (i.e. control via SPI and voice via plain PCM) does not require this "one bit delay for ZSI", how would we add support for it, without introducing a regression for ZSI-attached SLICs? I mean, there is nothing in the device-tree telling the driver that there is a SLIC attached via ZSI and this code here suggests that the driver hardcodes some behaviour only desired when ZSI rather than plain PCM+SPI is used.

Best Regards,
Andreas Gnau