[PATCH V2 07/13] ASoC: amd: acp: add DMIC components string for SOF SoundWire machine driver
From: Vijendar Mukunda
Date: Thu Oct 22 2026 - 02:11:35 EST
Append "mic:acp-dmic cfg-mics:N" to card->components in mc_probe()
when a DMIC DAI link will be registered, keeping the components string
consistent with what sof_card_dai_links_create() actually creates.
Gate on the same three-way condition used in sof_card_dai_links_create()
(ASOC_SDW_ACP_DMIC quirk, mach_params->dmic_num, or amd_ctx->pdm_sel)
and suppress when ctx->ignore_internal_dmic is set. Use
mach_params->dmic_num for the mic count when platform-reported; fall
back to 1 for quirk and pdm_sel paths.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
---
sound/soc/amd/acp/acp-sdw-sof-mach.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c
index b6ccf618773a0..d7d9e24b82930 100644
--- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c
@@ -406,7 +406,7 @@ static int mc_probe(struct platform_device *pdev)
struct snd_soc_card *card;
struct amd_mc_ctx *amd_ctx;
struct asoc_sdw_mc_private *ctx;
- int amp_num = 0, i;
+ int amp_num = 0, i, dmic_num;
int ret;
amd_ctx = devm_kzalloc(&pdev->dev, sizeof(*amd_ctx), GFP_KERNEL);
@@ -489,6 +489,17 @@ static int mc_probe(struct platform_device *pdev)
if (!card->components)
return -ENOMEM;
+ if ((sof_sdw_quirk & ASOC_SDW_ACP_DMIC || mach->mach_params.dmic_num ||
+ amd_ctx->pdm_sel) && !ctx->ignore_internal_dmic) {
+ dmic_num = mach->mach_params.dmic_num ? mach->mach_params.dmic_num : 1;
+ card->components = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+ "%s mic:acp-dmic cfg-mics:%d",
+ card->components,
+ dmic_num);
+ if (!card->components)
+ return -ENOMEM;
+ }
+
/* Register the card */
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) {
--
2.48.1