[ARM] Move common definition of MAX_DMA_ADDRESS to asm/dma.h
[pandora-kernel.git] / include / asm-arm / arch-pxa / dma.h
1 /*
2  *  linux/include/asm-arm/arch-pxa/dma.h
3  *
4  *  Author:     Nicolas Pitre
5  *  Created:    Jun 15, 2001
6  *  Copyright:  MontaVista Software, Inc.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12 #ifndef __ASM_ARCH_DMA_H
13 #define __ASM_ARCH_DMA_H
14
15 /* No DMA as the rest of the world see it */
16 #define MAX_DMA_CHANNELS        0
17
18 /*
19  * Descriptor structure for PXA's DMA engine
20  * Note: this structure must always be aligned to a 16-byte boundary.
21  */
22
23 typedef struct pxa_dma_desc {
24         volatile u32 ddadr;     /* Points to the next descriptor + flags */
25         volatile u32 dsadr;     /* DSADR value for the current transfer */
26         volatile u32 dtadr;     /* DTADR value for the current transfer */
27         volatile u32 dcmd;      /* DCMD value for the current transfer */
28 } pxa_dma_desc;
29
30 #if defined(CONFIG_PXA27x)
31
32 #define PXA_DMA_CHANNELS        32
33 #define PXA_DMA_NBCH(prio)      ((prio == DMA_PRIO_LOW) ? 16 : 8)
34
35 typedef enum {
36         DMA_PRIO_HIGH = 0,
37         DMA_PRIO_MEDIUM = 8,
38         DMA_PRIO_LOW = 16
39 } pxa_dma_prio;
40
41 #elif defined(CONFIG_PXA25x)
42
43 #define PXA_DMA_CHANNELS        16
44 #define PXA_DMA_NBCH(prio)      ((prio == DMA_PRIO_LOW) ? 8 : 4)
45
46 typedef enum {
47         DMA_PRIO_HIGH = 0,
48         DMA_PRIO_MEDIUM = 4,
49         DMA_PRIO_LOW = 8
50 } pxa_dma_prio;
51
52 #endif
53
54 /*
55  * DMA registration
56  */
57
58 int pxa_request_dma (char *name,
59                          pxa_dma_prio prio,
60                          void (*irq_handler)(int, void *, struct pt_regs *),
61                          void *data);
62
63 void pxa_free_dma (int dma_ch);
64
65 #endif /* _ASM_ARCH_DMA_H */