Skip to contentSkip to conversation

ASoC: SOF/Intel: machine driver updates

PATCH In review Pierre-Louis Bossart 2 participants 6 messages Aug 2, 2021 – Aug 3, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ASoC: SOF/Intel: machine driver updates

Two quirks added for Dell XPS 9710 and Intel reference boards, and two minor cleanups.

Pierre-Louis Bossart (3):
ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710
ASoC: Intel: update sof_pcm512x quirks
ASoC: Intel: sof_sdw_max98373: remove useless inits

jairaj arava (1):
ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682
variant

 sound/soc/intel/boards/sof_pcm512x.c      | 13 +++++++++++--
 sound/soc/intel/boards/sof_rt5682.c       | 14 ++++++++++++++
 sound/soc/intel/boards/sof_sdw.c          | 12 ++++++++++++
 sound/soc/intel/boards/sof_sdw_max98373.c |  4 ++--
 sound/soc/sof/sof-pci-dev.c               |  9 +++++++++
 5 files changed, 48 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710

This device has the same audio subsystem as the 0A5E skew (RT711 headset codec, 2 RT1308 amps and RT715 for mic capture)

---
 sound/soc/intel/boards/sof_sdw.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
sound/soc/intel/boards/sof_sdw.c +12 -0
index b52418eea21d..6c946d7ee0a6 100644
@@ -129,6 +129,18 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 					RT711_JD2 |
 					SOF_RT715_DAI_ID_FIX),
 	},
+	{
+		/* Dell XPS 9710 */
+		.callback = sof_sdw_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5D")
+		},
+		.driver_data = (void *)(SOF_SDW_TGL_HDMI |
+					RT711_JD2 |
+					SOF_RT715_DAI_ID_FIX |
+					SOF_SDW_FOUR_SPK),
+	},
 	{
 		.callback = sof_sdw_quirk_cb,
 		.matches = {
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682 variant

In reply to Pierre-Louis Bossart

From: jairaj arava <[email protected]>

DMI product name is used to support system variants based on adl_mx98373_rt5682 in current implementation. Replace this DMI search with DMI_OEM_STRING and coreboot(BIOS used in these systems) is setting the needed DMI_OEM_STRING field to uniquely identify these systems.

---
 sound/soc/intel/boards/sof_rt5682.c | 14 ++++++++++++++
 sound/soc/sof/sof-pci-dev.c         |  9 +++++++++
 2 files changed, 23 insertions(+)
sound/soc/intel/boards/sof_rt5682.c +14 -0
index adfb4214f24b..f096bd6d69be 100644
@@ -162,6 +162,20 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = {
 					SOF_RT5682_SSP_AMP(2) |
 					SOF_RT5682_NUM_HDMIDEV(4)),
 	},
+	{
+		.callback = sof_rt5682_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alder Lake Client Platform"),
+			DMI_MATCH(DMI_OEM_STRING, "AUDIO-ADL_MAX98373_ALC5682I_I2S"),
+		},
+		.driver_data = (void *)(SOF_RT5682_MCLK_EN |
+					SOF_RT5682_SSP_CODEC(0) |
+					SOF_SPEAKER_AMP_PRESENT |
+					SOF_MAX98373_SPEAKER_AMP_PRESENT |
+					SOF_RT5682_SSP_AMP(2) |
+					SOF_RT5682_NUM_HDMIDEV(4)),
+	},
 	{}
 };
 
sound/soc/sof/sof-pci-dev.c +9 -0
index 03119462f9e2..bc9e70765678 100644
@@ -50,6 +50,15 @@ static const struct dmi_system_id sof_tplg_table[] = {
 		},
 		.driver_data = "sof-tgl-rt5682-ssp0-max98373-ssp2.tplg",
 	},
+	{
+		.callback = sof_tplg_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Alder Lake Client Platform"),
+			DMI_MATCH(DMI_OEM_STRING, "AUDIO-ADL_MAX98373_ALC5682I_I2S"),
+		},
+		.driver_data = "sof-adl-rt5682-ssp0-max98373-ssp2.tplg",
+	},
 	{}
 };
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 ASoC: Intel: update sof_pcm512x quirks

In reply to Pierre-Louis Bossart

The default SOF topology enables SSP capture and DMICs, even though both of these hardware capabilities are not always available in hardware (specific versions of HiFiberry and DMIC kit needed).

