blob: 7de4c08e36eab84edf01f2b5d44e40e67bf36d51 [file] [log] [blame]
Andy Shevchenkob7026b02017-07-06 14:41:51 +03001/*
2 * (C) Copyright 2007
3 * Stelian Pop <stelian@popies.net>
4 * Lead Tech Design <www.leadtechdesign.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8#ifndef __ASM_X86_DMA_MAPPING_H
9#define __ASM_X86_DMA_MAPPING_H
10
11#define dma_mapping_error(x, y) 0
12
13enum dma_data_direction {
14 DMA_BIDIRECTIONAL = 0,
15 DMA_TO_DEVICE = 1,
16 DMA_FROM_DEVICE = 2,
17};
18
19static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
20{
21 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
22 return (void *)*handle;
23}
24
25static inline void dma_free_coherent(void *addr)
26{
27 free(addr);
28}
29
30static 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
36static inline void dma_unmap_single(volatile void *vaddr, size_t len,
37 unsigned long paddr)
38{
39}
40
41#endif /* __ASM_X86_DMA_MAPPING_H */