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

From: Neil Armstrong

Date: Fri Jul 31 2026 - 04:02:03 EST


On 7/28/26 19:28, Mark Brown wrote:
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)?

Yes channels are already constrained to 2 in the card driver:

132 static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
133 struct snd_pcm_hw_params *params)
134 {
...
142 rate->min = rate->max = 48000;
143 snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
144 channels->min = 2;
145 channels->max = 2;
...
158 return 0;
159 }

Neil