MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-arm / arch-s3c24a0 / dma.h
blobc390eadf7726203827a1bbd38fd09f1041b6cc05
1 /*
2 * include/asm-arm/arch-s3c24a0/dma.h
3 *
4 * $Id: dma.h,v 1.2 2005/11/28 03:55:11 gerg Exp $
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 * Based on linux/include/asm-arm/arch-s3c2410/dma.h
14 #ifndef __ASM_ARCH_DMA_H__
15 #define __ASM_ARCH_DMA_H__
17 #include "hardware.h"
19 #define MAX_DMA_ADDRESS 0xffffffff
22 * NB: By nandy
23 * If MAX_DMA_CHANNELS is zero, It means that this architecuture not use
24 * the regular generic DMA interface provided by kernel.
25 * Why? I don't know. I will investigate S3C24A0 DMA model and generic
26 * DMA interface. But not yet.
28 #define MAX_DMA_CHANNELS 0
30 /* The S3C24A0 has four internal DMA channels. */
31 #define S3C24A0_DMA_CHANNELS 4
33 #define MAX_S3C24A0_DMA_CHANNELS S3C24A0_DMA_CHANNELS
35 #define DMA_CH0 0
36 #define DMA_CH1 1
37 #define DMA_CH2 2
38 #define DMA_CH3 3
40 #define DMA_BUF_WR 1
41 #define DMA_BUF_RD 0
43 typedef void (*dma_callback_t)(void *buf_id, int size);
45 /* S3C24A0 DMA API */
46 extern int elfin_request_dma(const char *device_id, dmach_t channel,
47 dma_callback_t write_cb, dma_callback_t read_cb);
48 extern int elfin_dma_queue_buffer(dmach_t channel, void *buf_id,
49 dma_addr_t data, int size, int write);
50 extern int elfin_dma_flush_all(dmach_t channel);
51 extern void elfin_free_dma(dmach_t channel);
52 extern int elfin_dma_get_current(dmach_t channel, void **buf_id, dma_addr_t *addr);
53 extern int elfin_dma_stop(dmach_t channel);
55 #endif /* __ASM_ARCH_DMA_H__ */