aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2009-04-23 20:03:43 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-06-17 06:06:24 -0400
commitd3f634b96a86521f51bbaf04a81e34e7adb0eeb4 (patch)
treeb4c38e61a58deb1a20f2e9cb44a12ccfdc0f8d17 /arch
parent7762f206a3f3a19a38ed91a3d87f019d8b4eafc1 (diff)
MIPS: Add size and direction arguments to plat_unmap_dma_mem()
Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h3
-rw-r--r--arch/mips/include/asm/mach-generic/dma-coherence.h3
-rw-r--r--arch/mips/include/asm/mach-ip27/dma-coherence.h3
-rw-r--r--arch/mips/include/asm/mach-ip32/dma-coherence.h3
-rw-r--r--arch/mips/include/asm/mach-jazz/dma-coherence.h3
-rw-r--r--arch/mips/include/asm/mach-lemote/dma-coherence.h3
-rw-r--r--arch/mips/mm/dma-default.c8
7 files changed, 16 insertions, 10 deletions
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
index f30fce92aabb..7289e670e884 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -35,7 +35,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
35 return dma_addr; 35 return dma_addr;
36} 36}
37 37
38static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 38static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
39 size_t size, enum dma_data_direction direction)
39{ 40{
40 octeon_unmap_dma_mem(dev, dma_addr); 41 octeon_unmap_dma_mem(dev, dma_addr);
41} 42}
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 36c611b6c597..804c2def7182 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -28,7 +28,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
28 return dma_addr; 28 return dma_addr;
29} 29}
30 30
31static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 31static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
32 size_t size, enum dma_data_direction direction)
32{ 33{
33} 34}
34 35
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h
index 4c21bfca10c3..86766738d860 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -38,7 +38,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
38 return dma_addr & ~(0xffUL << 56); 38 return dma_addr & ~(0xffUL << 56);
39} 39}
40 40
41static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 41static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
42 size_t size, enum dma_data_direction direction)
42{ 43{
43} 44}
44 45
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h
index 7ae40f4b1c80..d41805e37167 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -60,7 +60,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
60 return addr; 60 return addr;
61} 61}
62 62
63static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 63static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
64 size_t size, enum dma_data_direction direction)
64{ 65{
65} 66}
66 67
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h
index 1c7cd27efa7b..5f3d7eaf280b 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -27,7 +27,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
27 return vdma_log2phys(dma_addr); 27 return vdma_log2phys(dma_addr);
28} 28}
29 29
30static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 30static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
31 size_t size, enum dma_data_direction direction)
31{ 32{
32 vdma_free(dma_addr); 33 vdma_free(dma_addr);
33} 34}
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h
index 38fad7dfe7da..c78f1d8059a9 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h
@@ -30,7 +30,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
30 return dma_addr & 0x7fffffff; 30 return dma_addr & 0x7fffffff;
31} 31}
32 32
33static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 33static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
34 size_t size, enum dma_data_direction direction)
34{ 35{
35} 36}
36 37
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 4fdb7f5216b9..30b108c5782b 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
111void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, 111void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
112 dma_addr_t dma_handle) 112 dma_addr_t dma_handle)
113{ 113{
114 plat_unmap_dma_mem(dev, dma_handle); 114 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
115 free_pages((unsigned long) vaddr, get_order(size)); 115 free_pages((unsigned long) vaddr, get_order(size));
116} 116}
117 117
@@ -122,7 +122,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
122{ 122{
123 unsigned long addr = (unsigned long) vaddr; 123 unsigned long addr = (unsigned long) vaddr;
124 124
125 plat_unmap_dma_mem(dev, dma_handle); 125 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
126 126
127 if (!plat_device_is_coherent(dev)) 127 if (!plat_device_is_coherent(dev))
128 addr = CAC_ADDR(addr); 128 addr = CAC_ADDR(addr);
@@ -173,7 +173,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
173 __dma_sync(dma_addr_to_virt(dma_addr), size, 173 __dma_sync(dma_addr_to_virt(dma_addr), size,
174 direction); 174 direction);
175 175
176 plat_unmap_dma_mem(dev, dma_addr); 176 plat_unmap_dma_mem(dev, dma_addr, size, direction);
177} 177}
178 178
179EXPORT_SYMBOL(dma_unmap_single); 179EXPORT_SYMBOL(dma_unmap_single);
@@ -232,7 +232,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
232 if (addr) 232 if (addr)
233 __dma_sync(addr, sg->length, direction); 233 __dma_sync(addr, sg->length, direction);
234 } 234 }
235 plat_unmap_dma_mem(dev, sg->dma_address); 235 plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction);
236 } 236 }
237} 237}
238 238