From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: stuarth@opensource.cirrus.com, patches@opensource.cirrus.com,
alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: [PATCH 2/5] ASoC: wm_adsp: Reorder some functions for improved clarity
Date: Fri, 22 Feb 2019 10:04:18 +0000 [thread overview]
Message-ID: <20190222100421.894-2-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20190222100421.894-1-ckeepax@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/codecs/wm_adsp.c | 81 +++++++++++++++++++++++-----------------------
1 file changed, 41 insertions(+), 40 deletions(-)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index ae7e1f5d8d10a..d556ea7204167 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3246,6 +3246,47 @@ static void wm_adsp_remove_padding(u32 *buf, int nwords, int data_word_size)
}
}
+static int wm_adsp_buffer_populate(struct wm_adsp_compr_buf *buf)
+{
+ const struct wm_adsp_fw_caps *caps = wm_adsp_fw[buf->dsp->fw].caps;
+ struct wm_adsp_buffer_region *region;
+ u32 offset = 0;
+ int i, ret;
+
+ for (i = 0; i < caps->num_regions; ++i) {
+ region = &buf->regions[i];
+
+ region->offset = offset;
+ region->mem_type = caps->region_defs[i].mem_type;
+
+ ret = wm_adsp_buffer_read(buf, caps->region_defs[i].base_offset,
+ ®ion->base_addr);
+ if (ret < 0)
+ return ret;
+
+ ret = wm_adsp_buffer_read(buf, caps->region_defs[i].size_offset,
+ &offset);
+ if (ret < 0)
+ return ret;
+
+ region->cumulative_size = offset;
+
+ adsp_dbg(buf->dsp,
+ "region=%d type=%d base=%08x off=%08x size=%08x\n",
+ i, region->mem_type, region->base_addr,
+ region->offset, region->cumulative_size);
+ }
+
+ return 0;
+}
+
+static void wm_adsp_buffer_clear(struct wm_adsp_compr_buf *buf)
+{
+ buf->irq_count = 0xFFFFFFFF;
+ buf->read_index = -1;
+ buf->avail = 0;
+}
+
static int wm_adsp_legacy_host_buf_addr(struct wm_adsp_compr_buf *buf)
{
struct wm_adsp_alg_region *alg_region;
@@ -3343,46 +3384,6 @@ static int wm_adsp_buffer_locate(struct wm_adsp_compr_buf *buf)
return 0;
}
-static int wm_adsp_buffer_populate(struct wm_adsp_compr_buf *buf)
-{
- const struct wm_adsp_fw_caps *caps = wm_adsp_fw[buf->dsp->fw].caps;
- struct wm_adsp_buffer_region *region;
- u32 offset = 0;
- int i, ret;
-
- for (i = 0; i < caps->num_regions; ++i) {
- region = &buf->regions[i];
-
- region->offset = offset;
- region->mem_type = caps->region_defs[i].mem_type;
-
- ret = wm_adsp_buffer_read(buf, caps->region_defs[i].base_offset,
- ®ion->base_addr);
- if (ret < 0)
- return ret;
-
- ret = wm_adsp_buffer_read(buf, caps->region_defs[i].size_offset,
- &offset);
- if (ret < 0)
- return ret;
-
- region->cumulative_size = offset;
-
- adsp_dbg(buf->dsp,
- "region=%d type=%d base=%08x off=%08x size=%08x\n",
- i, region->mem_type, region->base_addr,
- region->offset, region->cumulative_size);
- }
-
- return 0;
-}
-
-static void wm_adsp_buffer_clear(struct wm_adsp_compr_buf *buf)
-{
- buf->irq_count = 0xFFFFFFFF;
- buf->read_index = -1;
- buf->avail = 0;
-}
static int wm_adsp_buffer_init(struct wm_adsp *dsp)
{
--
2.11.0
next prev parent reply other threads:[~2019-02-22 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 10:04 [PATCH 1/5] ASoC: wm_adsp: Factor out stripping padding from ADSP data Charles Keepax
2019-02-22 10:04 ` Charles Keepax [this message]
2019-02-26 12:06 ` Applied "ASoC: wm_adsp: Reorder some functions for improved clarity" to the asoc tree Mark Brown
2019-02-22 10:04 ` [PATCH 3/5] ASoC: wm_adsp: Refactor compress stream initialisation Charles Keepax
2019-02-26 12:06 ` Applied "ASoC: wm_adsp: Refactor compress stream initialisation" to the asoc tree Mark Brown
2019-02-22 10:04 ` [PATCH 4/5] ASoC: wm_adsp: Add support for multiple compressed buffers Charles Keepax
2019-02-26 12:06 ` Applied "ASoC: wm_adsp: Add support for multiple compressed buffers" to the asoc tree Mark Brown
2019-02-22 10:04 ` [PATCH 5/5] ASoC: wm_adsp: Improve logging messages Charles Keepax
2019-02-26 12:06 ` Applied "ASoC: wm_adsp: Factor out stripping padding from ADSP data" to the asoc tree 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=20190222100421.894-2-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 \
--cc=stuarth@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;
as well as URLs for NNTP newsgroup(s).