Skip to content

Commit 5a7543d

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: Intel: discard SoundWire configuration if HDaudio codec is reported
The machine driver and topology selection starts with I2S, then SoundWire and last uses HDaudio as a fallback. That assumes that the ACPI information is correct but there are of course exceptions to the rule. On a Lenovo platform, an external HDaudio codec is detected, but the ACPI tables expose TWO RT711 jack codecs. This patch skips the SoundWire selection in case an external HDaudio codec is detected - which only works with the additional assumption that no one will mix HDaudio and SoundWire. Closes: thesofproject#4962 Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9723cab commit 5a7543d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
18091809
u32 interface_mask = hda_get_interface_mask(sdev);
18101810
struct snd_sof_pdata *sof_pdata = sdev->pdata;
18111811
const struct sof_dev_desc *desc = sof_pdata->desc;
1812+
struct hdac_bus *bus = sof_to_bus(sdev);
18121813
struct snd_soc_acpi_mach *mach = NULL;
18131814
enum snd_soc_acpi_intel_codec codec_type;
18141815
const char *tplg_filename;
@@ -1981,8 +1982,12 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
19811982
}
19821983
}
19831984

1984-
/* If I2S fails, try SoundWire if it is supported */
1985-
if (!mach && (interface_mask & BIT(SOF_DAI_INTEL_ALH)))
1985+
/*
1986+
* If I2S fails and no external HDaudio codec is detected,
1987+
* try SoundWire if it is supported
1988+
*/
1989+
if (!mach && !HDA_EXT_CODEC(bus->codec_mask) &&
1990+
(interface_mask & BIT(SOF_DAI_INTEL_ALH)))
19861991
mach = hda_sdw_machine_select(sdev);
19871992

19881993
/*

sound/soc/sof/intel/hda.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@
454454
#define SSP_SET_SFRM_CONSUMER BIT(24)
455455
#define SSP_SET_CBP_CFP (SSP_SET_SCLK_CONSUMER | SSP_SET_SFRM_CONSUMER)
456456

457+
#define HDA_EXT_ADDR 0
458+
#define HDA_EXT_CODEC(x) ((x) & BIT(HDA_EXT_ADDR))
457459
#define HDA_IDISP_ADDR 2
458460
#define HDA_IDISP_CODEC(x) ((x) & BIT(HDA_IDISP_ADDR))
459461

0 commit comments

Comments
 (0)