Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
Stelian Pop | 5ee0c7f | 2011-11-01 00:00:39 +0100 | [diff] [blame] | 3 | * Stelian Pop <stelian@popies.net> |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 4 | * Lead Tech Design <www.leadtechdesign.com> |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 7 | */ |
| 8 | #ifndef __ASM_ARM_DMA_MAPPING_H |
| 9 | #define __ASM_ARM_DMA_MAPPING_H |
| 10 | |
Masahiro Yamada | ef205ea | 2017-08-26 00:50:17 +0900 | [diff] [blame] | 11 | #include <linux/dma-direction.h> |
Kishon Vijay Abraham I | cec6d1c | 2015-02-23 18:39:56 +0530 | [diff] [blame] | 12 | |
Masahiro Yamada | ef205ea | 2017-08-26 00:50:17 +0900 | [diff] [blame] | 13 | #define dma_mapping_error(x, y) 0 |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 14 | |
Kishon Vijay Abraham I | 1484150 | 2015-02-23 18:39:49 +0530 | [diff] [blame] | 15 | static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 16 | { |
Kuo-Jung Su | 9491ec0 | 2013-07-29 13:51:43 +0800 | [diff] [blame] | 17 | *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 18 | return (void *)*handle; |
| 19 | } |
| 20 | |
Kishon Vijay Abraham I | cec6d1c | 2015-02-23 18:39:56 +0530 | [diff] [blame] | 21 | static inline void dma_free_coherent(void *addr) |
| 22 | { |
| 23 | free(addr); |
| 24 | } |
| 25 | |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 26 | static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, |
| 27 | enum dma_data_direction dir) |
| 28 | { |
| 29 | return (unsigned long)vaddr; |
| 30 | } |
| 31 | |
| 32 | static inline void dma_unmap_single(volatile void *vaddr, size_t len, |
| 33 | unsigned long paddr) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | #endif /* __ASM_ARM_DMA_MAPPING_H */ |