aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/fsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/fsi.c')
-rw-r--r--sound/soc/sh/fsi.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 7506ef6d287a..b311a9eaf021 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -373,14 +373,16 @@ static int fsi_data_push(struct fsi_priv *fsi)
373 int fifo_free; 373 int fifo_free;
374 int width; 374 int width;
375 u8 *start; 375 u8 *start;
376 int i; 376 int i, over_period;
377 377
378 if (!fsi || 378 if (!fsi ||
379 !fsi->substream || 379 !fsi->substream ||
380 !fsi->substream->runtime) 380 !fsi->substream->runtime)
381 return -EINVAL; 381 return -EINVAL;
382 382
383 runtime = fsi->substream->runtime; 383 over_period = 0;
384 substream = fsi->substream;
385 runtime = substream->runtime;
384 386
385 /* FSI FIFO has limit. 387 /* FSI FIFO has limit.
386 * So, this driver can not send periods data at a time 388 * So, this driver can not send periods data at a time
@@ -388,7 +390,7 @@ static int fsi_data_push(struct fsi_priv *fsi)
388 if (fsi->byte_offset >= 390 if (fsi->byte_offset >=
389 fsi->period_len * (fsi->periods + 1)) { 391 fsi->period_len * (fsi->periods + 1)) {
390 392
391 substream = fsi->substream; 393 over_period = 1;
392 fsi->periods = (fsi->periods + 1) % runtime->periods; 394 fsi->periods = (fsi->periods + 1) % runtime->periods;
393 395
394 if (0 == fsi->periods) 396 if (0 == fsi->periods)
@@ -429,7 +431,7 @@ static int fsi_data_push(struct fsi_priv *fsi)
429 431
430 fsi_irq_enable(fsi, 1); 432 fsi_irq_enable(fsi, 1);
431 433
432 if (substream) 434 if (over_period)
433 snd_pcm_period_elapsed(substream); 435 snd_pcm_period_elapsed(substream);
434 436
435 return 0; 437 return 0;
@@ -443,14 +445,16 @@ static int fsi_data_pop(struct fsi_priv *fsi)
443 int fifo_fill; 445 int fifo_fill;
444 int width; 446 int width;
445 u8 *start; 447 u8 *start;
446 int i; 448 int i, over_period;
447 449
448 if (!fsi || 450 if (!fsi ||
449 !fsi->substream || 451 !fsi->substream ||
450 !fsi->substream->runtime) 452 !fsi->substream->runtime)
451 return -EINVAL; 453 return -EINVAL;
452 454
453 runtime = fsi->substream->runtime; 455 over_period = 0;
456 substream = fsi->substream;
457 runtime = substream->runtime;
454 458
455 /* FSI FIFO has limit. 459 /* FSI FIFO has limit.
456 * So, this driver can not send periods data at a time 460 * So, this driver can not send periods data at a time
@@ -458,7 +462,7 @@ static int fsi_data_pop(struct fsi_priv *fsi)
458 if (fsi->byte_offset >= 462 if (fsi->byte_offset >=
459 fsi->period_len * (fsi->periods + 1)) { 463 fsi->period_len * (fsi->periods + 1)) {
460 464
461 substream = fsi->substream; 465 over_period = 1;
462 fsi->periods = (fsi->periods + 1) % runtime->periods; 466 fsi->periods = (fsi->periods + 1) % runtime->periods;
463 467
464 if (0 == fsi->periods) 468 if (0 == fsi->periods)
@@ -498,7 +502,7 @@ static int fsi_data_pop(struct fsi_priv *fsi)
498 502
499 fsi_irq_enable(fsi, 0); 503 fsi_irq_enable(fsi, 0);
500 504
501 if (substream) 505 if (over_period)
502 snd_pcm_period_elapsed(substream); 506 snd_pcm_period_elapsed(substream);
503 507
504 return 0; 508 return 0;