Skip to content

Commit 1b290ef

Browse files
Mateusz Gorskibroonie
authored andcommitted
ASoC: Intel: Skylake: Add alternative topology binary name
Add alternative topology binary file name based on used machine driver and fallback to use this name after failed attempt to load topology file with name based on NHLT. This change addresses multiple issues with current mechanism, for example - there are devices without NHLT table, and that currently results in tplg_name being empty. Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200427132727.24942-2-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 77060f4 commit 1b290ef

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

sound/soc/intel/skylake/skl-topology.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/uuid.h>
1515
#include <sound/intel-nhlt.h>
1616
#include <sound/soc.h>
17+
#include <sound/soc-acpi.h>
1718
#include <sound/soc-topology.h>
1819
#include <uapi/sound/snd_sst_tokens.h>
1920
#include <uapi/sound/skl-tplg-interface.h>
@@ -3565,8 +3566,20 @@ int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus)
35653566

35663567
ret = request_firmware(&fw, skl->tplg_name, bus->dev);
35673568
if (ret < 0) {
3568-
dev_info(bus->dev, "tplg fw %s load failed with %d, falling back to dfw_sst.bin",
3569-
skl->tplg_name, ret);
3569+
char alt_tplg_name[64];
3570+
3571+
snprintf(alt_tplg_name, sizeof(alt_tplg_name), "%s-tplg.bin",
3572+
skl->mach->drv_name);
3573+
dev_info(bus->dev, "tplg fw %s load failed with %d, trying alternative tplg name %s",
3574+
skl->tplg_name, ret, alt_tplg_name);
3575+
3576+
ret = request_firmware(&fw, alt_tplg_name, bus->dev);
3577+
if (!ret)
3578+
goto component_load;
3579+
3580+
dev_info(bus->dev, "tplg %s failed with %d, falling back to dfw_sst.bin",
3581+
alt_tplg_name, ret);
3582+
35703583
ret = request_firmware(&fw, "dfw_sst.bin", bus->dev);
35713584
if (ret < 0) {
35723585
dev_err(bus->dev, "Fallback tplg fw %s load failed with %d\n",
@@ -3575,6 +3588,8 @@ int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus)
35753588
}
35763589
}
35773590

3591+
component_load:
3592+
35783593
/*
35793594
* The complete tplg for SKL is loaded as index 0, we don't use
35803595
* any other index

0 commit comments

Comments
 (0)