Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / of_iommu.h
blob4fa654e4b5a92e1133cc532347711a64edd9eb93
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __OF_IOMMU_H
3 #define __OF_IOMMU_H
5 #include <linux/device.h>
6 #include <linux/iommu.h>
7 #include <linux/of.h>
9 #ifdef CONFIG_OF_IOMMU
11 extern int of_get_dma_window(struct device_node *dn, const char *prefix,
12 int index, unsigned long *busno, dma_addr_t *addr,
13 size_t *size);
15 extern const struct iommu_ops *of_iommu_configure(struct device *dev,
16 struct device_node *master_np);
18 #else
20 static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
21 int index, unsigned long *busno, dma_addr_t *addr,
22 size_t *size)
24 return -EINVAL;
27 static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
28 struct device_node *master_np)
30 return NULL;
33 #endif /* CONFIG_OF_IOMMU */
35 extern struct of_device_id __iommu_of_table;
37 #define IOMMU_OF_DECLARE(name, compat) OF_DECLARE_1(iommu, name, compat, NULL)
39 #endif /* __OF_IOMMU_H */