Skip to content

Commit 33e409a

Browse files
committed
ASoC: wm_adsp: Add VPU voice trigger compressed streams support
Change-Id: Iafc4ed961d39050530799fb959ec47c047e6ea42 Signed-off-by: Andrew Ford <[email protected]>
1 parent f8ec97c commit 33e409a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ struct wm_adsp_compr_buf {
580580
u32 irq_count;
581581
int read_index;
582582
int avail;
583+
int host_buf_mem_type;
583584
};
584585

585586
struct wm_adsp_compr {
@@ -3431,6 +3432,12 @@ static void wm_vpu_boot_work(struct work_struct *work)
34313432
if (ret != 0)
34323433
goto err;
34333434

3435+
if (wm_adsp_fw[vpu->fw].num_caps != 0) {
3436+
ret = wm_adsp_buffer_init(vpu);
3437+
if (ret < 0)
3438+
goto err;
3439+
}
3440+
34343441
vpu->booted = true;
34353442

34363443
err:
@@ -4203,14 +4210,14 @@ static int wm_adsp_write_data_word(struct wm_adsp *dsp, int mem_type,
42034210
static inline int wm_adsp_buffer_read(struct wm_adsp_compr_buf *buf,
42044211
unsigned int field_offset, u32 *data)
42054212
{
4206-
return wm_adsp_read_data_word(buf->dsp, WMFW_ADSP2_XM,
4213+
return wm_adsp_read_data_word(buf->dsp, buf->host_buf_mem_type,
42074214
buf->host_buf_ptr + field_offset, data);
42084215
}
42094216

42104217
static inline int wm_adsp_buffer_write(struct wm_adsp_compr_buf *buf,
42114218
unsigned int field_offset, u32 data)
42124219
{
4213-
return wm_adsp_write_data_word(buf->dsp, WMFW_ADSP2_XM,
4220+
return wm_adsp_write_data_word(buf->dsp, buf->host_buf_mem_type,
42144221
buf->host_buf_ptr + field_offset, data);
42154222
}
42164223

@@ -4260,6 +4267,8 @@ static int wm_adsp_legacy_host_buf_addr(struct wm_adsp_compr_buf *buf)
42604267
if (!buf->host_buf_ptr)
42614268
return -EIO;
42624269

4270+
buf->host_buf_mem_type = WMFW_ADSP2_XM;
4271+
42634272
adsp_dbg(dsp, "host_buf_ptr=%x\n", buf->host_buf_ptr);
42644273

42654274
return 0;
@@ -4278,6 +4287,7 @@ static struct wm_coeff_ctl *wm_adsp_find_host_buffer_ctrl(
42784287
if (!ctl->enabled)
42794288
continue;
42804289

4290+
buf->host_buf_mem_type = ctl->alg_region.type;
42814291
return ctl;
42824292
}
42834293

0 commit comments

Comments
 (0)