From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com
Subject: [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
Date: Fri, 1 Nov 2013 15:56:54 +0000 [thread overview]
Message-ID: <1383321417-1133-4-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1383321417-1133-1-git-send-email-dp@opensource.wolfsonmicro.com>
From: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate
lengths based on padded ADSP words instead of treating them as bytes
Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm_adsp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 4008ceb..4039d05 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1063,6 +1063,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
if (i + 1 < algs) {
region->len = be32_to_cpu(adsp1_alg[i + 1].dm);
region->len -= be32_to_cpu(adsp1_alg[i].dm);
+ region->len *= 4;
wm_adsp_create_control(dsp, region);
} else {
adsp_warn(dsp, "Missing length info for region DM with ID %x\n",
@@ -1080,6 +1081,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
if (i + 1 < algs) {
region->len = be32_to_cpu(adsp1_alg[i + 1].zm);
region->len -= be32_to_cpu(adsp1_alg[i].zm);
+ region->len *= 4;
wm_adsp_create_control(dsp, region);
} else {
adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
@@ -1109,6 +1111,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
if (i + 1 < algs) {
region->len = be32_to_cpu(adsp2_alg[i + 1].xm);
region->len -= be32_to_cpu(adsp2_alg[i].xm);
+ region->len *= 4;
wm_adsp_create_control(dsp, region);
} else {
adsp_warn(dsp, "Missing length info for region XM with ID %x\n",
@@ -1126,6 +1129,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
if (i + 1 < algs) {
region->len = be32_to_cpu(adsp2_alg[i + 1].ym);
region->len -= be32_to_cpu(adsp2_alg[i].ym);
+ region->len *= 4;
wm_adsp_create_control(dsp, region);
} else {
adsp_warn(dsp, "Missing length info for region YM with ID %x\n",
@@ -1143,6 +1147,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
if (i + 1 < algs) {
region->len = be32_to_cpu(adsp2_alg[i + 1].zm);
region->len -= be32_to_cpu(adsp2_alg[i].zm);
+ region->len *= 4;
wm_adsp_create_control(dsp, region);
} else {
adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
--
1.8.4.2
next prev parent reply other threads:[~2013-11-01 15:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
2013-11-01 17:48 ` Mark Brown
2013-11-01 15:56 ` [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure Dimitris Papastamos
2013-11-01 17:48 ` Mark Brown
2013-11-01 15:56 ` Dimitris Papastamos [this message]
2013-11-01 17:47 ` [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words Mark Brown
2013-11-01 15:56 ` [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers Dimitris Papastamos
2013-11-01 17:49 ` Mark Brown
2013-11-01 15:56 ` [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1 Dimitris Papastamos
2013-11-01 17:49 ` Mark Brown
2013-11-01 15:56 ` [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version Dimitris Papastamos
2013-11-01 17:49 ` Mark Brown
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=1383321417-1133-4-git-send-email-dp@opensource.wolfsonmicro.com \
--to=dp@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=patches@opensource.wolfsonmicro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.