Skip to content

Commit 4bcef04

Browse files
bardliaobroonie
authored andcommitted
ASoC: Intel: sof_sdw: warn both sdw and pch dmic are used
Typically, SoundWire MIC and PCH DMIC will not coexist. However, we may want to use both of them in some special cases. Add a warning to let users know that SoundWire MIC and PCH DMIC are both present and they could overwrite it with kernel params. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://patch.msgid.link/20250225093716.67240-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 56a6772 commit 4bcef04

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sound/soc/intel/boards/sof_sdw.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,9 @@ static int create_sdw_dailink(struct snd_soc_card *card,
803803
int *be_id, struct snd_soc_codec_conf **codec_conf)
804804
{
805805
struct device *dev = card->dev;
806+
struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev);
806807
struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
808+
struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params;
807809
struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;
808810
struct asoc_sdw_endpoint *sof_end;
809811
int stream;
@@ -900,6 +902,11 @@ static int create_sdw_dailink(struct snd_soc_card *card,
900902

901903
codecs[j].name = sof_end->codec_name;
902904
codecs[j].dai_name = sof_end->dai_info->dai_name;
905+
if (sof_end->dai_info->dai_type == SOC_SDW_DAI_TYPE_MIC &&
906+
mach_params->dmic_num > 0) {
907+
dev_warn(dev,
908+
"Both SDW DMIC and PCH DMIC are present, if incorrect, please set kernel params snd_sof_intel_hda_generic dmic_num=0 to disable PCH DMIC\n");
909+
}
903910
j++;
904911
}
905912

0 commit comments

Comments
 (0)