2 * linux/include/asm-arm/mach/dma.h
4 * Copyright (C) 1998-2000 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This header file describes the interface between the generic DMA handler
11 * (dma.c) and the architecture-specific DMA backends (dma-*.c)
15 typedef struct dma_struct dma_t;
18 int (*request)(dmach_t, dma_t *); /* optional */
19 void (*free)(dmach_t, dma_t *); /* optional */
20 void (*enable)(dmach_t, dma_t *); /* mandatory */
21 void (*disable)(dmach_t, dma_t *); /* mandatory */
22 int (*residue)(dmach_t, dma_t *); /* optional */
23 int (*setspeed)(dmach_t, dma_t *, int); /* optional */
28 void *addr; /* single DMA address */
29 unsigned long count; /* single DMA size */
30 struct scatterlist buf; /* single DMA */
31 int sgcount; /* number of DMA SG */
32 struct scatterlist *sg; /* DMA Scatter-Gather List */
34 unsigned int active:1; /* Transfer active */
35 unsigned int invalid:1; /* Address/Count changed */
37 dmamode_t dma_mode; /* DMA mode */
38 int speed; /* DMA speed */
40 unsigned int lock; /* Device is allocated */
41 const char *device_id; /* Device name */
43 unsigned int dma_base; /* Controller base address */
44 int dma_irq; /* Controller IRQ */
45 struct scatterlist cur_sg; /* Current controller buffer */
48 struct dma_ops *d_ops;
51 /* Prototype: void arch_dma_init(dma)
52 * Purpose : Initialise architecture specific DMA
53 * Params : dma - pointer to array of DMA structures
55 extern void arch_dma_init(dma_t *dma);
57 extern void isa_init_dma(dma_t *dma);