summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorChandrakanth Gorantla <cgorantla@nvidia.com>2014-04-14 19:47:23 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-04-22 14:05:13 -0700
commit04de03e4bafd118ad53a30ef9fd65815b00f1829 (patch)
tree0eb388383762ba2b0dc2570d3307f2d12fcf8cce /sound
parente444a2655b157fe8304fe43b807c4502b88ad54b (diff)
ASoC: Tegra: Fix concurrent offload playback
taking care of avp state and stop dma in case of multiple streams Bug 1392136 Change-Id: Icc192816a10e8fab698ed464c763ef25c75ecf36 Signed-off-by: Chandrakanth Gorantla <cgorantla@nvidia.com> Reviewed-on: http://git-master/r/398627 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra30_avp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra30_avp.c b/sound/soc/tegra/tegra30_avp.c
index 983dc091321f..58a4cc370186 100644
--- a/sound/soc/tegra/tegra30_avp.c
+++ b/sound/soc/tegra/tegra30_avp.c
@@ -637,7 +637,7 @@ static int tegra30_avp_stream_set_state(int id, enum KSSTATE new_state)
if (new_state == KSSTATE_RUN)
tegra30_avp_audio_start_dma();
- else
+ else if (old_state == KSSTATE_RUN)
tegra30_avp_audio_stop_dma();
return ret;
@@ -764,6 +764,8 @@ static int tegra30_avp_pcm_open(int *id)
dev_err(audio_avp->dev, "All AVP PCM streams are busy");
return -EBUSY;
}
+
+ audio_avp->stream_active_count++;
tegra30_avp_audio_set_state(KSSTATE_RUN);
return 0;
}
@@ -913,6 +915,8 @@ static int tegra30_avp_compr_open(int *id)
return -EBUSY;
}
audio_avp->avp_stream[*id].is_drain_called = 0;
+
+ audio_avp->stream_active_count++;
tegra30_avp_audio_set_state(KSSTATE_RUN);
return 0;
}
@@ -1252,7 +1256,10 @@ static void tegra30_avp_stream_close(int id)
tegra30_avp_audio_free_dma();
stream->stream_allocated = 0;
tegra30_avp_stream_set_state(id, KSSTATE_STOP);
- tegra30_avp_audio_set_state(KSSTATE_STOP);
+
+ audio_avp->stream_active_count--;
+ if (!(audio_avp->stream_active_count))
+ tegra30_avp_audio_set_state(KSSTATE_STOP);
}
static struct tegra_offload_ops avp_audio_platform = {