12 #include <linux/module.h>
16 #include <linux/slab.h>
24 #include <mach/hardware.h>
38 .buffer_bytes_max = 4*1024,
39 .period_bytes_min = 1*1024,
40 .period_bytes_max = 4*1024,
64 spin_unlock_irqrestore(&nuc900_audio->
lock, flags);
73 struct nuc900_audio *nuc900_audio = runtime->
private_data;
74 void __iomem *mmio_addr, *mmio_len;
91 struct nuc900_audio *nuc900_audio = runtime->
private_data;
102 struct nuc900_audio *nuc900_audio = runtime->
private_data;
113 struct nuc900_audio *nuc900_audio = substream->
runtime->private_data;
116 spin_lock(&nuc900_audio->
lock);
149 dev_err(nuc900_audio->
dev,
"Wrong DMA interrupt status!\n");
150 spin_unlock(&nuc900_audio->
lock);
154 spin_unlock(&nuc900_audio->
lock);
170 struct nuc900_audio *nuc900_audio = runtime->
private_data;
176 nuc900_update_dma_register(substream,
203 spin_unlock_irqrestore(&nuc900_audio->
lock, flags);
214 nuc900_dma_start(substream);
219 nuc900_dma_stop(substream);
234 struct nuc900_audio *nuc900_audio = runtime->
private_data;
251 nuc900_dma_getposition(substream, &src, &dst);
258 return bytes_to_frames(substream->
runtime, res);
264 struct nuc900_audio *nuc900_audio;
271 0,
"nuc900-dma", substream))
282 struct nuc900_audio *nuc900_audio = runtime->
private_data;
294 return dma_mmap_writecombine(substream->
pcm->card->dev, vma,
301 .open = nuc900_dma_open,
302 .close = nuc900_dma_close,
304 .hw_params = nuc900_dma_hw_params,
305 .hw_free = nuc900_dma_hw_free,
306 .prepare = nuc900_dma_prepare,
307 .trigger = nuc900_dma_trigger,
308 .pointer = nuc900_dma_pointer,
309 .mmap = nuc900_dma_mmap,
312 static void nuc900_dma_free_dma_buffers(
struct snd_pcm *pcm)
323 if (!card->
dev->dma_mask)
324 card->
dev->dma_mask = &nuc900_pcm_dmamask;
325 if (!card->
dev->coherent_dma_mask)
329 card->
dev, 4 * 1024, (4 * 1024) - 1);
335 .ops = &nuc900_dma_ops,
336 .pcm_new = nuc900_dma_new,
337 .pcm_free = nuc900_dma_free_dma_buffers,
353 .name =
"nuc900-pcm-audio",
357 .probe = nuc900_soc_platform_probe,