summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_pcm.c
diff options
context:
space:
mode:
authorSumit Bhattacharya <sumitb@nvidia.com>2011-12-07 20:20:43 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-15 11:49:06 +0530
commitcdd76764cc44d9b6091672af235d52a377a0a4d2 (patch)
tree35eebf8a14892a76df3b1ea1960d5b34c6394dd5 /sound/soc/tegra/tegra_pcm.c
parent6212a204e86486daf1c870f207d41c32c79b06a9 (diff)
ASoC: Tegra: return accurate pcm pointer position
Use DMA driver tegra_dma_get_transfer_count api to get current DMA position and use it to return accurate PCM poiter position. Change-Id: I28906a1f2dd47dd91f03b8a79f53196752be6083 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/68692 Reviewed-by: Lokesh Pathak <lpathak@nvidia.com> Tested-by: Lokesh Pathak <lpathak@nvidia.com>
Diffstat (limited to 'sound/soc/tegra/tegra_pcm.c')
-rw-r--r--sound/soc/tegra/tegra_pcm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 53f4e4c3c08c..a27f65f68325 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -292,10 +292,15 @@ static snd_pcm_uframes_t tegra_pcm_pointer(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct tegra_runtime_data *prtd = runtime->private_data;
+ int dma_transfer_count;
- return prtd->period_index * runtime->period_size;
-}
+ dma_transfer_count = tegra_dma_get_transfer_count(prtd->dma_chan,
+ &prtd->dma_req[prtd->dma_req_idx],
+ false);
+ return prtd->period_index * runtime->period_size +
+ bytes_to_frames(runtime, dma_transfer_count);
+}
static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)