Loading...
1#ifndef _ASM_DMA_MAPPING_H
2#define _ASM_DMA_MAPPING_H
3
4#include <linux/scatterlist.h>
5#include <asm/dma-coherence.h>
6#include <asm/cache.h>
7
8#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */
9#include <dma-coherence.h>
10#endif
11
12extern struct dma_map_ops *mips_dma_map_ops;
13
14static inline struct dma_map_ops *get_dma_ops(struct device *dev)
15{
16 if (dev && dev->archdata.dma_ops)
17 return dev->archdata.dma_ops;
18 else
19 return mips_dma_map_ops;
20}
21
22static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
23{
24 if (!dev->dma_mask)
25 return false;
26
27 return addr + size <= *dev->dma_mask;
28}
29
30static inline void dma_mark_clean(void *addr, size_t size) {}
31
32extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
33 enum dma_data_direction direction);
34
35#endif /* _ASM_DMA_MAPPING_H */
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
7extern const struct dma_map_ops jazz_dma_ops;
8
9static 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#else
14 return NULL;
15#endif
16}
17
18#endif /* _ASM_DMA_MAPPING_H */