From: Mark Brown <broonie@kernel.org>
To: Abel Vesa <abel.vesa@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: qcom: x1e80100: Allow userspace WSA RX channel map override
Date: Wed, 10 Jun 2026 17:00:18 +0100 [thread overview]
Message-ID: <aimKEkWqIG5ml1st@sirena.co.uk> (raw)
In-Reply-To: <20260610-sound-qcom-x1e80100-allow-ucm-channel-map-v1-1-9339724994f5@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]
On Wed, Jun 10, 2026 at 02:16:04PM +0300, Abel Vesa wrote:
> The WSA RX slot mapping is currently computed entirely from the channel
> count in .prepare() and pushed unconditionally via
> snd_soc_dai_set_channel_map(). Userspace has no way to express a different
> channel map, so any map defined in UCM is ignored.
> Add a writable "Playback Channel Map" control on the WSA RX PCM via
> snd_pcm_add_chmap_ctls() and make it writable. The map selected by
> userspace (SNDRV_CHMAP_*) is stored per AFE port and, at .prepare()
> time, translated into the q6 PCM_CHANNEL_* slots and programmed into the
> DSP.
> When userspace has not provided a full map, the previous default
> mapping is used, so existing behaviour is preserved.
> +static int x1e80100_chmap_ctl_put(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
> + struct snd_soc_pcm_runtime *rtd = info->pcm->private_data;
> + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> + struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
> + unsigned int *map = data->user_chmap[cpu_dai->id];
> + int i;
> +
> + for (i = 0; i < info->max_channels; i++) {
> + unsigned int pos = ucontrol->value.integer.value[i];
> +
> + /* Validate every requested non-unset position up front. */
> + if (pos && x1e80100_chmap_to_q6(pos) < 0)
> + return -EINVAL;
> +
> + map[i] = pos;
> + }
> +
> + return 0;
This should return 1 if the value changed.
> @@ -34,6 +125,9 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd)
> switch (cpu_dai->id) {
> case WSA_CODEC_DMA_RX_0:
> case WSA_CODEC_DMA_RX_1:
> + if (!rtd->pcm)
> + return 0;
> +
> /*
> * Set limit of -3 dB on Digital Volume and 0 dB on PA Volume
> * to reduce the risk of speaker damage until we have active
This hunk seems unrelated, I can't see anything about it in the commit
log either? I'm a bit confused about what this aims to achieve, I've
not checked which it is but either we should always have created the
PCMs here or we will never have created the PCMs here, it's weird that
this might vary.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-06-10 16:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 11:16 Abel Vesa
2026-06-10 16:00 ` Mark Brown [this message]
2026-06-11 8:58 ` Srinivas Kandagatla
2026-06-11 9:00 ` Srinivas Kandagatla
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=aimKEkWqIG5ml1st@sirena.co.uk \
--to=broonie@kernel.org \
--cc=abel.vesa@oss.qualcomm.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=perex@perex.cz \
--cc=srini@kernel.org \
--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
all inboxes | Powered by JetHome®