1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2018 Western Digital Corporation or its affiliates.
6 * Anup Patel <anup.patel@wdc.com>
9 #ifndef __ASM_RISCV_DMA_MAPPING_H
10 #define __ASM_RISCV_DMA_MAPPING_H
12 #include <linux/dma-direction.h>
14 #define dma_mapping_error(x, y) 0
16 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
18 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
19 return (void *)*handle;
22 static inline void dma_free_coherent(void *addr)
27 static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
28 enum dma_data_direction dir)
30 return (unsigned long)vaddr;
33 static inline void dma_unmap_single(volatile void *vaddr, size_t len,
38 #endif /* __ASM_RISCV_DMA_MAPPING_H */