17 #include <linux/kernel.h>
18 #include <linux/module.h>
20 #include <linux/slab.h>
54 .period_bytes_min = 16,
101 jz4740_pcm_start_transfer(prtd, substream);
112 config = snd_soc_dai_get_dma_data(rtd->
cpu_dai, substream);
132 snd_pcm_set_runtime_buffer(substream, &substream->
dma_buffer);
135 prtd->
dma_period = params_period_bytes(params);
147 snd_pcm_set_runtime_buffer(substream,
NULL);
177 jz4740_pcm_start_transfer(prtd, substream);
206 offset = bytes_to_frames(runtime, byte_offset);
248 .open = jz4740_pcm_open,
249 .close = jz4740_pcm_close,
251 .hw_params = jz4740_pcm_hw_params,
252 .hw_free = jz4740_pcm_hw_free,
253 .prepare = jz4740_pcm_prepare,
254 .trigger = jz4740_pcm_trigger,
255 .pointer = jz4740_pcm_pointer,
256 .mmap = jz4740_pcm_mmap,
259 static int jz4740_pcm_preallocate_dma_buffer(
struct snd_pcm *pcm,
int stream)
279 static void jz4740_pcm_free(
struct snd_pcm *pcm)
286 substream = pcm->
streams[stream].substream;
308 if (!card->
dev->dma_mask)
309 card->
dev->dma_mask = &jz4740_pcm_dmamask;
311 if (!card->
dev->coherent_dma_mask)
315 ret = jz4740_pcm_preallocate_dma_buffer(pcm,
322 ret = jz4740_pcm_preallocate_dma_buffer(pcm,
333 .ops = &jz4740_pcm_ops,
334 .pcm_new = jz4740_pcm_new,
335 .pcm_free = jz4740_pcm_free,
350 .probe = jz4740_pcm_probe,
353 .name =
"jz4740-pcm-audio",