dma-iommu.h 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2014-2015 ARM Ltd.
  4. */
  5. #ifndef __DMA_IOMMU_H
  6. #define __DMA_IOMMU_H
  7. #include <linux/iommu.h>
  8. #ifdef CONFIG_IOMMU_DMA
  9. int iommu_get_dma_cookie(struct iommu_domain *domain);
  10. void iommu_put_dma_cookie(struct iommu_domain *domain);
  11. int iommu_dma_init_fq(struct iommu_domain *domain);
  12. void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
  13. extern bool iommu_dma_forcedac;
  14. #else /* CONFIG_IOMMU_DMA */
  15. static inline int iommu_dma_init_fq(struct iommu_domain *domain)
  16. {
  17. return -EINVAL;
  18. }
  19. static inline int iommu_get_dma_cookie(struct iommu_domain *domain)
  20. {
  21. return -ENODEV;
  22. }
  23. static inline void iommu_put_dma_cookie(struct iommu_domain *domain)
  24. {
  25. }
  26. static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
  27. {
  28. }
  29. #endif /* CONFIG_IOMMU_DMA */
  30. #endif /* __DMA_IOMMU_H */