dm era: only resize metadata in preresume
[linux-2.6-block.git] / include / linux / of_iommu.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
4e0ee78f
HD
2#ifndef __OF_IOMMU_H
3#define __OF_IOMMU_H
4
7eba1d51 5#include <linux/device.h>
1cd076bf
WD
6#include <linux/iommu.h>
7#include <linux/of.h>
8
4e0ee78f
HD
9#ifdef CONFIG_OF_IOMMU
10
11extern 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);
14
53c92d79 15extern const struct iommu_ops *of_iommu_configure(struct device *dev,
a081bd4a
LP
16 struct device_node *master_np,
17 const u32 *id);
1cd076bf 18
4e0ee78f
HD
19#else
20
21static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
22 int index, unsigned long *busno, dma_addr_t *addr,
23 size_t *size)
24{
25 return -EINVAL;
26}
27
53c92d79 28static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
a081bd4a
LP
29 struct device_node *master_np,
30 const u32 *id)
7eba1d51
WD
31{
32 return NULL;
33}
1cd076bf 34
4e0ee78f
HD
35#endif /* CONFIG_OF_IOMMU */
36
37#endif /* __OF_IOMMU_H */