dma-mapping.h (d3b83dcc7fcba94b7ec6bc0899828e1d814d20a9) | dma-mapping.h (3369ddb62a42e8392562c86d63811ba8b0167a58) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_DMA_MAPPING_H 3#define _ASM_DMA_MAPPING_H 4 5#include <linux/scatterlist.h> 6#include <asm/dma-coherence.h> 7#include <asm/cache.h> 8 9#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */ 10#include <dma-coherence.h> 11#endif 12 13extern const struct dma_map_ops mips_default_dma_map_ops; 14extern const struct dma_map_ops mips_swiotlb_ops; 15 16static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 17{ 18#ifdef CONFIG_SWIOTLB 19 return &mips_swiotlb_ops; | 1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _ASM_DMA_MAPPING_H 3#define _ASM_DMA_MAPPING_H 4 5#include <linux/scatterlist.h> 6#include <asm/dma-coherence.h> 7#include <asm/cache.h> 8 9#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */ 10#include <dma-coherence.h> 11#endif 12 13extern const struct dma_map_ops mips_default_dma_map_ops; 14extern const struct dma_map_ops mips_swiotlb_ops; 15 16static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 17{ 18#ifdef CONFIG_SWIOTLB 19 return &mips_swiotlb_ops; |
20#else | 20#elif defined(CONFIG_MIPS_DMA_DEFAULT) |
21 return &mips_default_dma_map_ops; | 21 return &mips_default_dma_map_ops; |
22#else 23 return NULL; |
|
22#endif 23} 24 25#define arch_setup_dma_ops arch_setup_dma_ops 26static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, 27 u64 size, const struct iommu_ops *iommu, 28 bool coherent) 29{ 30#ifdef CONFIG_DMA_PERDEV_COHERENT 31 dev->archdata.dma_coherent = coherent; 32#endif 33} 34 35#endif /* _ASM_DMA_MAPPING_H */ | 24#endif 25} 26 27#define arch_setup_dma_ops arch_setup_dma_ops 28static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, 29 u64 size, const struct iommu_ops *iommu, 30 bool coherent) 31{ 32#ifdef CONFIG_DMA_PERDEV_COHERENT 33 dev->archdata.dma_coherent = coherent; 34#endif 35} 36 37#endif /* _ASM_DMA_MAPPING_H */ |