From 76330285bc08e02f763c728a75297c04e1dff764 Mon Sep 17 00:00:00 2001 From: Daniel Petrini Date: Wed, 27 Jul 2005 04:00:50 -0700 Subject: [PATCH] [PATCH] ARM: OMAP: dma progress meter function in dma.c The following patch adds a new fuction in file dma.c: - omap_get_dma_src_addr_counter This function returns the value of the DMA source counter register. It can be used to show the progress of the dma transfer for a given channel. --- arch/arm/plat-omap/dma.c | 11 +++++++++++ include/asm-arm/arch-omap/dma.h | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 08a7943a1b6..40b53d986ed 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -983,6 +983,16 @@ dma_addr_t omap_get_dma_dst_pos(int lch) (omap_readw(OMAP_DMA_CDSA_U(lch)) << 16)); } +/* + * Returns current source transfer counting for the given DMA channel. + * Can be used to monitor the progress of a transfer inside a block. + * It must be called with disabled interrupts. + */ +int omap_get_dma_src_addr_counter(int lch) +{ + return (dma_addr_t) omap_readw(OMAP_DMA_CSAC(lch)); +} + int omap_dma_running(void) { int lch; @@ -1076,6 +1086,7 @@ arch_initcall(omap_init_dma); EXPORT_SYMBOL(omap_get_dma_src_pos); EXPORT_SYMBOL(omap_get_dma_dst_pos); +EXPORT_SYMBOL(omap_get_dma_src_addr_counter); EXPORT_SYMBOL(omap_clear_dma); EXPORT_SYMBOL(omap_set_dma_priority); EXPORT_SYMBOL(omap_request_dma); diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index ce114ce5af5..04ebef5c6e9 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h @@ -240,6 +240,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue); extern dma_addr_t omap_get_dma_src_pos(int lch); extern dma_addr_t omap_get_dma_dst_pos(int lch); +extern int omap_get_dma_src_addr_counter(int lch); extern void omap_clear_dma(int lch); extern int omap_dma_running(void); -- 2.41.1