Re: [PATCH v4 5/8] ASoC: qcom: lpass-va-macro: Add SoundWire microphone support
From: Ajay Kumar Nandam
Date: Fri Sep 25 2026 - 05:23:36 EST
On 9/22/2026 3:12 PM, Mohammad Rafi Shaik wrote:
The VA decimators can currently capture audio only from DMIC inputs.
Add support for routing audio from SoundWire microphone (SMIC) inputs
as well.
Update the decimator source selection logic to switch between DMIC and
SMIC sources based on the active input path.
The ADC_DMIC_SEL bit of CDC_VA_TXn_TX_PATH_CFG0 is shared by the DMIC and
the SoundWire mic mux, so a mixer write to the mux that is not part of the
active path can leave it stale. Program it from the resolved mux state
when the decimator is enabled, so capture does not depend on the order in
which userspace restores the two controls.
Add a helper to detect whether a decimator is using a SoundWire microphone
input. Use this information to skip DMIC-specific HPF programming sequences
when the decimator is configured for an SMIC source.
This enables VA decimators to capture audio from either DMIC or SoundWire
microphone inputs.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>
---
+ if (!is_amic_enabled(comp, decimator))
+ snd_soc_component_update_bits(comp, hpf_gate_reg,
+ CDC_VA_TX_HPF_ZERO_GATE_MASK,
+ CDC_VA_TX_HPF_ZERO_GATE);
usleep_range(1000, 1010);
hpf_cut_off_freq = (snd_soc_component_read(comp, dec_cfg_reg) &
@@ -1046,7 +1079,6 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
0x0);
}
The commit message says the DMIC-specific HPF programming sequence is skipped for SMIC paths. However, this only skips the initial ZERO_GATE write; the cutoff programming and the later ZERO_GATE clear still run unconditionally.
Is only the ZERO_GATE assertion DMIC-specific, or should the whole HPF
set/program/clear sequence be under the same `!is_amic_enabled() condition?
Thanks
Ajay Kumar Nandam
-