All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: wm_adsp: Allow compressed buffers in any memory region
@ 2019-02-19 17:31 Charles Keepax
  2019-02-19 17:31 ` [PATCH 2/2] ASoC: wm_adsp: Update cached error state on trigger Charles Keepax
  2019-02-20 12:13 ` Applied "ASoC: wm_adsp: Allow compressed buffers in any memory region" " Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Charles Keepax @ 2019-02-19 17:31 UTC (permalink / raw)
  To: broonie; +Cc: stuarth, patches, alsa-devel, lgirdwood, aford

From: Andrew Ford <aford@opensource.cirrus.com>

Currently, compressed buffers can only be specified in the XM memory
region. There is no reason to have such a restriction with the newer
meta-data based way of specifying the buffers, so remove it.

Signed-off-by: Andrew Ford <aford@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/codecs/wm_adsp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 1dd291cebe67..12ef85e85c29 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -344,6 +344,7 @@ struct wm_adsp_compr_buf {
 	u32 irq_count;
 	int read_index;
 	int avail;
+	int host_buf_mem_type;
 };
 
 struct wm_adsp_compr {
@@ -3219,14 +3220,14 @@ static int wm_adsp_write_data_word(struct wm_adsp *dsp, int mem_type,
 static inline int wm_adsp_buffer_read(struct wm_adsp_compr_buf *buf,
 				      unsigned int field_offset, u32 *data)
 {
-	return wm_adsp_read_data_word(buf->dsp, WMFW_ADSP2_XM,
+	return wm_adsp_read_data_word(buf->dsp, buf->host_buf_mem_type,
 				      buf->host_buf_ptr + field_offset, data);
 }
 
 static inline int wm_adsp_buffer_write(struct wm_adsp_compr_buf *buf,
 				       unsigned int field_offset, u32 data)
 {
-	return wm_adsp_write_data_word(buf->dsp, WMFW_ADSP2_XM,
+	return wm_adsp_write_data_word(buf->dsp, buf->host_buf_mem_type,
 				       buf->host_buf_ptr + field_offset, data);
 }
 
@@ -3264,6 +3265,8 @@ static int wm_adsp_legacy_host_buf_addr(struct wm_adsp_compr_buf *buf)
 	if (!buf->host_buf_ptr)
 		return -EIO;
 
+	buf->host_buf_mem_type = WMFW_ADSP2_XM;
+
 	adsp_dbg(dsp, "host_buf_ptr=%x\n", buf->host_buf_ptr);
 
 	return 0;
@@ -3282,6 +3285,7 @@ wm_adsp_find_host_buffer_ctrl(struct wm_adsp_compr_buf *buf)
 		if (!ctl->enabled)
 			continue;
 
+		buf->host_buf_mem_type = ctl->alg_region.type;
 		return ctl;
 	}
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-20 12:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 17:31 [PATCH 1/2] ASoC: wm_adsp: Allow compressed buffers in any memory region Charles Keepax
2019-02-19 17:31 ` [PATCH 2/2] ASoC: wm_adsp: Update cached error state on trigger Charles Keepax
2019-02-20 11:54   ` Mark Brown
2019-02-20 12:13   ` Applied "ASoC: wm_adsp: Update cached error state on trigger" to the asoc tree Mark Brown
2019-02-20 12:13 ` Applied "ASoC: wm_adsp: Allow compressed buffers in any memory region" " Mark Brown

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.