diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-22 09:12:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-26 10:16:41 -0400 |
commit | 5fe668a1d2c27223fea4991ebf90ee28b7d1941c (patch) | |
tree | 8ebc499c28f5b08842675e85904036b6fb58aea7 /sound/soc/atmel | |
parent | 593b66fbbcac78b73ec17270c874f6db8eabd97c (diff) |
ASoC: atmel-pcm-dma: Do not use snd_dmaengine_pcm_{set,get}_data()
We want to get rid of snd_dmaengine_pcm_{set,get}_data(). All instances of
snd_dmaengine_pcm_get_data() in the atmel pcm driver can easily be replaced with
snd_soc_dai_get_dma_data().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel-pcm-dma.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 396bf78c7a2d..b8570e3e1b57 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, |
@@ -164,9 +163,7 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream, | |||
164 | return -EINVAL; | 163 | return -EINVAL; |
165 | } | 164 | } |
166 | 165 | ||
167 | snd_dmaengine_pcm_set_data(substream, prtd); | 166 | ret = atmel_pcm_configure_dma(substream, params, prtd); |
168 | |||
169 | ret = atmel_pcm_configure_dma(substream, params); | ||
170 | if (ret) { | 167 | if (ret) { |
171 | pr_err("atmel-pcm: failed to configure dmai\n"); | 168 | pr_err("atmel-pcm: failed to configure dmai\n"); |
172 | goto err; | 169 | goto err; |
@@ -182,9 +179,10 @@ err: | |||
182 | 179 | ||
183 | static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) | 180 | static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) |
184 | { | 181 | { |
182 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
185 | struct atmel_pcm_dma_params *prtd; | 183 | struct atmel_pcm_dma_params *prtd; |
186 | 184 | ||
187 | prtd = snd_dmaengine_pcm_get_data(substream); | 185 | prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
188 | 186 | ||
189 | ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); | 187 | ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); |
190 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); | 188 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); |