aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/dma.c
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/kernel/dma.c
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/kernel/dma.c')
-rw-r--r--arch/microblaze/kernel/dma.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index 393e6b2db688..595130bceadd 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -11,7 +11,6 @@
11#include <linux/gfp.h> 11#include <linux/gfp.h>
12#include <linux/dma-debug.h> 12#include <linux/dma-debug.h>
13#include <asm/bug.h> 13#include <asm/bug.h>
14#include <asm/cacheflush.h>
15 14
16/* 15/*
17 * Generic direct DMA implementation 16 * Generic direct DMA implementation
@@ -21,21 +20,6 @@
21 * can set archdata.dma_data to an unsigned long holding the offset. By 20 * can set archdata.dma_data to an unsigned long holding the offset. By
22 * default the offset is PCI_DRAM_OFFSET. 21 * default the offset is PCI_DRAM_OFFSET.
23 */ 22 */
24static inline void __dma_sync_page(unsigned long paddr, unsigned long offset,
25 size_t size, enum dma_data_direction direction)
26{
27 switch (direction) {
28 case DMA_TO_DEVICE:
29 case DMA_BIDIRECTIONAL:
30 flush_dcache_range(paddr + offset, paddr + offset + size);
31 break;
32 case DMA_FROM_DEVICE:
33 invalidate_dcache_range(paddr + offset, paddr + offset + size);
34 break;
35 default:
36 BUG();
37 }
38}
39 23
40static unsigned long get_dma_direct_offset(struct device *dev) 24static unsigned long get_dma_direct_offset(struct device *dev)
41{ 25{
@@ -91,7 +75,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
91 /* FIXME this part of code is untested */ 75 /* FIXME this part of code is untested */
92 for_each_sg(sgl, sg, nents, i) { 76 for_each_sg(sgl, sg, nents, i) {
93 sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev); 77 sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
94 __dma_sync_page(page_to_phys(sg_page(sg)), sg->offset, 78 __dma_sync(page_to_phys(sg_page(sg)) + sg->offset,
95 sg->length, direction); 79 sg->length, direction);
96 } 80 }
97 81
@@ -116,7 +100,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev,
116 enum dma_data_direction direction, 100 enum dma_data_direction direction,
117 struct dma_attrs *attrs) 101 struct dma_attrs *attrs)
118{ 102{
119 __dma_sync_page(page_to_phys(page), offset, size, direction); 103 __dma_sync(page_to_phys(page) + offset, size, direction);
120 return page_to_phys(page) + offset + get_dma_direct_offset(dev); 104 return page_to_phys(page) + offset + get_dma_direct_offset(dev);
121} 105}
122 106
@@ -131,7 +115,7 @@ static inline void dma_direct_unmap_page(struct device *dev,
131 * phys_to_virt is here because in __dma_sync_page is __virt_to_phys and 115 * phys_to_virt is here because in __dma_sync_page is __virt_to_phys and
132 * dma_address is physical address 116 * dma_address is physical address
133 */ 117 */
134 __dma_sync_page(dma_address, 0 , size, direction); 118 __dma_sync(dma_address, size, direction);
135} 119}
136 120
137struct dma_map_ops dma_direct_ops = { 121struct dma_map_ops dma_direct_ops = {