aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include
diff options
context:
space:
mode:
authorEli Billauer <eli.billauer@gmail.com>2011-09-11 15:43:06 -0400
committerMichal Simek <monstr@monstr.eu>2011-10-14 06:24:29 -0400
commitcf560c1801e518abfe0951008c4f2df4bbb3f5e8 (patch)
treeb7701d77a994b26a71bd5cfb96f3ae1ca99b4e88 /arch/microblaze/include
parent2309f7cfca745ec282c125e79ac80dca2ea8390e (diff)
microblaze: Moved __dma_sync() to dma-mapping.h
__dma_sync_page() was replaced by __dma_sync(), and parameters of calls to the new function were adjusted to match __dma_sync()'s format. Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 8fbb0ec10233..cddeca59a63a 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -28,12 +28,12 @@
28#include <linux/dma-attrs.h> 28#include <linux/dma-attrs.h>
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm-generic/dma-coherent.h> 30#include <asm-generic/dma-coherent.h>
31#include <asm/cacheflush.h>
31 32
32#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 33#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
33 34
34#define __dma_alloc_coherent(dev, gfp, size, handle) NULL 35#define __dma_alloc_coherent(dev, gfp, size, handle) NULL
35#define __dma_free_coherent(size, addr) ((void)0) 36#define __dma_free_coherent(size, addr) ((void)0)
36#define __dma_sync(addr, size, rw) ((void)0)
37 37
38static inline unsigned long device_to_mask(struct device *dev) 38static inline unsigned long device_to_mask(struct device *dev)
39{ 39{
@@ -95,6 +95,22 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
95 95
96#include <asm-generic/dma-mapping-common.h> 96#include <asm-generic/dma-mapping-common.h>
97 97
98static inline void __dma_sync(unsigned long paddr,
99 size_t size, enum dma_data_direction direction)
100{
101 switch (direction) {
102 case DMA_TO_DEVICE:
103 case DMA_BIDIRECTIONAL:
104 flush_dcache_range(paddr, paddr + size);
105 break;
106 case DMA_FROM_DEVICE:
107 invalidate_dcache_range(paddr, paddr + size);
108 break;
109 default:
110 BUG();
111 }
112}
113
98static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 114static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
99{ 115{
100 struct dma_map_ops *ops = get_dma_ops(dev); 116 struct dma_map_ops *ops = get_dma_ops(dev);
@@ -135,7 +151,7 @@ static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
135 enum dma_data_direction direction) 151 enum dma_data_direction direction)
136{ 152{
137 BUG_ON(direction == DMA_NONE); 153 BUG_ON(direction == DMA_NONE);
138 __dma_sync(vaddr, size, (int)direction); 154 __dma_sync(virt_to_phys(vaddr), size, (int)direction);
139} 155}
140 156
141#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */ 157#endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */