diff mbox series

[SRU,OEM-5.10,3/6] UBUNTU: SAUCE: ASoC: SOF: allow soundwire use desc->default_fw_filename

Message ID 20210115020421.6534-4-hui.wang@canonical.com
State New
Headers show
Series alsa/sdw: support soundwire audio for TGL-H machines | expand

Commit Message

Hui Wang Jan. 15, 2021, 2:04 a.m. UTC
From: Libin Yang <libin.yang@intel.com>

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

The old code always uses sof_fw_filename in struct snd_soc_acpi_mach
as the firmware name. However, firmware name should depend on the platform
instead of the machine. For example, different machines may use the same
soundwire link topology, but they are using the different firmware. In this
case, it's hard to determine in struct snd_soc_acpi_mach which firmware it
should use.

Signed-off-by: Libin Yang <libin.yang@intel.com>
(cherry picked from commit 2ad1b7a5c3624d265b487dc7a2fbf52a48f6ff71
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
 sound/soc/sof/intel/hda.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index bb4128a72a42..ed75f940735d 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1175,7 +1175,10 @@  static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
 			mach->mach_params.links = mach->links;
 			mach->mach_params.link_mask = mach->link_mask;
 			mach->mach_params.platform = dev_name(sdev->dev);
-			pdata->fw_filename = mach->sof_fw_filename;
+			if (mach->sof_fw_filename)
+				pdata->fw_filename = mach->sof_fw_filename;
+			else
+				pdata->fw_filename = pdata->desc->default_fw_filename;
 			pdata->tplg_filename = mach->sof_tplg_filename;
 		} else {