[PATCH v4 09/16] ASoC: amd: acp: move ignore_internal_dmic gate to DMIC enable condition
From: Vijendar Mukunda
Date: Fri Oct 30 2026 - 05:54:40 EST
Move the ignore_internal_dmic check from inside the dmic_num > 0 block
to the DMIC enable condition itself. This eliminates the dead if/else
inside the dmic_num > 0 block - when dmic_num is set,
create_dmic_dailinks() is always called. Demote the suppression message
from dev_warn to dev_dbg since ignoring the ACP DMIC in favour of a
SoundWire DMIC codec is expected behaviour, not a warning condition.
For platforms where ignore_internal_dmic is true, the behaviour
changes from emitting a dev_warn inside the dmic_num > 0 block to
silent suppression at the gate where dmic_num stays zero. This is
intentional: ignoring the ACP DMIC in favour of a SoundWire DMIC
codec is expected behaviour, not a warning condition.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
---
sound/soc/amd/acp/acp-sdw-sof-mach.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c
index 9024e789d746..3366f668d819 100644
--- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c
@@ -352,8 +352,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
/* enable dmic */
if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach_params->dmic_num ||
- amd_ctx->pdm_sel)
- dmic_num = 1;
+ amd_ctx->pdm_sel) {
+ if (ctx->ignore_internal_dmic)
+ dev_dbg(dev, "ACP DMIC suppressed by SoundWire DMIC\n");
+ else
+ dmic_num = 1;
+ }
dev_dbg(dev, "sdw %d, dmic %d", sdw_be_num, dmic_num);
@@ -384,13 +388,9 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
/* dmic */
if (dmic_num > 0) {
- if (ctx->ignore_internal_dmic) {
- dev_warn(dev, "Ignoring ACP DMIC\n");
- } else {
- ret = create_dmic_dailinks(card, &dai_links, &be_id, 1);
- if (ret)
- return ret;
- }
+ ret = create_dmic_dailinks(card, &dai_links, &be_id, 1);
+ if (ret)
+ return ret;
}
WARN_ON(codec_conf != card->codec_conf + card->num_configs);
--
2.53.0