diff options
author | Daniel Baluta <daniel.baluta@nxp.com> | 2021-10-05 09:19:49 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-10-05 14:09:59 +0200 |
commit | 7b84fd262d8a54ca609dd719c20c8a8e1a7ff759 (patch) | |
tree | 86bd23b722d6ea4063c87dca58a62aead2b9baa8 /sound/soc/sof/sof-of-dev.c | |
parent | ASoC: amd: acp-rt5645: Constify static snd_soc_ops (diff) | |
download | linux-7b84fd262d8a54ca609dd719c20c8a8e1a7ff759.tar.xz linux-7b84fd262d8a54ca609dd719c20c8a8e1a7ff759.zip |
ASoC: SOF: OF: Add fw_path and tplg_path parameters
This allows specifying an alternate path for SOF firmware or
SOF topology.
This is particularly useful for i.MX when running Linux vs Android.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211005071949.1277613-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-of-dev.c')
-rw-r--r-- | sound/soc/sof/sof-of-dev.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index f0f819a46456..885430a42226 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -7,12 +7,21 @@ #include <linux/firmware.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/pm_runtime.h> #include <sound/sof.h> #include "ops.h" #include "imx/imx-ops.h" +static char *fw_path; +module_param(fw_path, charp, 0444); +MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware."); + +static char *tplg_path; +module_param(tplg_path, charp, 0444); +MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology."); + /* platform specific devices */ #if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8) static struct sof_dev_desc sof_of_imx8qxp_desc = { @@ -87,9 +96,15 @@ static int sof_of_probe(struct platform_device *pdev) sof_pdata->dev = &pdev->dev; sof_pdata->fw_filename = desc->default_fw_filename; - /* TODO: read alternate fw and tplg filenames from DT */ - sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path; - sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path; + if (fw_path) + sof_pdata->fw_filename_prefix = fw_path; + else + sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path; + + if (tplg_path) + sof_pdata->tplg_filename_prefix = tplg_path; + else + sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path; /* set callback to be called on successful device probe to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_of_probe_complete; |