Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e36d88aa authored by Shiraz Hashim's avatar Shiraz Hashim
Browse files

iommu: msm: add iommu->dma_supported hook



iommu->dma_supported checks if the device can
support DMA to the memory described by the mask.
Add this for the legacy msm iommu driver.

Change-Id: Iebddc78cf1206bfed30c5d4e0f2ec01d012072e3
Signed-off-by: default avatarShiraz Hashim <shashim@codeaurora.org>
parent 0dfa7fd5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1548,6 +1548,12 @@ static int msm_iommu_domain_get_attr(struct iommu_domain *domain,
	return 0;
}

static int msm_iommu_dma_supported(struct iommu_domain *domain,
				  struct device *dev, u64 mask)
{
	return ((1ULL << 32) - 1) < mask ? 0 : 1;
}

static struct iommu_ops msm_iommu_ops = {
	.domain_init = msm_iommu_domain_init,
	.domain_destroy = msm_iommu_domain_destroy,
@@ -1563,6 +1569,7 @@ static struct iommu_ops msm_iommu_ops = {
	.pgsize_bitmap = MSM_IOMMU_PGSIZES,
	.domain_set_attr = msm_iommu_domain_set_attr,
	.domain_get_attr = msm_iommu_domain_get_attr,
	.dma_supported = msm_iommu_dma_supported,
};

static int __init msm_iommu_init(void)
+6 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,11 @@ int is_vfe_secure(void)
	return secure_camera_enabled;
}

static int msm_iommu_dma_supported(struct iommu_domain *domain,
				  struct device *dev, u64 mask)
{
	return ((1ULL << 32) - 1) < mask ? 0 : 1;
}

static struct iommu_ops msm_iommu_ops = {
	.domain_init = msm_iommu_domain_init,
@@ -1017,6 +1022,7 @@ static struct iommu_ops msm_iommu_ops = {
	.iova_to_phys = msm_iommu_iova_to_phys,
	.capable = msm_iommu_capable,
	.pgsize_bitmap = MSM_IOMMU_PGSIZES,
	.dma_supported = msm_iommu_dma_supported,
};

static int __init msm_iommu_sec_init(void)