]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/h8300/include/asm/dma-mapping.h
Merge branch 'perf/rbtree_copy' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / arch / h8300 / include / asm / dma-mapping.h
1 #ifndef _H8300_DMA_MAPPING_H
2 #define _H8300_DMA_MAPPING_H
3
4 #include <asm-generic/dma-coherent.h>
5
6 extern struct dma_map_ops h8300_dma_map_ops;
7
8 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
9 {
10         return &h8300_dma_map_ops;
11 }
12
13 #include <asm-generic/dma-mapping-common.h>
14
15 static inline int dma_supported(struct device *dev, u64 mask)
16 {
17         return 0;
18 }
19
20 static inline int dma_set_mask(struct device *dev, u64 mask)
21 {
22         return 0;
23 }
24
25 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
26 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
27
28 #define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
29
30 static inline void *dma_alloc_attrs(struct device *dev, size_t size,
31                                     dma_addr_t *dma_handle, gfp_t flag,
32                                     struct dma_attrs *attrs)
33 {
34         struct dma_map_ops *ops = get_dma_ops(dev);
35         void *memory;
36
37         memory = ops->alloc(dev, size, dma_handle, flag, attrs);
38         return memory;
39 }
40
41 #define dma_free_coherent(d, s, c, h) dma_free_attrs(d, s, c, h, NULL)
42
43 static inline void dma_free_attrs(struct device *dev, size_t size,
44                                   void *cpu_addr, dma_addr_t dma_handle,
45                                   struct dma_attrs *attrs)
46 {
47         struct dma_map_ops *ops = get_dma_ops(dev);
48
49         ops->free(dev, size, cpu_addr, dma_handle, attrs);
50 }
51
52 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
53 {
54         return 0;
55 }
56
57 #endif