15 #include <linux/module.h>
17 #include <linux/device.h>
18 #include <linux/slab.h>
29 #include <mach/hardware.h>
48 .buffer_bytes_max = 131072,
49 .period_bytes_min = 32,
50 .period_bytes_max = 32768,
56 static bool ep93xx_pcm_dma_filter(
struct dma_chan *
chan,
void *filter_param)
60 if (data->
direction == ep93xx_dma_chan_direction(chan)) {
82 dma_params = snd_soc_dai_get_dma_data(cpu_dai, substream);
85 dma_data->
direction = snd_pcm_substream_to_dma_direction(substream);
110 snd_pcm_set_runtime_buffer(substream, &substream->
dma_buffer);
117 snd_pcm_set_runtime_buffer(substream,
NULL);
126 return dma_mmap_writecombine(substream->
pcm->card->dev, vma,
133 .open = ep93xx_pcm_open,
134 .close = ep93xx_pcm_close,
136 .hw_params = ep93xx_pcm_hw_params,
137 .hw_free = ep93xx_pcm_hw_free,
140 .mmap = ep93xx_pcm_mmap,
143 static int ep93xx_pcm_preallocate_dma_buffer(
struct snd_pcm *pcm,
int stream)
159 static void ep93xx_pcm_free_dma_buffers(
struct snd_pcm *pcm)
165 for (stream = 0; stream < 2; stream++) {
166 substream = pcm->
streams[stream].substream;
188 if (!card->
dev->dma_mask)
189 card->
dev->dma_mask = &ep93xx_pcm_dmamask;
190 if (!card->
dev->coherent_dma_mask)
194 ret = ep93xx_pcm_preallocate_dma_buffer(pcm,
201 ret = ep93xx_pcm_preallocate_dma_buffer(pcm,
211 .ops = &ep93xx_pcm_ops,
212 .pcm_new = &ep93xx_pcm_new,
213 .pcm_free = &ep93xx_pcm_free_dma_buffers,
229 .name =
"ep93xx-pcm-audio",
233 .probe = ep93xx_soc_platform_probe,