sched/wake_q: Clarify queue reinit comment
[cris-mirror.git] / include / linux / of_iommu.h
blob6a7fc50510999eb330982c3d7b4452cb373063e2
1 #ifndef __OF_IOMMU_H
2 #define __OF_IOMMU_H
4 #include <linux/device.h>
5 #include <linux/iommu.h>
6 #include <linux/of.h>
8 #ifdef CONFIG_OF_IOMMU
10 extern int of_get_dma_window(struct device_node *dn, const char *prefix,
11 int index, unsigned long *busno, dma_addr_t *addr,
12 size_t *size);
14 extern const struct iommu_ops *of_iommu_configure(struct device *dev,
15 struct device_node *master_np);
17 #else
19 static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
20 int index, unsigned long *busno, dma_addr_t *addr,
21 size_t *size)
23 return -EINVAL;
26 static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
27 struct device_node *master_np)
29 return NULL;
32 #endif /* CONFIG_OF_IOMMU */
34 static inline void of_iommu_set_ops(struct device_node *np,
35 const struct iommu_ops *ops)
37 iommu_register_instance(&np->fwnode, ops);
40 static inline const struct iommu_ops *of_iommu_get_ops(struct device_node *np)
42 return iommu_get_instance(&np->fwnode);
45 extern struct of_device_id __iommu_of_table;
47 typedef int (*of_iommu_init_fn)(struct device_node *);
49 #define IOMMU_OF_DECLARE(name, compat, fn) \
50 _OF_DECLARE(iommu, name, compat, fn, of_iommu_init_fn)
52 #endif /* __OF_IOMMU_H */