2 * Copyright (C) 2003-2004 Hewlett-Packard Co
4 * Copyright (C) 2012 ARM Ltd.
5 * Copyright (C) 2016 SiFive, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef __ASM_RISCV_DMA_MAPPING_H
20 #define __ASM_RISCV_DMA_MAPPING_H
22 /* Use ops->dma_mapping_error (if it exists) or assume success */
23 // #undef DMA_ERROR_CODE
25 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
30 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
35 return addr + size - 1 <= *dev->dma_mask;
38 #endif /* __ASM_RISCV_DMA_MAPPING_H */