From: sashiko-bot@kernel.org
To: "Mohammad Rafi Shaik" <mohammad.rafi.shaik@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v7 5/9] ASoC: qcom: lpass-va-macro: Add SoundWire microphone support
Date: Sun, 22 Nov 2026 18:55:08 +0000 [thread overview]
Message-ID: <sashiko-outbox-228210@kernel.org> (raw)
In-Reply-To: <20261123-add_shikra_support-v7-5-7bf3aa089fc6@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: qcom: lpass-va-macro: stale ADC_DMIC_SEL on live VA
DECn MUX switch
--
commit 06032519fa34bd074b11bdad3a1dc60749b48edd
Author: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
ASoC: qcom: lpass-va-macro: Add SoundWire microphone support
This commit adds DAPM mux widgets, routes, and decimator configuration logic
to allow VA decimators to capture audio from SoundWire microphone inputs in
addition to DMIC inputs.
> diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
> index 2401006387445..8ed8420d7185b 100644
> --- a/sound/soc/codecs/lpass-va-macro.c
> +++ b/sound/soc/codecs/lpass-va-macro.c
[ ... ]
> @@ -843,10 +859,24 @@ static int va_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
> return -EINVAL;
> }
>
> - if (val != 0)
> + /*
> + * SMIC enums use shift 0 (lower nibble of CFG0), DMIC enums use
> + * shift 4 (upper nibble of CFG0). Use e->shift_l to distinguish them
> + * without relying on widget name comparisons.
> + */
> + smic_mux = (e->shift_l == 0);
> +
> + /*
> + * Both muxes feed the same decimator and share ADC_DMIC_SEL, so only
> + * the one the decimator is routed through may program it. A write to
> + * the mux that is not part of the active path would otherwise switch
> + * the input domain of a running capture.
> + */
> + if (val != 0 && smic_mux == is_amic_enabled(component, decimator))
> snd_soc_component_update_bits(component, mic_sel_reg,
> CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> - CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);
> + smic_mux ? CDC_VA_TX_PATH_ADC_DMIC_SEL_ADC :
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);
>
> return snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
> }
> @@ -1036,7 +1066,6 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
> u16 tx_gain_ctl_reg;
> u16 adpt_ctrl_reg;
> u8 hpf_cut_off_freq;
> -
> struct va_macro *va = snd_soc_component_get_drvdata(comp);
>
> decimator = w->shift;
> @@ -1053,6 +1082,18 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
>
> switch (event) {
> case SND_SOC_DAPM_PRE_PMU:
> + /*
> + * ADC_DMIC_SEL is shared by the DMIC and the SoundWire mic
> + * mux, so its value depends on the order in which userspace
> + * restores the two controls. Program it from the resolved
> + * mux state of this decimator, which is what selects the
> + * input domain.
> + */
> + snd_soc_component_update_bits(comp, dec_cfg_reg,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> + is_amic_enabled(comp, decimator) ?
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_ADC :
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);
[Severity: Medium]
Can switching VA DEC0 MUX..VA DEC3 MUX between VA_DMIC and SWR_MIC during an
active capture leave CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK stale?
If both VA DMIC MUXn and VA SMIC MUXn already have non-ZERO inputs selected
(for example, when userspace pre-configures the target sub-mux before
switching VA DECn MUX), va_macro_put_dec_enum() skips updating ADC_DMIC_SEL
for the inactive sub-mux because smic_mux != is_amic_enabled(). When VA DECn
MUX is then switched to that sub-mux while capture is running, both the old
and new upstream paths have connected input endpoints, so VA DECn MUX stays
powered and does not re-run SND_SOC_DAPM_PRE_PMU in va_macro_enable_dec().
Because va_dec0_mux..va_dec3_mux use plain SOC_DAPM_ENUM() without a put
callback or SND_SOC_DAPM_POST_REG event, ADC_DMIC_SEL remains stuck on the
previous input domain until the stream restarts or the active sub-mux is
written again.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123-add_shikra_support-v7-0-7bf3aa089fc6@oss.qualcomm.com?part=5
next prev parent reply other threads:[~2026-11-22 18:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 18:41 [PATCH v7 0/9] ASoC: qcom: Add shikra and Hawi LPASS macro support Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 1/9] ASoC: dt-bindings: qcom: Add Shikra RX and VA macro codecs Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 2/9] ASoC: qcom: lpass-macro-common: Add missing v2.9 version string Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 3/9] ASoC: qcom: lpass-rx-macro: Add shikra compatible Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 4/9] ASoC: qcom: lpass-va-macro: " Mohammad Rafi Shaik
2026-11-22 19:01 ` sashiko-bot
2026-11-22 18:41 ` [PATCH v7 5/9] ASoC: qcom: lpass-va-macro: Add SoundWire microphone support Mohammad Rafi Shaik
2026-11-22 18:55 ` sashiko-bot [this message]
2026-11-22 18:41 ` [PATCH v7 6/9] ASoC: dt-bindings: qcom: Add Hawi LPASS macro codecs Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 7/9] ASoC: dt-bindings: qcom: Add Maili " Mohammad Rafi Shaik
2026-11-22 18:41 ` [PATCH v7 8/9] ASoC: qcom: lpass-tx-macro: Add support for Hawi Mohammad Rafi Shaik
2026-11-22 19:00 ` sashiko-bot
2026-11-22 18:41 ` [PATCH v7 9/9] ASoC: qcom: lpass: " Mohammad Rafi Shaik
2026-11-22 18:57 ` sashiko-bot
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=sashiko-outbox-228210@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mohammad.rafi.shaik@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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