Commit 775c1a4a authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: Intel: sof_sdw: move ignore_internal_dmic check earlier

dmic links will not be created if ctx->ignore_internal_dmic is set, and
dmic_num should be 0 in this case. Move ignore_internal_dmic check
earlier where dmic_num is set to get an accurate dmic_num.
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240827123215.258859-7-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 85b66359
...@@ -1102,8 +1102,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) ...@@ -1102,8 +1102,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
hdmi_num = SOF_PRE_TGL_HDMI_COUNT; hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
/* enable dmic01 & dmic16k */ /* enable dmic01 & dmic16k */
if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) {
dmic_num = 2; if (ctx->ignore_internal_dmic)
dev_warn(dev, "Ignoring PCH DMIC\n");
else
dmic_num = 2;
}
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
bt_num = 1; bt_num = 1;
...@@ -1148,14 +1152,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) ...@@ -1148,14 +1152,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
} }
/* dmic */ /* dmic */
if (dmic_num > 0) { if (dmic_num) {
if (ctx->ignore_internal_dmic) { ret = create_dmic_dailinks(card, &dai_links, &be_id);
dev_warn(dev, "Ignoring PCH DMIC\n"); if (ret)
} else { goto err_end;
ret = create_dmic_dailinks(card, &dai_links, &be_id);
if (ret)
goto err_end;
}
} }
/* HDMI */ /* HDMI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment