From c7c6a4a1058f393488060c323540aacd422b7577 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Wed, 13 Nov 2024 09:33:29 +0800 Subject: [PATCH] ASoC: Intel: sof_sdw: correct mach_params->dmic_num mach_params->dmic_num will be used to set the cfg-mics value of card->components string which should be the dmic channels. And dmic_num is the number of the dmic dai links which is always 2. Only overwrite mach_params->dmic_num when mach_params->dmic_num is 0 and dmic_num is set. Fixes: 7db9f6361170 ("ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num") Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_sdw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index ac7bf2b7e3edbb..df67232ce898c6 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1141,9 +1141,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) } /* * mach_params->dmic_num will be used to set the cfg-mics value of card->components - * string. Overwrite it to the actual number of PCH DMICs used in the device. + * string. And dmic_num is the number of the dmic dai links. Overwrite it if dmic_num + * is set because of the SOC_SDW_PCH_DMIC quirk. */ - mach_params->dmic_num = dmic_num; + mach_params->dmic_num = mach_params->dmic_num ? mach_params->dmic_num : dmic_num; if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) bt_num = 1;