ARM: rockchip: fix broken build
[linux/fpc-iii.git] / arch / h8300 / include / asm / dma-mapping.h
blob6e67a90902f2894293281d2c9df4070128a880bb
1 #ifndef _H8300_DMA_MAPPING_H
2 #define _H8300_DMA_MAPPING_H
4 #include <asm-generic/dma-coherent.h>
6 extern struct dma_map_ops h8300_dma_map_ops;
8 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
10 return &h8300_dma_map_ops;
13 #include <asm-generic/dma-mapping-common.h>
15 static inline int dma_supported(struct device *dev, u64 mask)
17 return 0;
20 static inline int dma_set_mask(struct device *dev, u64 mask)
22 return 0;
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)
28 #define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL)
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)
34 struct dma_map_ops *ops = get_dma_ops(dev);
35 void *memory;
37 memory = ops->alloc(dev, size, dma_handle, flag, attrs);
38 return memory;
41 #define dma_free_coherent(d, s, c, h) dma_free_attrs(d, s, c, h, NULL)
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)
47 struct dma_map_ops *ops = get_dma_ops(dev);
49 ops->free(dev, size, cpu_addr, dma_handle, attrs);
52 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
54 return 0;
57 #endif