* [PATCH] ASoC: Add new parameter to s3c24xx_pcm_enqueue
@ 2008-11-05 15:39 David Anders
2008-11-05 16:05 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: David Anders @ 2008-11-05 15:39 UTC (permalink / raw)
To: Alsa-devel; +Cc: Mark Brown
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>
diff -urN linux-2.6.27-clean/sound/soc/s3c24xx/s3c24xx-pcm.c linux-2.6.27/sound/soc/s3c24xx/s3c24xx-pcm.c
--- linux-2.6.27-clean/sound/soc/s3c24xx/s3c24xx-pcm.c 2008-11-05 08:27:23.000000000 -0600
+++ linux-2.6.27/sound/soc/s3c24xx/s3c24xx-pcm.c 2008-11-05 09:14:27.000000000 -0600
@@ -78,7 +78,8 @@
* 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 @@
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 @@
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 @@
prtd->dma_pos = prtd->dma_start;
/* enqueue dma buffers */
- s3c24xx_pcm_enqueue(substream);
+ s3c24xx_pcm_enqueue(substream, 1);
return ret;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Add new parameter to s3c24xx_pcm_enqueue
2008-11-05 15:39 [PATCH] ASoC: Add new parameter to s3c24xx_pcm_enqueue David Anders
@ 2008-11-05 16:05 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2008-11-05 16:05 UTC (permalink / raw)
To: David Anders; +Cc: Alsa-devel
On Wed, Nov 05, 2008 at 07:39:47AM -0800, David Anders wrote:
> 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>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi, I'll push this later on today along with a few other things
that queued up.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-05 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05 15:39 [PATCH] ASoC: Add new parameter to s3c24xx_pcm_enqueue David Anders
2008-11-05 16:05 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox