of_iommu.h 821 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __OF_IOMMU_H
  3. #define __OF_IOMMU_H
  4. #include <linux/device.h>
  5. #include <linux/iommu.h>
  6. #include <linux/of.h>
  7. #ifdef CONFIG_OF_IOMMU
  8. extern int of_get_dma_window(struct device_node *dn, const char *prefix,
  9. int index, unsigned long *busno, dma_addr_t *addr,
  10. size_t *size);
  11. extern const struct iommu_ops *of_iommu_configure(struct device *dev,
  12. struct device_node *master_np);
  13. #else
  14. static inline int of_get_dma_window(struct device_node *dn, const char *prefix,
  15. int index, unsigned long *busno, dma_addr_t *addr,
  16. size_t *size)
  17. {
  18. return -EINVAL;
  19. }
  20. static inline const struct iommu_ops *of_iommu_configure(struct device *dev,
  21. struct device_node *master_np)
  22. {
  23. return NULL;
  24. }
  25. #endif /* CONFIG_OF_IOMMU */
  26. #endif /* __OF_IOMMU_H */