aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/spear/spear_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/spear/spear_pcm.c')
-rw-r--r--sound/soc/spear/spear_pcm.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index f288724961da..0e5a8f35d0ad 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -32,26 +32,19 @@ static const struct snd_pcm_hardware spear_pcm_hardware = {
32 .fifo_size = 0, /* fifo size in bytes */ 32 .fifo_size = 0, /* fifo size in bytes */
33}; 33};
34 34
35static struct dma_chan *spear_pcm_request_chan(struct snd_soc_pcm_runtime *rtd,
36 struct snd_pcm_substream *substream)
37{
38 struct spear_dma_data *dma_data;
39
40 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
41
42 return snd_dmaengine_pcm_request_channel(dma_data->filter, dma_data);
43}
44
45static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = { 35static const struct snd_dmaengine_pcm_config spear_dmaengine_pcm_config = {
46 .pcm_hardware = &spear_pcm_hardware, 36 .pcm_hardware = &spear_pcm_hardware,
47 .compat_request_channel = spear_pcm_request_chan,
48 .prealloc_buffer_size = 16 * 1024, 37 .prealloc_buffer_size = 16 * 1024,
49}; 38};
50 39
51int devm_spear_pcm_platform_register(struct device *dev) 40int devm_spear_pcm_platform_register(struct device *dev,
41 struct snd_dmaengine_pcm_config *config,
42 bool (*filter)(struct dma_chan *chan, void *slave))
52{ 43{
53 return devm_snd_dmaengine_pcm_register(dev, 44 *config = spear_dmaengine_pcm_config;
54 &spear_dmaengine_pcm_config, 45 config->compat_filter_fn = filter;
46
47 return snd_dmaengine_pcm_register(dev, config,
55 SND_DMAENGINE_PCM_FLAG_NO_DT | 48 SND_DMAENGINE_PCM_FLAG_NO_DT |
56 SND_DMAENGINE_PCM_FLAG_COMPAT); 49 SND_DMAENGINE_PCM_FLAG_COMPAT);
57} 50}