Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Sudip Mukherjee | eb17726 | 2016-12-12 16:40:54 -0800 | [diff] [blame] | 2 | #ifndef _ASM_M32R_DMA_MAPPING_H |
| 3 | #define _ASM_M32R_DMA_MAPPING_H |
| 4 | |
| 5 | #include <linux/kernel.h> |
| 6 | #include <linux/types.h> |
| 7 | #include <linux/mm.h> |
| 8 | #include <linux/scatterlist.h> |
| 9 | #include <linux/dma-debug.h> |
| 10 | #include <linux/io.h> |
| 11 | |
Bart Van Assche | 815dd18 | 2017-01-20 13:04:04 -0800 | [diff] [blame] | 12 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
Sudip Mukherjee | eb17726 | 2016-12-12 16:40:54 -0800 | [diff] [blame] | 13 | { |
Sudip Mukherjee | eb17726 | 2016-12-12 16:40:54 -0800 | [diff] [blame] | 14 | return &dma_noop_ops; |
| 15 | } |
| 16 | |
Sudip Mukherjee | eb17726 | 2016-12-12 16:40:54 -0800 | [diff] [blame] | 17 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
| 18 | { |
| 19 | if (!dev->dma_mask) |
| 20 | return false; |
| 21 | return addr + size - 1 <= *dev->dma_mask; |
| 22 | } |
| 23 | |
| 24 | #endif /* _ASM_M32R_DMA_MAPPING_H */ |