summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJinyoung Park <jinyoungp@nvidia.com>2014-07-01 16:51:24 +0900
committerMandar Padmawar <mpadmawar@nvidia.com>2014-07-04 00:00:52 -0700
commit1832058fa5aecebd18def8549526fff5233bf488 (patch)
treed9498c65a2618258f4b1c351421f5276fcd44f4b /drivers/mmc
parente8605fd213d8e061eb7f5828fa2a9a36e02d5c19 (diff)
mmc: sdhci: tegra: Add setting for dma-mask
Currently, there is no binding for coherent_dma_mask and dma_mask in device tree. If sdhci-tegra driver is probed from DT, coherent_dma_mask will be set to 32 bit as DT default and dma_mask will be NULL. So added coherent_dma_mask setting for each Tegra SKUs. And if dma_mask is NULL, set it to coherent_dma_mask. Bug 200000521 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/433116 (cherry picked from commit 4b624565615f4f549a556ac7cbf1957cc8d978d5) Change-Id: Id78e3d225619fb232e10cf957502aea4a131063a Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/433893 Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com> Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index bad72e55acdc..605df7aa22c1 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -33,6 +33,7 @@
#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <linux/tegra_pm_domains.h>
+#include <linux/dma-mapping.h>
#ifndef CONFIG_ARM64
#include <asm/gpio.h>
@@ -4055,6 +4056,17 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
goto err_no_plat;
}
+ /* FIXME: This is for until dma-mask binding is supported in DT.
+ * Set coherent_dma_mask for each Tegra SKUs.
+ * If dma_mask is NULL, set it to coherent_dma_mask. */
+ if (soc_data == &soc_data_tegra11)
+ pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ else
+ pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
+
+ if (!pdev->dev.dma_mask)
+ pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
+
tegra_host = devm_kzalloc(&pdev->dev, sizeof(*tegra_host), GFP_KERNEL);
if (!tegra_host) {
dev_err(mmc_dev(host->mmc), "failed to allocate tegra_host\n");