aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2009-04-23 20:25:12 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-06-17 06:06:24 -0400
commit3807ef3f61e094c9417d1a12f18d6b3c8e27d96f (patch)
treec0be5433db80a74dcc06930e9255b1836fd3a941 /arch
parentd3f634b96a86521f51bbaf04a81e34e7adb0eeb4 (diff)
MIPS: Pass struct device to plat_dma_addr_to_phys()
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.c15
7 files changed, 20 insertions, 13 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 7289e670e884..17d579471ec4 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -30,7 +30,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
30 return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE); 30 return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE);
31} 31}
32 32
33static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 33static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
34 dma_addr_t dma_addr)
34{ 35{
35 return dma_addr; 36 return dma_addr;
36} 37}
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 804c2def7182..8da98073e952 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -23,7 +23,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
23 return page_to_phys(page); 23 return page_to_phys(page);
24} 24}
25 25
26static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 26static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
27 dma_addr_t dma_addr)
27{ 28{
28 return dma_addr; 29 return dma_addr;
29} 30}
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h
index 86766738d860..d3d04018a858 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -33,7 +33,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
33 return pa; 33 return pa;
34} 34}
35 35
36static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 36static unsigned long plat_dma_addr_to_phys(struct device *dev,
37 dma_addr_t dma_addr)
37{ 38{
38 return dma_addr & ~(0xffUL << 56); 39 return dma_addr & ~(0xffUL << 56);
39} 40}
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h
index d41805e37167..37855955b313 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -50,7 +50,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
50} 50}
51 51
52/* This is almost certainly wrong but it's what dma-ip32.c used to use */ 52/* This is almost certainly wrong but it's what dma-ip32.c used to use */
53static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 53static unsigned long plat_dma_addr_to_phys(struct device *dev,
54 dma_addr_t dma_addr)
54{ 55{
55 unsigned long addr = dma_addr & RAM_OFFSET_MASK; 56 unsigned long addr = dma_addr & RAM_OFFSET_MASK;
56 57
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h
index 5f3d7eaf280b..f93aee59454a 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -22,7 +22,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
22 return vdma_alloc(page_to_phys(page), PAGE_SIZE); 22 return vdma_alloc(page_to_phys(page), PAGE_SIZE);
23} 23}
24 24
25static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 25static unsigned long plat_dma_addr_to_phys(struct device *dev,
26 dma_addr_t dma_addr)
26{ 27{
27 return vdma_log2phys(dma_addr); 28 return vdma_log2phys(dma_addr);
28} 29}
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h
index c78f1d8059a9..c8de5e750777 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h
@@ -25,7 +25,8 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
25 return page_to_phys(page) | 0x80000000; 25 return page_to_phys(page) | 0x80000000;
26} 26}
27 27
28static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 28static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
29 dma_addr_t dma_addr)
29{ 30{
30 return dma_addr & 0x7fffffff; 31 return dma_addr & 0x7fffffff;
31} 32}
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 30b108c5782b..7e48e76148aa 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -20,9 +20,10 @@
20 20
21#include <dma-coherence.h> 21#include <dma-coherence.h>
22 22
23static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr) 23static inline unsigned long dma_addr_to_virt(struct device *dev,
24 dma_addr_t dma_addr)
24{ 25{
25 unsigned long addr = plat_dma_addr_to_phys(dma_addr); 26 unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr);
26 27
27 return (unsigned long)phys_to_virt(addr); 28 return (unsigned long)phys_to_virt(addr);
28} 29}
@@ -170,7 +171,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
170 enum dma_data_direction direction) 171 enum dma_data_direction direction)
171{ 172{
172 if (cpu_is_noncoherent_r10000(dev)) 173 if (cpu_is_noncoherent_r10000(dev))
173 __dma_sync(dma_addr_to_virt(dma_addr), size, 174 __dma_sync(dma_addr_to_virt(dev, dma_addr), size,
174 direction); 175 direction);
175 176
176 plat_unmap_dma_mem(dev, dma_addr, size, direction); 177 plat_unmap_dma_mem(dev, dma_addr, size, direction);
@@ -246,7 +247,7 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
246 if (cpu_is_noncoherent_r10000(dev)) { 247 if (cpu_is_noncoherent_r10000(dev)) {
247 unsigned long addr; 248 unsigned long addr;
248 249
249 addr = dma_addr_to_virt(dma_handle); 250 addr = dma_addr_to_virt(dev, dma_handle);
250 __dma_sync(addr, size, direction); 251 __dma_sync(addr, size, direction);
251 } 252 }
252} 253}
@@ -262,7 +263,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
262 if (!plat_device_is_coherent(dev)) { 263 if (!plat_device_is_coherent(dev)) {
263 unsigned long addr; 264 unsigned long addr;
264 265
265 addr = dma_addr_to_virt(dma_handle); 266 addr = dma_addr_to_virt(dev, dma_handle);
266 __dma_sync(addr, size, direction); 267 __dma_sync(addr, size, direction);
267 } 268 }
268} 269}
@@ -277,7 +278,7 @@ void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
277 if (cpu_is_noncoherent_r10000(dev)) { 278 if (cpu_is_noncoherent_r10000(dev)) {
278 unsigned long addr; 279 unsigned long addr;
279 280
280 addr = dma_addr_to_virt(dma_handle); 281 addr = dma_addr_to_virt(dev, dma_handle);
281 __dma_sync(addr + offset, size, direction); 282 __dma_sync(addr + offset, size, direction);
282 } 283 }
283} 284}
@@ -293,7 +294,7 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
293 if (!plat_device_is_coherent(dev)) { 294 if (!plat_device_is_coherent(dev)) {
294 unsigned long addr; 295 unsigned long addr;
295 296
296 addr = dma_addr_to_virt(dma_handle); 297 addr = dma_addr_to_virt(dev, dma_handle);
297 __dma_sync(addr + offset, size, direction); 298 __dma_sync(addr + offset, size, direction);
298 } 299 }
299} 300}