Lines Matching refs:iommu
85 struct msm_iommu *iommu = to_msm_iommu(pagetable->parent); in msm_iommu_pagetable_destroy() local
93 if (atomic_dec_return(&iommu->pagetables) == 0) in msm_iommu_pagetable_destroy()
149 struct msm_iommu *iommu = to_msm_iommu(parent); in msm_iommu_pagetable_create() local
176 &ttbr0_cfg, iommu->domain); in msm_iommu_pagetable_create()
187 if (atomic_inc_return(&iommu->pagetables) == 1) { in msm_iommu_pagetable_create()
214 struct msm_iommu *iommu = arg; in msm_fault_handler() local
215 if (iommu->base.handler) in msm_fault_handler()
216 return iommu->base.handler(iommu->base.arg, iova, flags); in msm_fault_handler()
223 struct msm_iommu *iommu = to_msm_iommu(mmu); in msm_iommu_detach() local
225 iommu_detach_device(iommu->domain, mmu->dev); in msm_iommu_detach()
231 struct msm_iommu *iommu = to_msm_iommu(mmu); in msm_iommu_map() local
238 ret = iommu_map_sgtable(iommu->domain, iova, sgt, prot); in msm_iommu_map()
246 struct msm_iommu *iommu = to_msm_iommu(mmu); in msm_iommu_unmap() local
251 iommu_unmap(iommu->domain, iova, len); in msm_iommu_unmap()
258 struct msm_iommu *iommu = to_msm_iommu(mmu); in msm_iommu_destroy() local
259 iommu_domain_free(iommu->domain); in msm_iommu_destroy()
260 kfree(iommu); in msm_iommu_destroy()
272 struct msm_iommu *iommu; in msm_iommu_new() local
278 iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); in msm_iommu_new()
279 if (!iommu) in msm_iommu_new()
282 iommu->domain = domain; in msm_iommu_new()
283 msm_mmu_init(&iommu->base, dev, &funcs, MSM_MMU_IOMMU); in msm_iommu_new()
284 iommu_set_fault_handler(domain, msm_fault_handler, iommu); in msm_iommu_new()
286 atomic_set(&iommu->pagetables, 0); in msm_iommu_new()
288 ret = iommu_attach_device(iommu->domain, dev); in msm_iommu_new()
290 kfree(iommu); in msm_iommu_new()
294 return &iommu->base; in msm_iommu_new()