Commit 5fe668a1 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Tested-by: default avatarBo Shen <voice.shen@atmel.com>
Acked-by: default avatarBo Shen <voice.shen@atmel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 593b66fb
...@@ -67,9 +67,10 @@ static const struct snd_pcm_hardware atmel_pcm_dma_hardware = { ...@@ -67,9 +67,10 @@ static const struct snd_pcm_hardware atmel_pcm_dma_hardware = {
static void atmel_pcm_dma_irq(u32 ssc_sr, static void atmel_pcm_dma_irq(u32 ssc_sr,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct atmel_pcm_dma_params *prtd; struct atmel_pcm_dma_params *prtd;
prtd = snd_dmaengine_pcm_get_data(substream); prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
if (ssc_sr & prtd->mask->ssc_error) { if (ssc_sr & prtd->mask->ssc_error) {
if (snd_pcm_running(substream)) if (snd_pcm_running(substream))
...@@ -104,15 +105,13 @@ static bool filter(struct dma_chan *chan, void *slave) ...@@ -104,15 +105,13 @@ static bool filter(struct dma_chan *chan, void *slave)
} }
static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params, struct atmel_pcm_dma_params *prtd)
{ {
struct atmel_pcm_dma_params *prtd;
struct ssc_device *ssc; struct ssc_device *ssc;
struct dma_chan *dma_chan; struct dma_chan *dma_chan;
struct dma_slave_config slave_config; struct dma_slave_config slave_config;
int ret; int ret;
prtd = snd_dmaengine_pcm_get_data(substream);
ssc = prtd->ssc; ssc = prtd->ssc;
ret = snd_hwparams_to_dma_slave_config(substream, params, 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,9 +163,7 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
snd_dmaengine_pcm_set_data(substream, prtd); ret = atmel_pcm_configure_dma(substream, params, prtd);
ret = atmel_pcm_configure_dma(substream, params);
if (ret) { if (ret) {
pr_err("atmel-pcm: failed to configure dmai\n"); pr_err("atmel-pcm: failed to configure dmai\n");
goto err; goto err;
...@@ -182,9 +179,10 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -182,9 +179,10 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream,
static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct atmel_pcm_dma_params *prtd; struct atmel_pcm_dma_params *prtd;
prtd = snd_dmaengine_pcm_get_data(substream); prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error);
ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment