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 | |
Kishon Vijay Abraham I | cec6d1c | 2015-02-23 18:39:56 +0530 | [diff] [blame] | 11 | #define dma_mapping_error(x, y) 0 |
| 12 | |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 13 | enum dma_data_direction { |
| 14 | DMA_BIDIRECTIONAL = 0, |
| 15 | DMA_TO_DEVICE = 1, |
| 16 | DMA_FROM_DEVICE = 2, |
| 17 | }; |
| 18 | |
Kishon Vijay Abraham I | 1484150 | 2015-02-23 18:39:49 +0530 | [diff] [blame] | 19 | static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 20 | { |
Kuo-Jung Su | 9491ec0 | 2013-07-29 13:51:43 +0800 | [diff] [blame] | 21 | *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 22 | return (void *)*handle; |
| 23 | } |
| 24 | |
Kishon Vijay Abraham I | cec6d1c | 2015-02-23 18:39:56 +0530 | [diff] [blame] | 25 | static inline void dma_free_coherent(void *addr) |
| 26 | { |
| 27 | free(addr); |
| 28 | } |
| 29 | |
Stelian Pop | 7d42a22 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 30 | static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, |
| 31 | enum dma_data_direction dir) |
| 32 | { |
| 33 | return (unsigned long)vaddr; |
| 34 | } |
| 35 | |
| 36 | static inline void dma_unmap_single(volatile void *vaddr, size_t len, |
| 37 | unsigned long paddr) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | #endif /* __ASM_ARM_DMA_MAPPING_H */ |