Skip to content

Commit d2c302b

Browse files
committed
iommu/exynos: Make use of iommu_device_register interface
Register Exynos IOMMUs to the IOMMU core and make them visible in sysfs. This patch does not add the links between IOMMUs and translated devices yet. Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent b16c017 commit d2c302b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/iommu/exynos-iommu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ struct sysmmu_drvdata {
276276
struct list_head owner_node; /* node for owner controllers list */
277277
phys_addr_t pgtable; /* assigned page table structure */
278278
unsigned int version; /* our version */
279+
280+
struct iommu_device iommu; /* IOMMU core handle */
279281
};
280282

281283
static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom)
@@ -611,6 +613,18 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
611613
data->sysmmu = dev;
612614
spin_lock_init(&data->lock);
613615

616+
ret = iommu_device_sysfs_add(&data->iommu, &pdev->dev, NULL,
617+
dev_name(data->sysmmu));
618+
if (ret)
619+
return ret;
620+
621+
iommu_device_set_ops(&data->iommu, &exynos_iommu_ops);
622+
iommu_device_set_fwnode(&data->iommu, &dev->of_node->fwnode);
623+
624+
ret = iommu_device_register(&data->iommu);
625+
if (ret)
626+
return ret;
627+
614628
platform_set_drvdata(pdev, data);
615629

616630
__sysmmu_get_version(data);

0 commit comments

Comments
 (0)