aboutsummaryrefslogtreecommitdiff
path: root/sound/drivers/vx/vx_pcm.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-11-30 12:03:38 +0800
committerAlex Shi <alex.shi@linaro.org>2017-11-30 12:03:38 +0800
commit1184d6e8873282bcb4ba1d57da1cdd423a0f42d6 (patch)
tree66bf3b45f218c738312d40e90c52f25069709892 /sound/drivers/vx/vx_pcm.c
parent382ac60c32998318f133b8b84030aa83a8f600fe (diff)
parent4e22accddef27103c4fba20b9613b7bf52129be6 (diff)
Merge remote-tracking branch 'rt-stable/v4.9-rt' into linux-linaro-lsk-v4.9-rtlsk-v4.9-17.11-rt
Diffstat (limited to 'sound/drivers/vx/vx_pcm.c')
-rw-r--r--sound/drivers/vx/vx_pcm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 11467272089e..ea7b377f0378 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
int size, space, count;
struct snd_pcm_runtime *runtime = subs->runtime;
- if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
+ if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE))
return;
size = runtime->buffer_size - snd_pcm_capture_avail(runtime);
@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream
/* ok, let's accelerate! */
int align = pipe->align * 3;
space = (count / align) * align;
- vx_pseudo_dma_read(chip, runtime, pipe, space);
- count -= space;
+ if (space > 0) {
+ vx_pseudo_dma_read(chip, runtime, pipe, space);
+ count -= space;
+ }
}
/* read the rest of bytes */
while (count > 0) {