Skip to content

Commit 7b84fd2

Browse files
dbalutabroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d54aa2a commit 7b84fd2

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

sound/soc/sof/sof-of-dev.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77

88
#include <linux/firmware.h>
99
#include <linux/module.h>
10+
#include <linux/moduleparam.h>
1011
#include <linux/pm_runtime.h>
1112
#include <sound/sof.h>
1213

1314
#include "ops.h"
1415
#include "imx/imx-ops.h"
1516

17+
static char *fw_path;
18+
module_param(fw_path, charp, 0444);
19+
MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
20+
21+
static char *tplg_path;
22+
module_param(tplg_path, charp, 0444);
23+
MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
24+
1625
/* platform specific devices */
1726
#if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8)
1827
static struct sof_dev_desc sof_of_imx8qxp_desc = {
@@ -87,9 +96,15 @@ static int sof_of_probe(struct platform_device *pdev)
8796
sof_pdata->dev = &pdev->dev;
8897
sof_pdata->fw_filename = desc->default_fw_filename;
8998

90-
/* TODO: read alternate fw and tplg filenames from DT */
91-
sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path;
92-
sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path;
99+
if (fw_path)
100+
sof_pdata->fw_filename_prefix = fw_path;
101+
else
102+
sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path;
103+
104+
if (tplg_path)
105+
sof_pdata->tplg_filename_prefix = tplg_path;
106+
else
107+
sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path;
93108

94109
/* set callback to be called on successful device probe to enable runtime_pm */
95110
sof_pdata->sof_probe_complete = sof_of_probe_complete;

0 commit comments

Comments
 (0)