From: Bo Shen <voice.shen@atmel.com>
To: Mark Brown <broonie@kernel.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
lars@metafoo.de, richard.genoud@gmail.com,
linux-arm-kernel@lists.infradead.org,
alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
Bo Shen <voice.shen@atmel.com>
Subject: [v2 3/5] ASoC: atmel-pcm-dma: move prepare for dma to dai prepare
Date: Wed, 03 Jul 2013 08:37:58 +0000 [thread overview]
Message-ID: <1372840680-2253-4-git-send-email-voice.shen@atmel.com> (raw)
In-Reply-To: <1372840680-2253-1-git-send-email-voice.shen@atmel.com>
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>
---
Change in v2:
- split as a new patch
---
sound/soc/atmel/atmel-pcm-dma.c | 14 --------------
sound/soc/atmel/atmel_ssc_dai.c | 1 +
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c
index 1d38fd0..5a57803 100644
--- a/sound/soc/atmel/atmel-pcm-dma.c
+++ b/sound/soc/atmel/atmel-pcm-dma.c
@@ -175,19 +175,6 @@ err:
return ret;
}
-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;
-
- 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_CR, prtd->mask->ssc_enable);
-
- return 0;
-}
-
static int atmel_pcm_open(struct snd_pcm_substream *substream)
{
snd_soc_set_runtime_hwparams(substream, &atmel_pcm_dma_hardware);
@@ -200,7 +187,6 @@ static struct snd_pcm_ops atmel_pcm_ops = {
.close = snd_dmaengine_pcm_close_release_chan,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = atmel_pcm_hw_params,
- .prepare = atmel_pcm_dma_prepare,
.trigger = snd_dmaengine_pcm_trigger,
.pointer = snd_dmaengine_pcm_pointer_no_residue,
.mmap = atmel_pcm_mmap,
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 1ab4763..0ecf356 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,
dma_params = ssc_p->dma_params[dir];
ssc_writel(ssc_p->ssc->regs, CR, dma_params->mask->ssc_enable);
+ ssc_writel(ssc_p->ssc->regs, IER, dma_params->mask->ssc_error);
pr_debug("%s enabled SSC_SR=0x%08x\n",
dir ? "receive" : "transmit",
--
1.7.9.5
next prev parent reply other threads:[~2013-07-03 8:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 8:37 [v2 0/5] ASoC: atmel-pcm: align with generic dmaengine framwork Bo Shen
2013-07-03 8:37 ` [v2 1/5] ASoC: atmel_ssc_dai: move set dma data to startup callback Bo Shen
2013-07-03 8:37 ` [v2 2/5] ASoC: atmel_ssc_dai: add error mask define Bo Shen
2013-07-03 8:37 ` Bo Shen [this message]
2013-07-03 8:37 ` [v2 4/5] ARM: atmel-ssc: change phybase type to dma_addr_t Bo Shen
2013-07-03 8:38 ` [v2 5/5] ASoC: atmel-pcm: use generic dmaengine framework Bo Shen
2013-07-03 9:01 ` [v2 0/5] ASoC: atmel-pcm: align with generic dmaengine framwork Lars-Peter Clausen
2013-07-03 9:52 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372840680-2253-4-git-send-email-voice.shen@atmel.com \
--to=voice.shen@atmel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=richard.genoud@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox