Skip to content

Commit

Permalink
ASoC: SOF: Intel: hda: enforce exclusion between HDaudio and SoundWire
Browse files Browse the repository at this point in the history
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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20210726182855.179943-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
plbossart authored and broonie committed Jul 27, 2021
1 parent 2635c22 commit 61bef9e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,16 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev)
int hda_sdw_startup(struct snd_sof_dev *sdev)
{
struct sof_intel_hda_dev *hdev;
struct snd_sof_pdata *pdata = sdev->pdata;

hdev = sdev->pdata->hw_pdata;

if (!hdev->sdw)
return 0;

if (pdata->machine && !pdata->machine->mach_params.link_mask)
return 0;

return sdw_intel_startup(hdev->sdw);
}

Expand Down Expand Up @@ -1002,6 +1006,14 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev)
hda_mach->mach_params.dmic_num = dmic_num;
pdata->machine = hda_mach;
pdata->tplg_filename = tplg_filename;

if (codec_num == 2) {
/*
* Prevent SoundWire links from starting when an external
* HDaudio codec is used
*/
hda_mach->mach_params.link_mask = 0;
}
}
}

Expand Down

0 comments on commit 61bef9e

Please sign in to comment.