aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32/dma-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-avr32/dma-mapping.h')
-rw-r--r--include/asm-avr32/dma-mapping.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h
index 4c40cb41cdf8..5c01e27f0b41 100644
--- a/include/asm-avr32/dma-mapping.h
+++ b/include/asm-avr32/dma-mapping.h
@@ -8,7 +8,8 @@
8#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
9#include <asm/io.h> 9#include <asm/io.h>
10 10
11extern void dma_cache_sync(void *vaddr, size_t size, int direction); 11extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
12 int direction);
12 13
13/* 14/*
14 * Return whether the given device DMA address mask can be supported 15 * Return whether the given device DMA address mask can be supported
@@ -108,7 +109,7 @@ static inline dma_addr_t
108dma_map_single(struct device *dev, void *cpu_addr, size_t size, 109dma_map_single(struct device *dev, void *cpu_addr, size_t size,
109 enum dma_data_direction direction) 110 enum dma_data_direction direction)
110{ 111{
111 dma_cache_sync(cpu_addr, size, direction); 112 dma_cache_sync(dev, cpu_addr, size, direction);
112 return virt_to_bus(cpu_addr); 113 return virt_to_bus(cpu_addr);
113} 114}
114 115
@@ -210,7 +211,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
210 211
211 sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; 212 sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
212 virt = page_address(sg[i].page) + sg[i].offset; 213 virt = page_address(sg[i].page) + sg[i].offset;
213 dma_cache_sync(virt, sg[i].length, direction); 214 dma_cache_sync(dev, virt, sg[i].length, direction);
214 } 215 }
215 216
216 return nents; 217 return nents;
@@ -255,14 +256,14 @@ static inline void
255dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 256dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
256 size_t size, enum dma_data_direction direction) 257 size_t size, enum dma_data_direction direction)
257{ 258{
258 dma_cache_sync(bus_to_virt(dma_handle), size, direction); 259 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction);
259} 260}
260 261
261static inline void 262static inline void
262dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, 263dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
263 size_t size, enum dma_data_direction direction) 264 size_t size, enum dma_data_direction direction)
264{ 265{
265 dma_cache_sync(bus_to_virt(dma_handle), size, direction); 266 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction);
266} 267}
267 268
268/** 269/**
@@ -285,7 +286,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
285 int i; 286 int i;
286 287
287 for (i = 0; i < nents; i++) { 288 for (i = 0; i < nents; i++) {
288 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 289 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
289 sg[i].length, direction); 290 sg[i].length, direction);
290 } 291 }
291} 292}
@@ -297,7 +298,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
297 int i; 298 int i;
298 299
299 for (i = 0; i < nents; i++) { 300 for (i = 0; i < nents; i++) {
300 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 301 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
301 sg[i].length, direction); 302 sg[i].length, direction);
302 } 303 }
303} 304}
@@ -307,7 +308,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
307#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 308#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
308#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 309#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
309 310
310static inline int dma_is_consistent(dma_addr_t dma_addr) 311static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
311{ 312{
312 return 1; 313 return 1;
313} 314}