]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/of_iommu.h
seccomp: Move speculation migitation control to arch code
[mirror_ubuntu-artful-kernel.git] / include / linux / of_iommu.h
CommitLineData
4e0ee78f
HD
1#ifndef __OF_IOMMU_H
2#define __OF_IOMMU_H
3
7eba1d51 4#include <linux/device.h>
1cd076bf
WD
5#include <linux/iommu.h>
6#include <linux/of.h>
7
4e0ee78f
HD
8#ifdef CONFIG_OF_IOMMU
9
10extern 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);
13
53c92d79 14extern const struct iommu_ops *of_iommu_configure(struct device *dev,
ed748621 15 struct device_node *master_np);
1cd076bf 16
4e0ee78f
HD
17#else
18
19static 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)
22{
23 return -EINVAL;
24}
25
53c92d79 26static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
ed748621 27 struct device_node *master_np)
7eba1d51
WD
28{
29 return NULL;
30}
1cd076bf 31
4e0ee78f
HD
32#endif /* CONFIG_OF_IOMMU */
33
1cd076bf
WD
34extern struct of_device_id __iommu_of_table;
35
36typedef int (*of_iommu_init_fn)(struct device_node *);
37
38#define IOMMU_OF_DECLARE(name, compat, fn) \
39 _OF_DECLARE(iommu, name, compat, fn, of_iommu_init_fn)
40
4e0ee78f 41#endif /* __OF_IOMMU_H */