lkml.org 
[lkml]   [2023]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Asoc: wm_adsp: Add support for loading firmware with prefix name
Date
For platform using fdt, system_name is NULL, it doesn't provide
a way to load firmware with prefix name, so add it.

Signed-off-by: Jianhua Lu <lujianhua000@gmail.com>
---
sound/soc/codecs/wm_adsp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 216120b68b64..17481e42d440 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -760,6 +760,10 @@ static int wm_adsp_request_firmware_file(struct wm_adsp *dsp,
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, dsp->part,
dsp->fwf_name, wm_adsp_fw[dsp->fw].file, system_name,
filetype);
+ else if (asoc_component_prefix)
+ *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, dsp->part,
+ dsp->fwf_name, wm_adsp_fw[dsp->fw].file, asoc_component_prefix,
+ filetype);
else
*filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s.%s", dir, dsp->part, dsp->fwf_name,
wm_adsp_fw[dsp->fw].file, filetype);
@@ -831,6 +835,16 @@ static int wm_adsp_request_firmware_files(struct wm_adsp *dsp,
NULL, "bin");
return 0;
}
+ } else if (asoc_component_prefix) {
+ if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename,
+ cirrus_dir, NULL,
+ asoc_component_prefix, "wmfw")) {
+ adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename);
+ wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename,
+ cirrus_dir, NULL,
+ asoc_component_prefix, "bin");
+ return 0;
+ }
}

if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename,
--
2.39.2
\
 
 \ /
  Last update: 2023-03-29 15:06    [W:0.413 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site