33 #include <linux/module.h>
34 #include <linux/slab.h>
52 .period_bytes_min = 1024,
71 dev_err(dev,
"dmaengine pcm open failed with err %d\n", ret);
94 dmap = snd_soc_dai_get_dma_data(rtd->
cpu_dai, substream);
99 dev_err(dev,
"hw params config failed with err %d\n", ret);
116 dev_err(dev,
"dma slave config failed with err %d\n", ret);
120 snd_pcm_set_runtime_buffer(substream, &substream->
dma_buffer);
126 snd_pcm_set_runtime_buffer(substream,
NULL);
155 return dma_mmap_writecombine(substream->
pcm->card->dev, vma,
162 .open = tegra_pcm_open,
163 .close = tegra_pcm_close,
165 .hw_params = tegra_pcm_hw_params,
166 .hw_free = tegra_pcm_hw_free,
167 .trigger = tegra_pcm_trigger,
169 .mmap = tegra_pcm_mmap,
172 static int tegra_pcm_preallocate_dma_buffer(
struct snd_pcm *pcm,
int stream)
191 static void tegra_pcm_deallocate_dma_buffer(
struct snd_pcm *pcm,
int stream)
196 substream = pcm->
streams[stream].substream;
217 if (!card->
dev->dma_mask)
218 card->
dev->dma_mask = &tegra_dma_mask;
219 if (!card->
dev->coherent_dma_mask)
223 ret = tegra_pcm_preallocate_dma_buffer(pcm,
230 ret = tegra_pcm_preallocate_dma_buffer(pcm,
244 static void tegra_pcm_free(
struct snd_pcm *pcm)
251 .ops = &tegra_pcm_ops,
252 .pcm_new = tegra_pcm_new,
253 .pcm_free = tegra_pcm_free,