aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c12
-rw-r--r--sound/soc/cirrus/ep93xx-i2s.c14
-rw-r--r--sound/soc/cirrus/ep93xx-pcm.c13
3 files changed, 22 insertions, 17 deletions
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index cc5583da5380..f30dadf85b99 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -19,6 +19,7 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <sound/core.h> 21#include <sound/core.h>
22#include <sound/dmaengine_pcm.h>
22#include <sound/ac97_codec.h> 23#include <sound/ac97_codec.h>
23#include <sound/soc.h> 24#include <sound/soc.h>
24 25
@@ -97,6 +98,8 @@ struct ep93xx_ac97_info {
97 struct device *dev; 98 struct device *dev;
98 void __iomem *regs; 99 void __iomem *regs;
99 struct completion done; 100 struct completion done;
101 struct snd_dmaengine_dai_dma_data dma_params_rx;
102 struct snd_dmaengine_dai_dma_data dma_params_tx;
100}; 103};
101 104
102/* currently ALSA only supports a single AC97 device */ 105/* currently ALSA only supports a single AC97 device */
@@ -317,8 +320,13 @@ static int ep93xx_ac97_trigger(struct snd_pcm_substream *substream,
317 320
318static int ep93xx_ac97_dai_probe(struct snd_soc_dai *dai) 321static int ep93xx_ac97_dai_probe(struct snd_soc_dai *dai)
319{ 322{
320 dai->playback_dma_data = &ep93xx_ac97_pcm_out; 323 struct ep93xx_ac97_info *info = snd_soc_dai_get_drvdata(dai);
321 dai->capture_dma_data = &ep93xx_ac97_pcm_in; 324
325 info->dma_params_tx.filter_data = &ep93xx_ac97_pcm_out;
326 info->dma_params_rx.filter_data = &ep93xx_ac97_pcm_in;
327
328 dai->playback_dma_data = &info->dma_params_tx;
329 dai->capture_dma_data = &info->dma_params_rx;
322 330
323 return 0; 331 return 0;
324} 332}
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 167728a73da2..943145f9d1b6 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -21,6 +21,7 @@
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <sound/core.h> 23#include <sound/core.h>
24#include <sound/dmaengine_pcm.h>
24#include <sound/pcm.h> 25#include <sound/pcm.h>
25#include <sound/pcm_params.h> 26#include <sound/pcm_params.h>
26#include <sound/initval.h> 27#include <sound/initval.h>
@@ -63,6 +64,8 @@ struct ep93xx_i2s_info {
63 struct clk *sclk; 64 struct clk *sclk;
64 struct clk *lrclk; 65 struct clk *lrclk;
65 void __iomem *regs; 66 void __iomem *regs;
67 struct snd_dmaengine_dai_dma_data dma_params_rx;
68 struct snd_dmaengine_dai_dma_data dma_params_tx;
66}; 69};
67 70
68static struct ep93xx_dma_data ep93xx_i2s_dma_data[] = { 71static struct ep93xx_dma_data ep93xx_i2s_dma_data[] = {
@@ -142,8 +145,15 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream)
142 145
143static int ep93xx_i2s_dai_probe(struct snd_soc_dai *dai) 146static int ep93xx_i2s_dai_probe(struct snd_soc_dai *dai)
144{ 147{
145 dai->playback_dma_data = &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_PLAYBACK]; 148 struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
146 dai->capture_dma_data = &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_CAPTURE]; 149
150 info->dma_params_tx.filter_data =
151 &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_PLAYBACK];
152 info->dma_params_rx.filter_data =
153 &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_CAPTURE];
154
155 dai->playback_dma_data = &info->dma_params_tx;
156 dai->capture_dma_data = &info->dma_params_rx;
147 157
148 return 0; 158 return 0;
149} 159}
diff --git a/sound/soc/cirrus/ep93xx-pcm.c b/sound/soc/cirrus/ep93xx-pcm.c
index 198c5405f2ce..ca6698d75736 100644
--- a/sound/soc/cirrus/ep93xx-pcm.c
+++ b/sound/soc/cirrus/ep93xx-pcm.c
@@ -59,22 +59,9 @@ static bool ep93xx_pcm_dma_filter(struct dma_chan *chan, void *filter_param)
59 return false; 59 return false;
60} 60}
61 61
62static struct dma_chan *ep93xx_compat_request_channel(
63 struct snd_soc_pcm_runtime *rtd,
64 struct snd_pcm_substream *substream)
65{
66 struct snd_dmaengine_dai_dma_data *dma_data;
67
68 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
69
70 return snd_dmaengine_pcm_request_channel(ep93xx_pcm_dma_filter,
71 dma_data);
72}
73
74static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = { 62static const struct snd_dmaengine_pcm_config ep93xx_dmaengine_pcm_config = {
75 .pcm_hardware = &ep93xx_pcm_hardware, 63 .pcm_hardware = &ep93xx_pcm_hardware,
76 .compat_filter_fn = ep93xx_pcm_dma_filter, 64 .compat_filter_fn = ep93xx_pcm_dma_filter,
77 .compat_request_channel = ep93xx_compat_request_channel,
78 .prealloc_buffer_size = 131072, 65 .prealloc_buffer_size = 131072,
79}; 66};
80 67