diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-06-14 07:03:04 -0400 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-07-30 06:25:46 -0400 |
commit | 64ccc9c033c6089b2d426dad3c56477ab066c999 (patch) | |
tree | ffaec86ca326dfc83b78ce4005bf46c3ad98ceb9 /arch/powerpc/include/asm | |
parent | 9fa8af91f0679f2abbebe1382b937264f3a8b981 (diff) |
common: dma-mapping: add support for generic dma_mmap_* calls
Commit 9adc5374 ('common: dma-mapping: introduce mmap method') added a
generic method for implementing mmap user call to dma_map_ops structure.
This patch converts ARM and PowerPC architectures (the only providers of
dma_mmap_coherent/dma_mmap_writecombine calls) to use this generic
dma_map_ops based call and adds a generic cross architecture
definition for dma_mmap_attrs, dma_mmap_coherent, dma_mmap_writecombine
functions.
The generic mmap virt_to_page-based fallback implementation is provided for
architectures which don't provide their own implementation for mmap method.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/dma-mapping.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 62678e365ca0..78160874809a 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -27,7 +27,10 @@ extern void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
27 | extern void dma_direct_free_coherent(struct device *dev, size_t size, | 27 | extern void dma_direct_free_coherent(struct device *dev, size_t size, |
28 | void *vaddr, dma_addr_t dma_handle, | 28 | void *vaddr, dma_addr_t dma_handle, |
29 | struct dma_attrs *attrs); | 29 | struct dma_attrs *attrs); |
30 | 30 | extern int dma_direct_mmap_coherent(struct device *dev, | |
31 | struct vm_area_struct *vma, | ||
32 | void *cpu_addr, dma_addr_t handle, | ||
33 | size_t size, struct dma_attrs *attrs); | ||
31 | 34 | ||
32 | #ifdef CONFIG_NOT_COHERENT_CACHE | 35 | #ifdef CONFIG_NOT_COHERENT_CACHE |
33 | /* | 36 | /* |
@@ -207,11 +210,8 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) | |||
207 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 210 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
208 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 211 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
209 | 212 | ||
210 | extern int dma_mmap_coherent(struct device *, struct vm_area_struct *, | ||
211 | void *, dma_addr_t, size_t); | ||
212 | #define ARCH_HAS_DMA_MMAP_COHERENT | 213 | #define ARCH_HAS_DMA_MMAP_COHERENT |
213 | 214 | ||
214 | |||
215 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 215 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
216 | enum dma_data_direction direction) | 216 | enum dma_data_direction direction) |
217 | { | 217 | { |