ASoC: SOF: allow soundwire use desc->default_fw_filename
authorLibin Yang <libin.yang@intel.com>
Mon, 25 Jan 2021 07:04:58 +0000 (09:04 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 27 Jan 2021 12:35:19 +0000 (12:35 +0000)
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>
sound/soc/sof/intel/hda.c

index 509a9b25642301bd4d8af17c8a11646e3c0bdfc3..b625d852b999c2bfe3df080e74571b4701329603 100644 (file)
@@ -1173,7 +1173,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,