diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-12 08:57:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-12 08:57:04 -0400 |
commit | 38e8c895d33b0642dc341f83cce0adde4cffbc82 (patch) | |
tree | 3657c043986d5c944f971c9685ae4a68f5a5b035 /sound/soc/atmel | |
parent | d66e065c5b8b64b03a9d9b8a7c5d674c7dfa2e3d (diff) | |
parent | 69b6f19622ce0aef41df884b75e3f789c64b89c0 (diff) |
Merge remote-tracking branch 'asoc/topic/dma' into asoc-next
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel-pcm-dma.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 30184a4a147a..bb07989762d5 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c | |||
@@ -67,9 +67,10 @@ static const struct snd_pcm_hardware atmel_pcm_dma_hardware = { | |||
67 | static void atmel_pcm_dma_irq(u32 ssc_sr, | 67 | static void atmel_pcm_dma_irq(u32 ssc_sr, |
68 | struct snd_pcm_substream *substream) | 68 | struct snd_pcm_substream *substream) |
69 | { | 69 | { |
70 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
70 | struct atmel_pcm_dma_params *prtd; | 71 | struct atmel_pcm_dma_params *prtd; |
71 | 72 | ||
72 | prtd = snd_dmaengine_pcm_get_data(substream); | 73 | prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
73 | 74 | ||
74 | if (ssc_sr & prtd->mask->ssc_error) { | 75 | if (ssc_sr & prtd->mask->ssc_error) { |
75 | if (snd_pcm_running(substream)) | 76 | if (snd_pcm_running(substream)) |
@@ -104,15 +105,13 @@ static bool filter(struct dma_chan *chan, void *slave) | |||
104 | } | 105 | } |
105 | 106 | ||
106 | static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, | 107 | static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, |
107 | struct snd_pcm_hw_params *params) | 108 | struct snd_pcm_hw_params *params, struct atmel_pcm_dma_params *prtd) |
108 | { | 109 | { |
109 | struct atmel_pcm_dma_params *prtd; | ||
110 | struct ssc_device *ssc; | 110 | struct ssc_device *ssc; |
111 | struct dma_chan *dma_chan; | 111 | struct dma_chan *dma_chan; |
112 | struct dma_slave_config slave_config; | 112 | struct dma_slave_config slave_config; |
113 | int ret; | 113 | int ret; |
114 | 114 | ||
115 | prtd = snd_dmaengine_pcm_get_data(substream); | ||
116 | ssc = prtd->ssc; | 115 | ssc = prtd->ssc; |
117 | 116 | ||
118 | ret = snd_hwparams_to_dma_slave_config(substream, params, | 117 | ret = snd_hwparams_to_dma_slave_config(substream, params, |
@@ -130,8 +129,6 @@ static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, | |||
130 | slave_config.src_maxburst = 1; | 129 | slave_config.src_maxburst = 1; |
131 | } | 130 | } |
132 | 131 | ||
133 | slave_config.device_fc = false; | ||
134 | |||
135 | dma_chan = snd_dmaengine_pcm_get_chan(substream); | 132 | dma_chan = snd_dmaengine_pcm_get_chan(substream); |
136 | if (dmaengine_slave_config(dma_chan, &slave_config)) { | 133 | if (dmaengine_slave_config(dma_chan, &slave_config)) { |
137 | pr_err("atmel-pcm: failed to configure dma channel\n"); | 134 | pr_err("atmel-pcm: failed to configure dma channel\n"); |
@@ -164,9 +161,7 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream, | |||
164 | return -EINVAL; | 161 | return -EINVAL; |
165 | } | 162 | } |
166 | 163 | ||
167 | snd_dmaengine_pcm_set_data(substream, prtd); | 164 | ret = atmel_pcm_configure_dma(substream, params, prtd); |
168 | |||
169 | ret = atmel_pcm_configure_dma(substream, params); | ||
170 | if (ret) { | 165 | if (ret) { |
171 | pr_err("atmel-pcm: failed to configure dmai\n"); | 166 | pr_err("atmel-pcm: failed to configure dmai\n"); |
172 | goto err; | 167 | goto err; |
@@ -182,9 +177,10 @@ err: | |||
182 | 177 | ||
183 | static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) | 178 | static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) |
184 | { | 179 | { |
180 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
185 | struct atmel_pcm_dma_params *prtd; | 181 | struct atmel_pcm_dma_params *prtd; |
186 | 182 | ||
187 | prtd = snd_dmaengine_pcm_get_data(substream); | 183 | prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
188 | 184 | ||
189 | ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); | 185 | ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); |
190 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); | 186 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); |
@@ -199,16 +195,9 @@ static int atmel_pcm_open(struct snd_pcm_substream *substream) | |||
199 | return 0; | 195 | return 0; |
200 | } | 196 | } |
201 | 197 | ||
202 | static int atmel_pcm_close(struct snd_pcm_substream *substream) | ||
203 | { | ||
204 | snd_dmaengine_pcm_close(substream); | ||
205 | |||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | static struct snd_pcm_ops atmel_pcm_ops = { | 198 | static struct snd_pcm_ops atmel_pcm_ops = { |
210 | .open = atmel_pcm_open, | 199 | .open = atmel_pcm_open, |
211 | .close = atmel_pcm_close, | 200 | .close = snd_dmaengine_pcm_close, |
212 | .ioctl = snd_pcm_lib_ioctl, | 201 | .ioctl = snd_pcm_lib_ioctl, |
213 | .hw_params = atmel_pcm_hw_params, | 202 | .hw_params = atmel_pcm_hw_params, |
214 | .prepare = atmel_pcm_dma_prepare, | 203 | .prepare = atmel_pcm_dma_prepare, |