Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
Stelian Pop | c9e798d | 2011-11-01 00:00:39 +0100 | [diff] [blame] | 3 | * Stelian Pop <stelian@popies.net> |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 4 | * Lead Tech Design <www.leadtechdesign.com> |
| 5 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Stelian Pop | fa506a9 | 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 | |
| 11 | enum dma_data_direction { |
| 12 | DMA_BIDIRECTIONAL = 0, |
| 13 | DMA_TO_DEVICE = 1, |
| 14 | DMA_FROM_DEVICE = 2, |
| 15 | }; |
| 16 | |
| 17 | static void *dma_alloc_coherent(size_t len, unsigned long *handle) |
| 18 | { |
Kuo-Jung Su | 771f74c | 2013-07-29 13:51:43 +0800 | [diff] [blame] | 19 | *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 20 | return (void *)*handle; |
| 21 | } |
| 22 | |
| 23 | static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, |
| 24 | enum dma_data_direction dir) |
| 25 | { |
| 26 | return (unsigned long)vaddr; |
| 27 | } |
| 28 | |
| 29 | static inline void dma_unmap_single(volatile void *vaddr, size_t len, |
| 30 | unsigned long paddr) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | #endif /* __ASM_ARM_DMA_MAPPING_H */ |