blob: 27b1597ac5633ebf48fcbb41f4778749850fd0a9 [file] [log] [blame]
Sudip Mukherjeeeb177262016-12-12 16:40:54 -08001#ifndef _ASM_M32R_DMA_MAPPING_H
2#define _ASM_M32R_DMA_MAPPING_H
3
4#include <linux/kernel.h>
5#include <linux/types.h>
6#include <linux/mm.h>
7#include <linux/scatterlist.h>
8#include <linux/dma-debug.h>
9#include <linux/io.h>
10
11#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
12
Bart Van Assche52997092017-01-20 13:04:01 -080013static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
Sudip Mukherjeeeb177262016-12-12 16:40:54 -080014{
Bart Van Assche56579332017-01-20 13:04:02 -080015 if (dev && dev->dma_ops)
16 return dev->dma_ops;
Sudip Mukherjeeeb177262016-12-12 16:40:54 -080017 return &dma_noop_ops;
18}
19
20static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
21 enum dma_data_direction direction)
22{
23}
24
25static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
26{
27 if (!dev->dma_mask)
28 return false;
29 return addr + size - 1 <= *dev->dma_mask;
30}
31
32#endif /* _ASM_M32R_DMA_MAPPING_H */