Re: [PATCH v3 3/3] ASoC: qcom: sc8280xp: add Ayaneo Pocket S2 card with special WSA channel mapping

Mark Brown <[email protected]>
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 10:46:45AM +0200, Neil Armstrong wrote:
> The WSA Speakers are connected on the WSA2 interface, but the
> WSA and WSA2 links are handled as a single dai and DSP interface, so
> we need to specify the channel mapping of the Ayaneo Pocket S2 for the
> WSA dai in order to have functional playback and avoid DSP errors.

> Let's add a special entry for the Ayaneo Pocket S2 adding a prepare
> callback in order to set the proper channel mapping.

> +static int ayaneo_ps2_snd_prepare(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
> +	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> +	unsigned int channels = substream->runtime->channels;
> +
> +	if (cpu_dai->id != WSA_CODEC_DMA_RX_0)
> +		return 0;
> +
> +	if (channels != 2)
> +		return -EINVAL;

Do we need some constraints somewhere (perhaps it's already taken care
of and I didn't notice)?
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpo5r0ACgkQJNaLcl1U
h9ApEwf/cMtCjuOeRWOP9jWg2lvfirrItfAoU6URYMUzcUIFA09zxOg+Lx4HBOTJ
aoxrTGbmDTNRBcvMrDt4UjeoNTs0RGPUveJrZ5uSes5H4KF24n3TCjsQmCf+trEC
I83Xty1Izca0t5p01078i8GYnesbuIDbWsl0D/1gM0IWBv7FPwJqAQuf6O8k4lex
sPepmfQis/plWGA57UlBb0tZk2Q1sVTx2hM2txpWZ/20ZG+AtPSc3IqlSyLUN+KZ
0h+reN2im2Wc7Dik1zXWf5EYagZqSlEXkYPK8ySDR8P7O32VGewuiu/cU1igNi7w
NXOewCVmvBkN5ba2BedUfERW1LqXdg==
=sSMk
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.