summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-06-26 21:54:26 +0200
committerThierry Reding <treding@nvidia.com>2014-08-07 16:02:13 +0200
commit94fd3894396ad5bb4c9fb431862aec9e9bb8d79a (patch)
tree644d1fde1328bb27da7dbb2cf0bdcb10222b002e
parent2c93f25df56d547d761cf47cdb9164033f0492d5 (diff)
mmc: sdhci-tegra: Add IOMMU supportstaging/iommu
Attach to the device's master interface of the IOMMU at .probe() time. IOMMU support becomes available via the DMA mapping API interoperation code, but this explicit attachment is necessary to ensure proper probe order. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/mmc/host/sdhci-tegra.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 33100d10d176..b884614fa4e6 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -15,6 +15,7 @@
#include <linux/err.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/iommu.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/io.h>
@@ -237,6 +238,11 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
match = of_match_device(sdhci_tegra_dt_match, &pdev->dev);
if (!match)
return -EINVAL;
+
+ rc = iommu_attach(&pdev->dev);
+ if (rc < 0)
+ return rc;
+
soc_data = match->data;
host = sdhci_pltfm_init(pdev, soc_data->pdata, 0);
@@ -310,6 +316,8 @@ static int sdhci_tegra_remove(struct platform_device *pdev)
clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
+ iommu_detach(&pdev->dev);
+
sdhci_pltfm_free(pdev);
return 0;