Skip to content

Commit 9da0ed4

Browse files
committed
ASoC: Intel: don't check number of sdw links when set
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>: Currently, we assume that the PCH DMIC pins are pin-muxed with SoundWire links. However, we do see a HW design that use PCH DMIC along with 3 SoundWire links. Remove the check and add warning to let users know that SoundWire MIC and PCH DMIC are both present and they could overwrite it with kernel params.
2 parents 769c1b7 + 4bcef04 commit 9da0ed4

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
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

sound/soc/sof/intel/hda.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,22 +1312,8 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
13121312
/* report to machine driver if any DMICs are found */
13131313
mach->mach_params.dmic_num = check_dmic_num(sdev);
13141314

1315-
if (sdw_mach_found) {
1316-
/*
1317-
* DMICs use up to 4 pins and are typically pin-muxed with SoundWire
1318-
* link 2 and 3, or link 1 and 2, thus we only try to enable dmics
1319-
* if all conditions are true:
1320-
* a) 2 or fewer links are used by SoundWire
1321-
* b) the NHLT table reports the presence of microphones
1322-
*/
1323-
if (hweight_long(mach->link_mask) <= 2)
1324-
dmic_fixup = true;
1325-
else
1326-
mach->mach_params.dmic_num = 0;
1327-
} else {
1328-
if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER)
1329-
dmic_fixup = true;
1330-
}
1315+
if (sdw_mach_found || mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER)
1316+
dmic_fixup = true;
13311317

13321318
if (tplg_fixup &&
13331319
dmic_fixup &&

0 commit comments

Comments
 (0)