For the SSP capture, this leads to annoying "SP5-Codec: ASoC: no backend capture" and "streamSSP5-Codec: ASoC: no users capture at close - state 0" errors.

Update the quirks to match what the topology needs, which also allows for the ability to remove SSP capture and DMIC support.

---
 sound/soc/intel/boards/sof_pcm512x.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_pcm512x.c +11 -2
index 2ec9c62366e2..6815204e58d5 100644
@@ -26,11 +26,16 @@
 
 #define SOF_PCM512X_SSP_CODEC(quirk)		((quirk) & GENMASK(3, 0))
 #define SOF_PCM512X_SSP_CODEC_MASK			(GENMASK(3, 0))
+#define SOF_PCM512X_ENABLE_SSP_CAPTURE		BIT(4)
+#define SOF_PCM512X_ENABLE_DMIC			BIT(5)
 
 #define IDISP_CODEC_MASK	0x4
 
 /* Default: SSP5 */
-static unsigned long sof_pcm512x_quirk = SOF_PCM512X_SSP_CODEC(5);
+static unsigned long sof_pcm512x_quirk =
+	SOF_PCM512X_SSP_CODEC(5) |
+	SOF_PCM512X_ENABLE_SSP_CAPTURE |
+	SOF_PCM512X_ENABLE_DMIC;
 
 static bool is_legacy_cpu;
 
@@ -244,8 +249,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 	links[id].dpcm_playback = 1;
 	/*
 	 * capture only supported with specific versions of the Hifiberry DAC+
-	 * links[id].dpcm_capture = 1;
 	 */
+	if (sof_pcm512x_quirk & SOF_PCM512X_ENABLE_SSP_CAPTURE)
+		links[id].dpcm_capture = 1;
 	links[id].no_pcm = 1;
 	links[id].cpus = &cpus[id];
 	links[id].num_cpus = 1;
@@ -380,6 +386,9 @@ static int sof_audio_probe(struct platform_device *pdev)
 
 	ssp_codec = sof_pcm512x_quirk & SOF_PCM512X_SSP_CODEC_MASK;
 
+	if (!(sof_pcm512x_quirk & SOF_PCM512X_ENABLE_DMIC))
+		dmic_be_num = 0;
+
 	/* compute number of dai links */
 	sof_audio_card_pcm512x.num_links = 1 + dmic_be_num + hdmi_num;
 
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 ASoC: Intel: sof_sdw_max98373: remove useless inits

In reply to Pierre-Louis Bossart

No need to initialize a variable if the next line overwrites the value.

---
 sound/soc/intel/boards/sof_sdw_max98373.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_sdw_max98373.c +2 -2
index 25daef910aee..25f9065b627c 100644
@@ -90,7 +90,7 @@ static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enabl
 
 static int mx8373_sdw_prepare(struct snd_pcm_substream *substream)
 {
-	int ret = 0;
+	int ret;
 
 	/* according to soc_pcm_prepare dai link prepare is called first */
 	ret = sdw_prepare(substream);
@@ -102,7 +102,7 @@ static int mx8373_sdw_prepare(struct snd_pcm_substream *substream)
 
 static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream)
 {
-	int ret = 0;
+	int ret;
 
 	/* according to soc_pcm_hw_free dai link free is called first */
 	ret = sdw_hw_free(substream);
Signature · 1 line
2.25.1
maintainer
#5 lore raw
In reply to Pierre-Louis Bossart
Quoted 9 lines · Pierre-Louis Bossart

Two quirks added for Dell XPS 9710 and Intel reference boards, and two minor cleanups.

Pierre-Louis Bossart (3):
ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710
ASoC: Intel: update sof_pcm512x quirks
ASoC: Intel: sof_sdw_max98373: remove useless inits

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: Intel: sof_sdw: add quirk for Dell XPS 9710

      commit: b8cab69b0ed9ee10f2a86670ce41ffad991c8dc9
[2/4] ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682 variant
      commit: 46fa9a158327dd40238fa8e76af4bafdfcb8129e
[3/4] ASoC: Intel: update sof_pcm512x quirks
      commit: 22414cade8dfec25ab94df52b3a4f7aa8edb6120
[4/4] ASoC: Intel: sof_sdw_max98373: remove useless inits
      commit: d4321277b3b90474302a9b3b5ca124bcf0f29f00

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark