Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257466
b: refs/heads/master
c: 10ab3bf
h: refs/heads/master
v: v3
  • Loading branch information
Ben Gardiner authored and Mark Brown committed May 25, 2011
1 parent 3895502 commit 3e7e547
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef39eb6f212996ede8da47ef45e6dffff1121ec7
refs/heads/master: 10ab3bfda41ea21419f6a8d1e5a645521fea4b32
22 changes: 18 additions & 4 deletions trunk/sound/soc/davinci/davinci-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,22 @@ struct davinci_runtime_data {
struct edmacc_param ram_params;
};

static void davinci_pcm_period_elapsed(struct snd_pcm_substream *substream)
{
struct davinci_runtime_data *prtd = substream->runtime->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;

prtd->period++;
if (unlikely(prtd->period >= runtime->periods))
prtd->period = 0;
}

static void davinci_pcm_period_reset(struct snd_pcm_substream *substream)
{
struct davinci_runtime_data *prtd = substream->runtime->private_data;

prtd->period = 0;
}
/*
* Not used with ping/pong
*/
Expand Down Expand Up @@ -216,9 +232,7 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
edma_set_transfer_params(link, acnt, fifo_level, count,
fifo_level, ABSYNC);

prtd->period++;
if (unlikely(prtd->period >= runtime->periods))
prtd->period = 0;
davinci_pcm_period_elapsed(substream);
}

static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)
Expand Down Expand Up @@ -591,7 +605,7 @@ static int davinci_pcm_prepare(struct snd_pcm_substream *substream)

return 0;
}
prtd->period = 0;
davinci_pcm_period_reset(substream);
davinci_pcm_enqueue_dma(substream);

/* Copy self-linked parameter RAM entry into master channel */
Expand Down

0 comments on commit 3e7e547

Please sign in to comment.