diff mbox series

[SRU,Hirsute,1/2] ASoC: SOF: allow soundwire use desc->default_fw_filename

Message ID 20210826051000.10240-2-hui.wang@canonical.com
State New
Headers show
Series alsa: the soundwire audio doesn't work on the Dell TGL-H machines | expand

Commit Message

Hui Wang Aug. 26, 2021, 5:09 a.m. UTC
From: Libin Yang <libin.yang@intel.com>

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

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>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Tested-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210125070500.807474-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 7da99ef9757a3dd6e66a9b4854c5e58cd65a0b9a)
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

Patch

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index de6bc501f1b5..b4397f13891b 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1174,7 +1174,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 {
 			dev_info(sdev->dev,