1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _ASM_DMA_MAPPING_H 3 #define _ASM_DMA_MAPPING_H 4 5 #include <linux/swiotlb.h> 6 7 extern const struct dma_map_ops jazz_dma_ops; 8 9 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 10 { 11 #if defined(CONFIG_MACH_JAZZ) 12 return &jazz_dma_ops; 13 #elif defined(CONFIG_SWIOTLB) 14 return &swiotlb_dma_ops; 15 #else 16 return &dma_direct_ops; 17 #endif 18 } 19 20 #define arch_setup_dma_ops arch_setup_dma_ops 21 static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, 22 u64 size, const struct iommu_ops *iommu, 23 bool coherent) 24 { 25 #ifdef CONFIG_DMA_PERDEV_COHERENT 26 dev->dma_coherent = coherent; 27 #endif 28 } 29 30 #endif /* _ASM_DMA_MAPPING_H */ 31