21 #include <linux/module.h>
24 #include <linux/slab.h>
43 return substream->
runtime->private_data;
125 static void dmaengine_pcm_dma_complete(
void *
arg)
130 prtd->
pos += snd_pcm_lib_period_bytes(substream);
131 if (prtd->
pos >= snd_pcm_lib_buffer_bytes(substream))
145 direction = snd_pcm_substream_to_dma_direction(substream);
147 if (!substream->
runtime->no_period_wakeup)
151 desc = dmaengine_prep_dma_cyclic(chan,
153 snd_pcm_lib_buffer_bytes(substream),
154 snd_pcm_lib_period_bytes(substream), direction, flags);
159 desc->
callback = dmaengine_pcm_dma_complete;
161 prtd->
cookie = dmaengine_submit(desc);
183 ret = dmaengine_pcm_prepare_and_submit(substream);
186 dma_async_issue_pending(prtd->
dma_chan);
197 dmaengine_terminate_all(prtd->
dma_chan);
217 return bytes_to_frames(substream->
runtime, prtd->
pos);
234 unsigned int pos = 0;
236 status = dmaengine_tx_status(prtd->
dma_chan, prtd->
cookie, &state);
238 buf_size = snd_pcm_lib_buffer_bytes(substream);
240 pos = buf_size - state.
residue;
243 return bytes_to_frames(substream->
runtime, pos);
294 ret = dmaengine_pcm_request_channel(prtd, filter_fn, filter_data);
300 substream->
runtime->private_data = prtd;