2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-02 02:34:05 +08:00

ASoC: SOF: sof-pci-dev: add parameter to override firmware filename

The existing 'fw_path' module parameter can be used to load alternate
firmware files, be it for development or to handle OEM-specific or
board-specific releases. The firmware name is however non-modifiable
and defined by platform-specific descriptors.

For additional flexibility during development or enable quirks, this
patch adds the 'fw_filename' module parameter to override default
firmware names.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pierre-Louis Bossart 2022-04-14 13:48:07 -05:00 committed by Mark Brown
parent a97abb3cae
commit 58c520e2da
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -23,6 +23,10 @@ static char *fw_path;
module_param(fw_path, charp, 0444);
MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
static char *fw_filename;
module_param(fw_filename, charp, 0444);
MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware.");
static char *tplg_path;
module_param(tplg_path, charp, 0444);
MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
@ -175,7 +179,15 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
sof_pdata->dev = dev;
sof_pdata->ipc_type = desc->ipc_default;
sof_pdata->fw_filename = desc->default_fw_filename[sof_pdata->ipc_type];
if (fw_filename) {
sof_pdata->fw_filename = fw_filename;
dev_dbg(dev, "Module parameter used, changed fw filename to %s\n",
sof_pdata->fw_filename);
} else {
sof_pdata->fw_filename = desc->default_fw_filename[sof_pdata->ipc_type];
}
/*
* for platforms using the SOF community key, change the