diff options
author | Bo Shen <voice.shen@atmel.com> | 2013-07-03 04:37:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-15 06:07:56 -0400 |
commit | cede8d7aaa60bd7c03b9ec5eb43b09714710b8ba (patch) | |
tree | f65ecb09ebbe7150db67eecdd48719493de8ec67 /sound/soc/atmel | |
parent | f1b0dd8b9377590b387fd21ba67081ed0e7111e3 (diff) |
ASoC: atmel-pcm-dma: move prepare for dma to dai prepare
as prepare callback for dma is acctually access ssc register
which better done in dai driver, so move it to dai prepare
callback function
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel-pcm-dma.c | 14 | ||||
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 1 |
2 files changed, 1 insertions, 14 deletions
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 1d38fd0bc4e2..5a57803cb180 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c | |||
@@ -175,19 +175,6 @@ err: | |||
175 | return ret; | 175 | return ret; |
176 | } | 176 | } |
177 | 177 | ||
178 | static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) | ||
179 | { | ||
180 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
181 | struct atmel_pcm_dma_params *prtd; | ||
182 | |||
183 | prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | ||
184 | |||
185 | ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); | ||
186 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); | ||
187 | |||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static int atmel_pcm_open(struct snd_pcm_substream *substream) | 178 | static int atmel_pcm_open(struct snd_pcm_substream *substream) |
192 | { | 179 | { |
193 | snd_soc_set_runtime_hwparams(substream, &atmel_pcm_dma_hardware); | 180 | snd_soc_set_runtime_hwparams(substream, &atmel_pcm_dma_hardware); |
@@ -200,7 +187,6 @@ static struct snd_pcm_ops atmel_pcm_ops = { | |||
200 | .close = snd_dmaengine_pcm_close_release_chan, | 187 | .close = snd_dmaengine_pcm_close_release_chan, |
201 | .ioctl = snd_pcm_lib_ioctl, | 188 | .ioctl = snd_pcm_lib_ioctl, |
202 | .hw_params = atmel_pcm_hw_params, | 189 | .hw_params = atmel_pcm_hw_params, |
203 | .prepare = atmel_pcm_dma_prepare, | ||
204 | .trigger = snd_dmaengine_pcm_trigger, | 190 | .trigger = snd_dmaengine_pcm_trigger, |
205 | .pointer = snd_dmaengine_pcm_pointer_no_residue, | 191 | .pointer = snd_dmaengine_pcm_pointer_no_residue, |
206 | .mmap = atmel_pcm_mmap, | 192 | .mmap = atmel_pcm_mmap, |
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 1ab47639f11c..0ecf356027f6 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c | |||
@@ -649,6 +649,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, | |||
649 | dma_params = ssc_p->dma_params[dir]; | 649 | dma_params = ssc_p->dma_params[dir]; |
650 | 650 | ||
651 | ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable); | 651 | ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable); |
652 | ssc_writel(ssc_p->ssc->regs, IER, dma_params->mask->ssc_error); | ||
652 | 653 | ||
653 | pr_debug("%s enabled SSC_SR=0x%08x\n", | 654 | pr_debug("%s enabled SSC_SR=0x%08x\n", |
654 | dir ? "receive" : "transmit", | 655 | dir ? "receive" : "transmit", |