14 #include <linux/module.h>
20 #include <linux/slab.h>
43 snd_pcm_set_runtime_buffer(substream, &substream->
dma_buffer);
50 snd_pcm_set_runtime_buffer(substream,
NULL);
60 snd_soc_dai_get_dma_data(rtd->
cpu_dai, substream);
89 return dma_mmap_writecombine(substream->
pcm->card->dev, vma,
95 .
open = spear_pcm_open,
96 .close = spear_pcm_close,
98 .hw_params = spear_pcm_hw_params,
99 .hw_free = spear_pcm_hw_free,
102 .mmap = spear_pcm_mmap,
122 " preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
123 (
void *)buf->
area, (
void *)buf->
addr, size);
129 static void spear_pcm_free(
struct snd_pcm *pcm)
135 for (stream = 0; stream < 2; stream++) {
136 substream = pcm->
streams[stream].substream;
141 if (!buf || !buf->
area)
157 if (!card->
dev->dma_mask)
158 card->
dev->dma_mask = &spear_pcm_dmamask;
159 if (!card->
dev->coherent_dma_mask)
162 if (dai->
driver->playback.channels_min) {
163 ret = spear_pcm_preallocate_dma_buffer(pcm,
170 if (dai->
driver->capture.channels_min) {
171 ret = spear_pcm_preallocate_dma_buffer(pcm,
182 .ops = &spear_pcm_ops,
183 .pcm_new = spear_pcm_new,
184 .pcm_free = spear_pcm_free,
201 .name =
"spear-pcm-audio",
205 .probe = spear_soc_platform_probe,