aboutsummaryrefslogtreecommitdiffstats
path: root/sound/arm/aaci.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-13 03:47:35 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-26 15:24:12 -0500
commitea51d0b164040ad594c1f9c4c6faf23c19c977b9 (patch)
tree3729a1a8a15e73ef11f6de51c625d8bbf4d4a3fa /sound/arm/aaci.c
parentc0dea82c3c141c33ca22ca85f80e592028840864 (diff)
ALSA: AACI: no need to call snd_pcm_period_elapsed() for each period
There is no need to call snd_pcm_period_elapsed() each time a period elapses - we can call it after we're done once loading/unloading the FIFO with data. ALSA works out how many periods have elapsed by reading the current pointers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'sound/arm/aaci.c')
-rw-r--r--sound/arm/aaci.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index a8f95382a95a..393ce08b0e11 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -206,6 +206,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
206 206
207 if (mask & ISR_RXINTR) { 207 if (mask & ISR_RXINTR) {
208 struct aaci_runtime *aacirun = &aaci->capture; 208 struct aaci_runtime *aacirun = &aaci->capture;
209 bool period_elapsed = false;
209 void *ptr; 210 void *ptr;
210 211
211 if (!aacirun->substream || !aacirun->start) { 212 if (!aacirun->substream || !aacirun->start) {
@@ -223,10 +224,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
223 224
224 if (aacirun->bytes <= 0) { 225 if (aacirun->bytes <= 0) {
225 aacirun->bytes += aacirun->period; 226 aacirun->bytes += aacirun->period;
226 aacirun->ptr = ptr; 227 period_elapsed = true;
227 spin_unlock(&aacirun->lock);
228 snd_pcm_period_elapsed(aacirun->substream);
229 spin_lock(&aacirun->lock);
230 } 228 }
231 if (!(aacirun->cr & CR_EN)) 229 if (!(aacirun->cr & CR_EN))
232 break; 230 break;
@@ -256,6 +254,9 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
256 aacirun->ptr = ptr; 254 aacirun->ptr = ptr;
257 255
258 spin_unlock(&aacirun->lock); 256 spin_unlock(&aacirun->lock);
257
258 if (period_elapsed)
259 snd_pcm_period_elapsed(aacirun->substream);
259 } 260 }
260 261
261 if (mask & ISR_URINTR) { 262 if (mask & ISR_URINTR) {
@@ -265,6 +266,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
265 266
266 if (mask & ISR_TXINTR) { 267 if (mask & ISR_TXINTR) {
267 struct aaci_runtime *aacirun = &aaci->playback; 268 struct aaci_runtime *aacirun = &aaci->playback;
269 bool period_elapsed = false;
268 void *ptr; 270 void *ptr;
269 271
270 if (!aacirun->substream || !aacirun->start) { 272 if (!aacirun->substream || !aacirun->start) {
@@ -282,10 +284,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
282 284
283 if (aacirun->bytes <= 0) { 285 if (aacirun->bytes <= 0) {
284 aacirun->bytes += aacirun->period; 286 aacirun->bytes += aacirun->period;
285 aacirun->ptr = ptr; 287 period_elapsed = true;
286 spin_unlock(&aacirun->lock);
287 snd_pcm_period_elapsed(aacirun->substream);
288 spin_lock(&aacirun->lock);
289 } 288 }
290 if (!(aacirun->cr & CR_EN)) 289 if (!(aacirun->cr & CR_EN))
291 break; 290 break;
@@ -315,6 +314,9 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
315 aacirun->ptr = ptr; 314 aacirun->ptr = ptr;
316 315
317 spin_unlock(&aacirun->lock); 316 spin_unlock(&aacirun->lock);
317
318 if (period_elapsed)
319 snd_pcm_period_elapsed(aacirun->substream);
318 } 320 }
319} 321}
320 322