summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2024-05-03 08:32:51 -0500
committerMark Brown <broonie@kernel.org>2024-05-05 23:45:35 +0900
commit5a7543d0ca01d68d992f480d151efd693807e0ce (patch)
treed9fc6bf967062c5509d69bc89490b10857fee07a /sound
parent9723cab054d59d770cd1927f92fe315c26cc6a78 (diff)
downloadlinux-stable-5a7543d0ca01d68d992f480d151efd693807e0ce.tar.gz
linux-stable-5a7543d0ca01d68d992f480d151efd693807e0ce.tar.bz2
linux-stable-5a7543d0ca01d68d992f480d151efd693807e0ce.zip
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: https://github.com/thesofproject/linux/issues/4962 Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20240503133253.108201-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sof/intel/hda.c9
-rw-r--r--sound/soc/sof/intel/hda.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index d509cfa38a64..6c10eb2c8241 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1809,6 +1809,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
u32 interface_mask = hda_get_interface_mask(sdev);
struct snd_sof_pdata *sof_pdata = sdev->pdata;
const struct sof_dev_desc *desc = sof_pdata->desc;
+ struct hdac_bus *bus = sof_to_bus(sdev);
struct snd_soc_acpi_mach *mach = NULL;
enum snd_soc_acpi_intel_codec codec_type;
const char *tplg_filename;
@@ -1981,8 +1982,12 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
}
}
- /* If I2S fails, try SoundWire if it is supported */
- if (!mach && (interface_mask & BIT(SOF_DAI_INTEL_ALH)))
+ /*
+ * If I2S fails and no external HDaudio codec is detected,
+ * try SoundWire if it is supported
+ */
+ if (!mach && !HDA_EXT_CODEC(bus->codec_mask) &&
+ (interface_mask & BIT(SOF_DAI_INTEL_ALH)))
mach = hda_sdw_machine_select(sdev);
/*
diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h
index 7804c5b50c26..8b495264f23d 100644
--- a/sound/soc/sof/intel/hda.h
+++ b/sound/soc/sof/intel/hda.h
@@ -454,6 +454,8 @@
#define SSP_SET_SFRM_CONSUMER BIT(24)
#define SSP_SET_CBP_CFP (SSP_SET_SCLK_CONSUMER | SSP_SET_SFRM_CONSUMER)
+#define HDA_EXT_ADDR 0
+#define HDA_EXT_CODEC(x) ((x) & BIT(HDA_EXT_ADDR))
#define HDA_IDISP_ADDR 2
#define HDA_IDISP_CODEC(x) ((x) & BIT(HDA_IDISP_ADDR))