Linux v2.6.15-rc7
[pohmelfs.git] / include / asm-arm / mach / dma.h
blob31bf716106ee964f8c75a4207e0b8e2e0d62686b
1 /*
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)
14 struct dma_struct;
15 typedef struct dma_struct dma_t;
17 struct dma_ops {
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 */
24 char *type;
27 struct dma_struct {
28 struct scatterlist buf; /* single DMA */
29 int sgcount; /* number of DMA SG */
30 struct scatterlist *sg; /* DMA Scatter-Gather List */
32 unsigned int active:1; /* Transfer active */
33 unsigned int invalid:1; /* Address/Count changed */
34 unsigned int using_sg:1; /* using scatter list? */
35 dmamode_t dma_mode; /* DMA mode */
36 int speed; /* DMA speed */
38 unsigned int lock; /* Device is allocated */
39 const char *device_id; /* Device name */
41 unsigned int dma_base; /* Controller base address */
42 int dma_irq; /* Controller IRQ */
43 struct scatterlist cur_sg; /* Current controller buffer */
44 unsigned int state;
46 struct dma_ops *d_ops;
49 /* Prototype: void arch_dma_init(dma)
50 * Purpose : Initialise architecture specific DMA
51 * Params : dma - pointer to array of DMA structures
53 extern void arch_dma_init(dma_t *dma);
55 extern void isa_init_dma(dma_t *dma);