From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: David Anders <dave123_aml@yahoo.com>,
alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 4/4] ASoC: Add new parameter to s3c24xx_pcm_enqueue
Date: Wed, 5 Nov 2008 18:53:31 +0000 [thread overview]
Message-ID: <1225911211-22474-4-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1225911211-22474-3-git-send-email-broonie@opensource.wolfsonmicro.com>
From: David Anders <dave123_aml@yahoo.com>
The S3C24xx dma does not allow more than one buffer to be enqueue prior to
the dma transfers starting. This patch adds an additional parameter to
s3c24xx_pcm_enqueue() to allow for passing an initial dma maximum load
value.
Signed-off-by: David Anders <danders at amltd.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/s3c24xx/s3c24xx-pcm.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index e13e614..341198b 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -78,7 +78,8 @@ struct s3c24xx_runtime_data {
* place a dma buffer onto the queue for the dma system
* to handle.
*/
-static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
+static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream,
+ int dma_max)
{
struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
dma_addr_t pos = prtd->dma_pos;
@@ -86,7 +87,10 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
DBG("Entered %s\n", __func__);
- while (prtd->dma_loaded < prtd->dma_limit) {
+ if (!dma_max)
+ dma_max = prtd->dma_limit;
+
+ while (prtd->dma_loaded < dma_max) {
unsigned long len = prtd->dma_period;
DBG("dma_loaded: %d\n", prtd->dma_loaded);
@@ -132,7 +136,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
spin_lock(&prtd->lock);
if (prtd->state & ST_RUNNING) {
prtd->dma_loaded--;
- s3c24xx_pcm_enqueue(substream);
+ s3c24xx_pcm_enqueue(substream, 0);
}
spin_unlock(&prtd->lock);
@@ -249,7 +253,7 @@ static int s3c24xx_pcm_prepare(struct snd_pcm_substream *substream)
prtd->dma_pos = prtd->dma_start;
/* enqueue dma buffers */
- s3c24xx_pcm_enqueue(substream);
+ s3c24xx_pcm_enqueue(substream, 1);
return ret;
}
--
1.5.6.5
next prev parent reply other threads:[~2008-11-05 18:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-05 18:52 [PATCH 0/4] ASoC updates Mark Brown
2008-11-05 18:53 ` [PATCH 1/4] ASoC: TLV320AIC23B Support more sample rates Mark Brown
2008-11-05 18:53 ` [PATCH 2/4] ASoC: Add Palm/PXA27x unified ASoC audio driver Mark Brown
2008-11-05 18:53 ` [PATCH 3/4] ASoC: Remove core version number Mark Brown
2008-11-05 18:53 ` Mark Brown [this message]
2008-11-05 19:35 ` [PATCH 2/4] ASoC: Add Palm/PXA27x unified ASoC audio driver Marek Vasut
2008-11-05 20:35 ` Takashi Iwai
2008-11-05 21:54 ` Mark Brown
2008-11-05 20:35 ` [PATCH 1/4] ASoC: TLV320AIC23B Support more sample rates Takashi Iwai
2008-11-05 22:05 ` Mark Brown
2008-11-06 23:11 ` [PATCH 1/1] [ALSA] " Troy Kisky
2008-11-07 14:10 ` Mark Brown
2008-11-06 10:49 ` [PATCH 1/4] " Mark Brown
2008-11-06 11:03 ` Takashi Iwai
2008-11-06 11:23 ` Takashi Iwai
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=1225911211-22474-4-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=dave123_aml@yahoo.com \
--cc=tiwai@suse.de \
/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