aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-pxa/dma.h
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2007-06-22 00:40:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-12 09:28:16 -0400
commitf53f066c25036210036730d64c876ea586114425 (patch)
treee680deb53ff12ec09f5c64421a3f13eecb7aed41 /include/asm-arm/arch-pxa/dma.h
parentcd49104d99b56383a3b1fdce2f31018197093c31 (diff)
[ARM] 4451/1: pxa: make dma.c generic and remove cpu specific dma code
Since the number of dma channels varies between pxa25x and pxa27x, it introduces some specific code in dma.c. This patch moves the specific code to pxa25x.c and pxa27x.c and makes dma.c more generic. 1. add pxa_init_dma() for dma initialization, the number of channels are passed in by the argument 2. add a "prio" field to the "struct pxa_dma_channel" for the channel priority, and is initialized in pxa_init_dma() 3. use a general priority comparison with the channels "prio" field so to remove the processor specific pxa_for_each_dma_prio macro, this is not lightning fast as the original one, but it is acceptable as it happens when requesting dma, which is usually not so performance critical Signed-off-by: eric miao <eric.miao@marvell.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-pxa/dma.h')
-rw-r--r--include/asm-arm/arch-pxa/dma.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
index bed042d71d68..3280ee2ddfa5 100644
--- a/include/asm-arm/arch-pxa/dma.h
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -30,30 +30,12 @@ typedef enum {
30 DMA_PRIO_LOW = 2 30 DMA_PRIO_LOW = 2
31} pxa_dma_prio; 31} pxa_dma_prio;
32 32
33#if defined(CONFIG_PXA27x)
34
35#define PXA_DMA_CHANNELS 32
36
37#define pxa_for_each_dma_prio(ch, prio) \
38for ( \
39 ch = prio * 4; \
40 ch != (4 << prio) + 16; \
41 ch = (ch + 1 == (4 << prio)) ? (prio * 4 + 16) : (ch + 1) \
42)
43
44#elif defined(CONFIG_PXA25x)
45
46#define PXA_DMA_CHANNELS 16
47
48#define pxa_for_each_dma_prio(ch, prio) \
49 for (ch = prio * 4; ch != (4 << prio); ch++)
50
51#endif
52
53/* 33/*
54 * DMA registration 34 * DMA registration
55 */ 35 */
56 36
37int __init pxa_init_dma(int num_ch);
38
57int pxa_request_dma (char *name, 39int pxa_request_dma (char *name,
58 pxa_dma_prio prio, 40 pxa_dma_prio prio,
59 void (*irq_handler)(int, void *), 41 void (*irq_handler)(int, void *),