sound: tegra: utils: replace dma_alloc_writecombine with coherent

dma_alloc_writecombine forces non-cached memory irrespective
HW module IO coherency.
Use dma_alloc_coherent API, which selects the right memory
type depending on HW module.

Bug 2003170

Change-Id: I686713291c1469e67f7430550ad20c01028bf636
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1589979
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Puneet Saxena
2017-11-01 17:00:36 +05:30
committed by Sameer Pujar
parent aa5200c4d8
commit fae9c0a600

View File

@@ -194,7 +194,7 @@ static int tegra_alt_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
{ {
struct snd_pcm_substream *substream = pcm->streams[stream].substream; struct snd_pcm_substream *substream = pcm->streams[stream].substream;
struct snd_dma_buffer *buf = &substream->dma_buffer; struct snd_dma_buffer *buf = &substream->dma_buffer;
buf->area = dma_alloc_writecombine(pcm->card->dev, size, buf->area = dma_alloc_coherent(pcm->card->dev, size,
&buf->addr, GFP_KERNEL); &buf->addr, GFP_KERNEL);
if (!buf->area) if (!buf->area)
return -ENOMEM; return -ENOMEM;
@@ -219,7 +219,7 @@ static void tegra_alt_pcm_deallocate_dma_buffer(struct snd_pcm *pcm, int stream)
if (!buf->area) if (!buf->area)
return; return;
dma_free_writecombine(pcm->card->dev, buf->bytes, dma_free_coherent(pcm->card->dev, buf->bytes,
buf->area, buf->addr); buf->area, buf->addr);
buf->area = NULL; buf->area = NULL;
} }