From 1832058fa5aecebd18def8549526fff5233bf488 Mon Sep 17 00:00:00 2001 From: Jinyoung Park Date: Tue, 1 Jul 2014 16:51:24 +0900 Subject: 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 Reviewed-on: http://git-master/r/433116 (cherry picked from commit 4b624565615f4f549a556ac7cbf1957cc8d978d5) Change-Id: Id78e3d225619fb232e10cf957502aea4a131063a Signed-off-by: Jinyoung Park Reviewed-on: http://git-master/r/433893 Reviewed-by: Mandar Padmawar Tested-by: Mandar Padmawar --- drivers/mmc/host/sdhci-tegra.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/mmc') 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 #include #include +#include #ifndef CONFIG_ARM64 #include @@ -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"); -- cgit v1.2.3