aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c24xx-pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-06 15:46:18 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-06 15:46:18 +0000
commit330f28f691e9b349e34adcaf82b273cf061bb491 (patch)
treefca3bfe41eff25ef19f576cef1979c68f6521af5 /sound/soc/s3c24xx/s3c24xx-pcm.c
parentASoC: Factor out snd_soc_init_card() (diff)
parentASoC: S3C64XX I2S: Enable audio-bus clock (diff)
downloadlinux-dev-330f28f691e9b349e34adcaf82b273cf061bb491.tar.xz
linux-dev-330f28f691e9b349e34adcaf82b273cf061bb491.zip
Merge branch 'for-2.6.32' into for-2.6.33
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-pcm.c')
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 27cf097c2b1d..151a69463269 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -74,11 +74,19 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
{
struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
dma_addr_t pos = prtd->dma_pos;
+ unsigned int limit;
int ret;
pr_debug("Entered %s\n", __func__);
- while (prtd->dma_loaded < prtd->dma_limit) {
+ if (s3c_dma_has_circular()) {
+ limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period;
+ } else
+ limit = prtd->dma_limit;
+
+ pr_debug("%s: loaded %d, limit %d\n", __func__, prtd->dma_loaded, limit);
+
+ while (prtd->dma_loaded < limit) {
unsigned long len = prtd->dma_period;
pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
@@ -122,7 +130,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
snd_pcm_period_elapsed(substream);
spin_lock(&prtd->lock);
- if (prtd->state & ST_RUNNING) {
+ if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) {
prtd->dma_loaded--;
s3c24xx_pcm_enqueue(substream);
}
@@ -163,6 +171,11 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
printk(KERN_ERR "failed to get dma channel\n");
return ret;
}
+
+ /* use the circular buffering if we have it available. */
+ if (s3c_dma_has_circular())
+ s3c2410_dma_setflags(prtd->params->channel,
+ S3C2410_DMAF_CIRCULAR);
}
s3c2410_dma_set_buffdone_fn(prtd->params->channel,