[SRU][F][PATCH 1/1] UBUNTU: SAUCE: ASoC: SOF: Intel: hda: move the probe_bus ahead of creation of mach device

Hui Wang hui.wang at canonical.com
Fri May 7 07:39:53 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1927672

We backported many patches to enable the sof audio driver in the focal
kernel, the driver worked well on cml and cfl machines if they have
both analog codec and HDMI/DP codec.

On some machines they only have analog codec, the current sof driver
can't work on them, we already backported related patches like "allow
operation without i915 gfx" and "drop HDA codec upon probe failure",
but we still miss one important patch:
commit 285880a23d10
("ASoC: SOF: Make creation of machine device from SOF core optional")

The patch is big, it is prone to introduce regression if applying
such a big patch, here I only picked a small part which is helpful
to enable sof driver without HDMI/DP codec.

After the change, The probe_bus() will probe the codec first and set
the codec_mask according to the probing result, then the driver create
mach device according to codec_mask.

Referred-To: commit 285880a23d10
("ASoC: SOF: Make creation of machine device from SOF core optional")
Signed-off-by: Hui Wang <hui.wang at canonical.com>
---
 sound/soc/sof/intel/hda.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index d743e27f063f..ef6a1113b178 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -387,6 +387,9 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
 	if (bus->mlcap)
 		snd_hdac_ext_bus_get_ml_capabilities(bus);
 
+	/* create codec instances */
+	hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi);
+
 	/* codec detection */
 	if (!bus->codec_mask) {
 		dev_info(bus->dev, "no hda codecs found!\n");
@@ -480,9 +483,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
 		mach_params->dmic_num = dmic_num;
 	}
 
-	/* create codec instances */
-	hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi);
-
 	if (!HDA_IDISP_CODEC(bus->codec_mask))
 		hda_codec_i915_put(sdev);
 
-- 
2.25.1




More information about the kernel-team mailing list