GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / plat-samsung / include / plat / dma.h
blob73a5361f3102efe18a755297cd4380bdebe96cd5
1 /* arch/arm/plat-samsung/include/plat/dma.h
3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * Samsung S3C DMA support
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.
13 enum s3c2410_dma_buffresult {
14 S3C2410_RES_OK,
15 S3C2410_RES_ERR,
16 S3C2410_RES_ABORT
19 enum s3c2410_dmasrc {
20 S3C2410_DMASRC_HW, /* source is memory */
21 S3C2410_DMASRC_MEM /* source is hardware */
24 /* enum s3c2410_chan_op
26 * operation codes passed to the DMA code by the user, and also used
27 * to inform the current channel owner of any changes to the system state
30 enum s3c2410_chan_op {
31 S3C2410_DMAOP_START,
32 S3C2410_DMAOP_STOP,
33 S3C2410_DMAOP_PAUSE,
34 S3C2410_DMAOP_RESUME,
35 S3C2410_DMAOP_FLUSH,
36 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */
37 S3C2410_DMAOP_STARTED, /* indicate channel started */
40 struct s3c2410_dma_client {
41 char *name;
44 struct s3c2410_dma_chan;
46 /* s3c2410_dma_cbfn_t
48 * buffer callback routine type
51 typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *,
52 void *buf, int size,
53 enum s3c2410_dma_buffresult result);
55 typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *,
56 enum s3c2410_chan_op );
60 /* s3c2410_dma_request
62 * request a dma channel exclusivley
65 extern int s3c2410_dma_request(unsigned int channel,
66 struct s3c2410_dma_client *, void *dev);
69 /* s3c2410_dma_ctrl
71 * change the state of the dma channel
74 extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op);
76 /* s3c2410_dma_setflags
78 * set the channel's flags to a given state
81 extern int s3c2410_dma_setflags(unsigned int channel,
82 unsigned int flags);
84 /* s3c2410_dma_free
86 * free the dma channel (will also abort any outstanding operations)
89 extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);
91 /* s3c2410_dma_enqueue
93 * place the given buffer onto the queue of operations for the channel.
94 * The buffer must be allocated from dma coherent memory, or the Dcache/WB
95 * drained before the buffer is given to the DMA system.
98 extern int s3c2410_dma_enqueue(unsigned int channel, void *id,
99 dma_addr_t data, int size);
101 /* s3c2410_dma_config
103 * configure the dma channel
106 extern int s3c2410_dma_config(unsigned int channel, int xferunit);
108 /* s3c2410_dma_devconfig
110 * configure the device we're talking to
113 extern int s3c2410_dma_devconfig(unsigned int channel,
114 enum s3c2410_dmasrc source, unsigned long devaddr);
116 /* s3c2410_dma_getposition
118 * get the position that the dma transfer is currently at
121 extern int s3c2410_dma_getposition(unsigned int channel,
122 dma_addr_t *src, dma_addr_t *dest);
124 extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn);
125 extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn);