Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61bef9e

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire
On some platforms with an external HDaudio codec, the DSDT reports the presence of SoundWire devices. Pin-mux restrictions and board reworks usually prevent coexistence between the two types of links, let's prevent unnecessary operations from starting. In the case of a single iDISP codec being detected, we still start the links even if no SoundWire machine configuration was detected, so that we can double-check what the hardware is and add the missing configuration if applicable. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2635c22 commit 61bef9e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,16 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev)
187187
int hda_sdw_startup(struct snd_sof_dev *sdev)
188188
{
189189
struct sof_intel_hda_dev *hdev;
190+
struct snd_sof_pdata *pdata = sdev->pdata;
190191

191192
hdev = sdev->pdata->hw_pdata;
192193

193194
if (!hdev->sdw)
194195
return 0;
195196

197+
if (pdata->machine && !pdata->machine->mach_params.link_mask)
198+
return 0;
199+
196200
return sdw_intel_startup(hdev->sdw);
197201
}
198202

@@ -1002,6 +1006,14 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev)
10021006
hda_mach->mach_params.dmic_num = dmic_num;
10031007
pdata->machine = hda_mach;
10041008
pdata->tplg_filename = tplg_filename;
1009+
1010+
if (codec_num == 2) {
1011+
/*
1012+
* Prevent SoundWire links from starting when an external
1013+
* HDaudio codec is used
1014+
*/
1015+
hda_mach->mach_params.link_mask = 0;
1016+
}
10051017
}
10061018
}
10071019

0 commit comments

Comments
 (0)