23 #include <linux/device.h>
27 #include <linux/module.h>
29 #include <linux/slab.h>
58 .period_bytes_min = 32,
59 .period_bytes_max = 8192,
62 .buffer_bytes_max = 64 * 1024,
86 snd_pcm_set_runtime_buffer(substream, &substream->
dma_buffer);
97 pcm_dma_data = kzalloc(
sizeof(*pcm_dma_data),
GFP_KERNEL);
98 if (pcm_dma_data ==
NULL)
132 return dma_mmap_writecombine(substream->
pcm->card->dev, vma,
139 .open = snd_mxs_open,
140 .close = snd_mxs_close,
142 .hw_params = snd_mxs_pcm_hw_params,
145 .mmap = snd_mxs_pcm_mmap,
148 static int mxs_pcm_preallocate_dma_buffer(
struct snd_pcm *pcm,
int stream)
173 if (!card->
dev->dma_mask)
174 card->
dev->dma_mask = &mxs_pcm_dmamask;
175 if (!card->
dev->coherent_dma_mask)
179 ret = mxs_pcm_preallocate_dma_buffer(pcm,
186 ret = mxs_pcm_preallocate_dma_buffer(pcm,
196 static void mxs_pcm_free(
struct snd_pcm *pcm)
202 for (stream = 0; stream < 2; stream++) {
203 substream = pcm->
streams[stream].substream;
219 .pcm_new = mxs_pcm_new,
220 .pcm_free = mxs_pcm_free,