MIPS: Add size and direction arguments to plat_unmap_dma_mem()
authorKevin Cernekee <cernekee@gmail.com>
Fri, 24 Apr 2009 00:03:43 +0000 (17:03 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 17 Jun 2009 10:06:24 +0000 (11:06 +0100)
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
arch/mips/include/asm/mach-generic/dma-coherence.h
arch/mips/include/asm/mach-ip27/dma-coherence.h
arch/mips/include/asm/mach-ip32/dma-coherence.h
arch/mips/include/asm/mach-jazz/dma-coherence.h
arch/mips/include/asm/mach-lemote/dma-coherence.h
arch/mips/mm/dma-default.c

index f30fce92aabbd7a4f3a51ef26c3540643bebb9c0..7289e670e884b1537ace45fa157abfc2f94661dd 100644 (file)
@@ -35,7 +35,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return dma_addr;
 }
 
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
        octeon_unmap_dma_mem(dev, dma_addr);
 }
index 36c611b6c597092af2b59ecedecb1132dc8729eb..804c2def7182faad7778273eb369f4d9c7211536 100644 (file)
@@ -28,7 +28,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return dma_addr;
 }
 
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
 }
 
index 4c21bfca10c3fa6c45a2aa1d5aa6443219f780f6..86766738d860c038cb12136f443ecd7ac62e2e84 100644 (file)
@@ -38,7 +38,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return dma_addr & ~(0xffUL << 56);
 }
 
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
 }
 
index 7ae40f4b1c80b5284695e4ee1dc2e0e31ff09a2e..d41805e371674a1d90f3d55b6277b7359bdbec6a 100644 (file)
@@ -60,7 +60,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return addr;
 }
 
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
 }
 
index 1c7cd27efa7b53d7770bb09040f7511eff8492ec..5f3d7eaf280be9b3c5837ac0d41d054287c58c7b 100644 (file)
@@ -27,7 +27,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return vdma_log2phys(dma_addr);
 }
 
-static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
        vdma_free(dma_addr);
 }
index 38fad7dfe7da4717ab13681ff0a7bf914ebd89b4..c78f1d8059a9ca2846055c568562f867e67f2bfa 100644 (file)
@@ -30,7 +30,8 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
        return dma_addr & 0x7fffffff;
 }
 
-static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
+static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
+       size_t size, enum dma_data_direction direction)
 {
 }
 
index 4fdb7f5216b9d9b136e1c182a0d7afda5b08e855..30b108c5782b9b7f5845a41c25ed11e0c66d93bc 100644 (file)
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
 void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
        dma_addr_t dma_handle)
 {
-       plat_unmap_dma_mem(dev, dma_handle);
+       plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
        free_pages((unsigned long) vaddr, get_order(size));
 }
 
@@ -122,7 +122,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
 {
        unsigned long addr = (unsigned long) vaddr;
 
-       plat_unmap_dma_mem(dev, dma_handle);
+       plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
 
        if (!plat_device_is_coherent(dev))
                addr = CAC_ADDR(addr);
@@ -173,7 +173,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                __dma_sync(dma_addr_to_virt(dma_addr), size,
                           direction);
 
-       plat_unmap_dma_mem(dev, dma_addr);
+       plat_unmap_dma_mem(dev, dma_addr, size, direction);
 }
 
 EXPORT_SYMBOL(dma_unmap_single);
@@ -232,7 +232,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
                        if (addr)
                                __dma_sync(addr, sg->length, direction);
                }
-               plat_unmap_dma_mem(dev, sg->dma_address);
+               plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction);
        }
 }