- pre3:
[davej-history.git] / include / asm-arm / mach / dma.h
blob64a5e7680f3a224324a93441d9327c11bbea5db6
1 /*
2 * linux/arch/arm/kernel/dma.h
4 * Copyright (C) 1998-2000 Russell King
6 * This header file describes the interface between the generic DMA handler
7 * (dma.c) and the architecture-specific DMA backends (dma-*.c)
8 */
10 struct dma_struct;
11 typedef struct dma_struct dma_t;
13 struct dma_ops {
14 int (*request)(dmach_t, dma_t *); /* optional */
15 void (*free)(dmach_t, dma_t *); /* optional */
16 void (*enable)(dmach_t, dma_t *); /* mandatory */
17 void (*disable)(dmach_t, dma_t *); /* mandatory */
18 int (*residue)(dmach_t, dma_t *); /* optional */
19 int (*setspeed)(dmach_t, dma_t *, int); /* optional */
20 char *type;
23 struct dma_struct {
24 struct scatterlist buf; /* single DMA */
25 int sgcount; /* number of DMA SG */
26 struct scatterlist *sg; /* DMA Scatter-Gather List */
28 unsigned int active:1; /* Transfer active */
29 unsigned int invalid:1; /* Address/Count changed */
30 unsigned int using_sg:1; /* using scatter list? */
31 dmamode_t dma_mode; /* DMA mode */
32 int speed; /* DMA speed */
34 unsigned int lock; /* Device is allocated */
35 const char *device_id; /* Device name */
37 unsigned int dma_base; /* Controller base address */
38 int dma_irq; /* Controller IRQ */
39 int state; /* Controller state */
40 struct scatterlist cur_sg; /* Current controller buffer */
42 struct dma_ops *d_ops;
45 /* Prototype: void arch_dma_init(dma)
46 * Purpose : Initialise architecture specific DMA
47 * Params : dma - pointer to array of DMA structures
49 void arch_dma_init(dma_t *dma);