asoc: tegra: Fix error in checking SMMU flag
Rahul Mittal [Mon, 29 Oct 2012 06:26:23 +0000 (11:26 +0530)]
SMMU flag check was wrong due to which DMA allocs were done using SMMU
Corrected check to disable SMMU allocations

Bug 1160332
Bug 1155696

Change-Id: I154716d1dc93e45f1f9f1c997bf63fa6f23b73bc
Signed-off-by: Rahul Mittal <rmittal@nvidia.com>
Reviewed-on: http://git-master/r/159472
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>

sound/soc/tegra/tegra_pcm.c
sound/soc/tegra/tegra_pcm.h

index 4af57dc..4f19bd4 100644 (file)
@@ -125,7 +125,7 @@ static void setup_dma_tx_request(struct tegra_dma_req *req,
        req->dest_bus_width = dmap->width;
        req->req_sel = dmap->req_sel;
        req->use_smmu = false;
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
        req->use_smmu = true;
 #endif
 }
@@ -142,7 +142,7 @@ static void setup_dma_rx_request(struct tegra_dma_req *req,
        req->dest_bus_width = 32;
        req->req_sel = dmap->req_sel;
        req->use_smmu = false;
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
        req->use_smmu = true;
 #endif
 }
@@ -366,7 +366,7 @@ static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
 {
        struct snd_pcm_substream *substream = pcm->streams[stream].substream;
        struct snd_dma_buffer *buf = &substream->dma_buffer;
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
        unsigned char *vaddr;
        phys_addr_t paddr;
        struct tegra_smmu_data *ptsd;
@@ -402,7 +402,7 @@ void tegra_pcm_deallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 {
        struct snd_pcm_substream *substream;
        struct snd_dma_buffer *buf;
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
        struct tegra_smmu_data *ptsd;
 #endif
 
@@ -414,7 +414,7 @@ void tegra_pcm_deallocate_dma_buffer(struct snd_pcm *pcm, int stream)
        if (!buf->area)
                return;
 
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
        if (!buf->private_data)
                return;
        ptsd = (struct tegra_smmu_data *)buf->private_data;
index 7a0fbfc..0fb2fac 100644 (file)
@@ -36,9 +36,7 @@
 
 #define MAX_DMA_REQ_COUNT 2
 
-#ifdef CONFIG_ARCH_TEGRA_11x_SOC
 #define TEGRA30_USE_SMMU 0
-#endif
 
 struct tegra_pcm_dma_params {
        unsigned long addr;
@@ -62,7 +60,7 @@ struct tegra_runtime_data {
        unsigned int avp_dma_addr;
 };
 
-#ifdef TEGRA30_USE_SMMU
+#if TEGRA30_USE_SMMU
 struct tegra_smmu_data {
        struct nvmap_client *pcm_nvmap_client;
        struct nvmap_handle_ref *pcm_nvmap_handle;