aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/dma-mapping.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-11-24 11:27:17 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-02-15 10:22:11 -0500
commit4ea0d7371e808628d11154b0d44140b70f05b998 (patch)
tree7673b2fc850475a587144a02c9f568a2831f0c2f /arch/arm/mm/dma-mapping.c
parent18eabe2347ae7a11b3db768695913724166dfb0e (diff)
ARM: dma-mapping: push buffer ownership down into dma-mapping.c
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-By: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r--arch/arm/mm/dma-mapping.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index a316c9459526..bbf87880b915 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -404,7 +404,7 @@ EXPORT_SYMBOL(dma_free_coherent);
404 * platforms with CONFIG_DMABOUNCE. 404 * platforms with CONFIG_DMABOUNCE.
405 * Use the driver DMA support - see dma-mapping.h (dma_sync_*) 405 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
406 */ 406 */
407void dma_cache_maint(const void *start, size_t size, int direction) 407static void dma_cache_maint(const void *start, size_t size, int direction)
408{ 408{
409 void (*inner_op)(const void *, const void *); 409 void (*inner_op)(const void *, const void *);
410 void (*outer_op)(unsigned long, unsigned long); 410 void (*outer_op)(unsigned long, unsigned long);
@@ -431,7 +431,20 @@ void dma_cache_maint(const void *start, size_t size, int direction)
431 inner_op(start, start + size); 431 inner_op(start, start + size);
432 outer_op(__pa(start), __pa(start) + size); 432 outer_op(__pa(start), __pa(start) + size);
433} 433}
434EXPORT_SYMBOL(dma_cache_maint); 434
435void ___dma_single_cpu_to_dev(const void *kaddr, size_t size,
436 enum dma_data_direction dir)
437{
438 dma_cache_maint(kaddr, size, dir);
439}
440EXPORT_SYMBOL(___dma_single_cpu_to_dev);
441
442void ___dma_single_dev_to_cpu(const void *kaddr, size_t size,
443 enum dma_data_direction dir)
444{
445 /* nothing to do */
446}
447EXPORT_SYMBOL(___dma_single_dev_to_cpu);
435 448
436static void dma_cache_maint_contiguous(struct page *page, unsigned long offset, 449static void dma_cache_maint_contiguous(struct page *page, unsigned long offset,
437 size_t size, int direction) 450 size_t size, int direction)
@@ -474,7 +487,7 @@ static void dma_cache_maint_contiguous(struct page *page, unsigned long offset,
474 outer_op(paddr, paddr + size); 487 outer_op(paddr, paddr + size);
475} 488}
476 489
477void dma_cache_maint_page(struct page *page, unsigned long offset, 490static void dma_cache_maint_page(struct page *page, unsigned long offset,
478 size_t size, int dir) 491 size_t size, int dir)
479{ 492{
480 /* 493 /*
@@ -499,7 +512,20 @@ void dma_cache_maint_page(struct page *page, unsigned long offset,
499 left -= len; 512 left -= len;
500 } while (left); 513 } while (left);
501} 514}
502EXPORT_SYMBOL(dma_cache_maint_page); 515
516void ___dma_page_cpu_to_dev(struct page *page, unsigned long off,
517 size_t size, enum dma_data_direction dir)
518{
519 dma_cache_maint_page(page, off, size, dir);
520}
521EXPORT_SYMBOL(___dma_page_cpu_to_dev);
522
523void ___dma_page_dev_to_cpu(struct page *page, unsigned long off,
524 size_t size, enum dma_data_direction dir)
525{
526 /* nothing to do */
527}
528EXPORT_SYMBOL(___dma_page_dev_to_cpu);
503 529
504/** 530/**
505 * dma_map_sg - map a set of SG buffers for streaming mode DMA 531 * dma_map_sg - map a set of SG buffers for streaming mode DMA