summaryrefslogtreecommitdiff
path: root/sound/soc/sof/sof-pci-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sof/sof-pci-dev.c')
-rw-r--r--sound/soc/sof/sof-pci-dev.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index 643fd1036d60..f5ece43d0ec2 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -28,6 +28,10 @@ static char *fw_filename;
module_param(fw_filename, charp, 0444);
MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware.");
+static char *lib_path;
+module_param(lib_path, charp, 0444);
+MODULE_PARM_DESC(lib_path, "alternate path for SOF firmware libraries.");
+
static char *tplg_path;
module_param(tplg_path, charp, 0444);
MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
@@ -272,6 +276,28 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
sof_pdata->desc->default_fw_path[sof_pdata->ipc_type];
}
+ if (lib_path) {
+ sof_pdata->fw_lib_prefix = lib_path;
+
+ dev_dbg(dev, "Module parameter used, changed fw_lib path to %s\n",
+ sof_pdata->fw_lib_prefix);
+
+ } else if (sof_pdata->desc->default_lib_path[sof_pdata->ipc_type]) {
+ if (dmi_check_system(community_key_platforms) && sof_dmi_use_community_key) {
+ sof_pdata->fw_lib_prefix =
+ devm_kasprintf(dev, GFP_KERNEL, "%s/%s",
+ sof_pdata->desc->default_lib_path[sof_pdata->ipc_type],
+ "community");
+
+ dev_dbg(dev,
+ "Platform uses community key, changed fw_lib path to %s\n",
+ sof_pdata->fw_lib_prefix);
+ } else {
+ sof_pdata->fw_lib_prefix =
+ sof_pdata->desc->default_lib_path[sof_pdata->ipc_type];
+ }
+ }
+
if (tplg_path)
sof_pdata->tplg_filename_prefix = tplg_path;
else