|
20 | 20 | #include "sof-utils.h" |
21 | 21 | #include "ops.h" |
22 | 22 |
|
23 | | -/* Create DMA buffer page table for DSP */ |
24 | | -static int create_page_table(struct snd_soc_component *component, |
25 | | - struct snd_pcm_substream *substream, |
26 | | - unsigned char *dma_area, size_t size) |
27 | | -{ |
28 | | - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); |
29 | | - struct snd_sof_pcm *spcm; |
30 | | - struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream); |
31 | | - int stream = substream->stream; |
32 | | - |
33 | | - spcm = snd_sof_find_spcm_dai(component, rtd); |
34 | | - if (!spcm) |
35 | | - return -EINVAL; |
36 | | - |
37 | | - return snd_sof_create_page_table(component->dev, dmab, |
38 | | - spcm->stream[stream].page_table.area, size); |
39 | | -} |
40 | | - |
41 | 23 | /* |
42 | 24 | * sof pcm period elapse work |
43 | 25 | */ |
@@ -199,9 +181,11 @@ static int sof_pcm_hw_params(struct snd_soc_component *component, |
199 | 181 |
|
200 | 182 | /* create compressed page table for audio firmware */ |
201 | 183 | if (runtime->buffer_changed) { |
202 | | - ret = create_page_table(component, substream, runtime->dma_area, |
203 | | - runtime->dma_bytes); |
| 184 | + struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream); |
204 | 185 |
|
| 186 | + ret = snd_sof_create_page_table(component->dev, dmab, |
| 187 | + spcm->stream[substream->stream].page_table.area, |
| 188 | + runtime->dma_bytes); |
205 | 189 | if (ret < 0) |
206 | 190 | return ret; |
207 | 191 | } |
|
0 commit comments