From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
lgirdwood@gmail.com
Subject: [PATCH 05/10] firmware: cs_dsp: Print messages from bin files
Date: Tue, 16 Nov 2021 16:16:04 +0000 [thread overview]
Message-ID: <20211116161609.12223-5-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20211116161609.12223-1-ckeepax@opensource.cirrus.com>
The coefficient file contains various info strings, and the equivalent
strings are printed from the WMFW file as it is loaded. Add support
for printing these from the coefficient file as well.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/firmware/cirrus/cs_dsp.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index ef7afadea42d1..3d21574f3a443 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -1968,6 +1968,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
struct cs_dsp_alg_region *alg_region;
const char *region_name;
int ret, pos, blocks, type, offset, reg, version;
+ char *text = NULL;
struct cs_dsp_buf *buf;
if (!firmware)
@@ -2025,6 +2026,8 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
region_name = "Unknown";
switch (type) {
case (WMFW_NAME_TEXT << 8):
+ text = kzalloc(le32_to_cpu(blk->len) + 1, GFP_KERNEL);
+ break;
case (WMFW_INFO_TEXT << 8):
case (WMFW_METADATA << 8):
break;
@@ -2094,6 +2097,13 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
break;
}
+ if (text) {
+ memcpy(text, blk->data, le32_to_cpu(blk->len));
+ cs_dsp_info(dsp, "%s: %s\n", dsp->fw_name, text);
+ kfree(text);
+ text = NULL;
+ }
+
if (reg) {
if (le32_to_cpu(blk->len) >
firmware->size - pos - sizeof(*blk)) {
@@ -2144,6 +2154,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware
out_fw:
regmap_async_complete(regmap);
cs_dsp_buf_free(&buf_list);
+ kfree(text);
return ret;
}
--
2.11.0
next prev parent reply other threads:[~2021-11-16 16:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 16:16 [PATCH 01/10] ASoC: wm_adsp: Remove the wmfw_add_ctl helper function Charles Keepax
2021-11-16 16:16 ` [PATCH 02/10] firmware: cs_dsp: Add lockdep asserts to interface functions Charles Keepax
2021-11-16 16:16 ` [PATCH 03/10] firmware: cs_dsp: Add version checks on coefficient loading Charles Keepax
2021-11-16 18:08 ` Mark Brown
2021-11-16 18:44 ` Simon Trimmer
2021-11-17 11:00 ` Charles Keepax
2021-11-17 12:54 ` Mark Brown
2021-11-16 16:16 ` [PATCH 04/10] firmware: cs_dsp: Add pre_run callback Charles Keepax
2021-11-16 16:16 ` Charles Keepax [this message]
2021-11-16 16:16 ` [PATCH 06/10] firmware: cs_dsp: Add support for rev 2 coefficient files Charles Keepax
2021-11-16 16:16 ` [PATCH 07/10] firmware: cs_dsp: Perform NULL check in cs_dsp_coeff_write/read_ctrl Charles Keepax
2021-11-16 16:16 ` [PATCH 08/10] firmware: cs_dsp: Clarify some kernel doc comments Charles Keepax
2021-11-16 16:16 ` [PATCH 09/10] firmware: cs_dsp: Add offset to cs_dsp read/write Charles Keepax
2021-11-16 16:16 ` [PATCH 10/10] firmware: cs_dsp: Allow creation of event controls Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211116161609.12223-5-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox