1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2007
4  * Stelian Pop <stelian@popies.net>
5  * Lead Tech Design <www.leadtechdesign.com>
6  */
7 #ifndef __ASM_ARM_DMA_MAPPING_H
8 #define __ASM_ARM_DMA_MAPPING_H
9 
10 #include <linux/dma-direction.h>
11 
12 #define	dma_mapping_error(x, y)	0
13 
14 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
15 {
16 	*handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
17 	return (void *)*handle;
18 }
19 
20 static inline void dma_free_coherent(void *addr)
21 {
22 	free(addr);
23 }
24 
25 static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
26 					   enum dma_data_direction dir)
27 {
28 	return (unsigned long)vaddr;
29 }
30 
31 static inline void dma_unmap_single(volatile void *vaddr, size_t len,
32 				    unsigned long paddr)
33 {
34 }
35 
36 #endif /* __ASM_ARM_DMA_MAPPING_H */
37