1 /* arch/arm/plat-samsung/include/plat/dma-ops.h 2 * 3 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 4 * http://www.samsung.com 5 * 6 * Samsung DMA support 7 * 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. 11 */ 12 13 #ifndef __SAMSUNG_DMA_OPS_H_ 14 #define __SAMSUNG_DMA_OPS_H_ __FILE__ 15 16 #include <linux/dmaengine.h> 17 #include <mach/dma.h> 18 19 struct samsung_dma_req { 20 enum dma_transaction_type cap; 21 struct s3c2410_dma_client *client; 22 }; 23 24 struct samsung_dma_prep { 25 enum dma_transaction_type cap; 26 enum dma_transfer_direction direction; 27 dma_addr_t buf; 28 unsigned long period; 29 unsigned long len; 30 void (*fp)(void *data); 31 void *fp_param; 32 }; 33 34 struct samsung_dma_config { 35 enum dma_transfer_direction direction; 36 enum dma_slave_buswidth width; 37 dma_addr_t fifo; 38 }; 39 40 struct samsung_dma_ops { 41 unsigned (*request)(enum dma_ch ch, struct samsung_dma_req *param, 42 struct device *dev, char *ch_name); 43 int (*release)(unsigned ch, void *param); 44 int (*config)(unsigned ch, struct samsung_dma_config *param); 45 int (*prepare)(unsigned ch, struct samsung_dma_prep *param); 46 int (*trigger)(unsigned ch); 47 int (*started)(unsigned ch); 48 int (*flush)(unsigned ch); 49 int (*stop)(unsigned ch); 50 }; 51 52 extern void *samsung_dmadev_get_ops(void); 53 extern void *s3c_dma_get_ops(void); 54 __samsung_dma_get_ops(void)55static inline void *__samsung_dma_get_ops(void) 56 { 57 if (samsung_dma_is_dmadev()) 58 return samsung_dmadev_get_ops(); 59 else 60 return s3c_dma_get_ops(); 61 } 62 63 /* 64 * samsung_dma_get_ops 65 * get the set of samsung dma operations 66 */ 67 #define samsung_dma_get_ops() __samsung_dma_get_ops() 68 69 #endif /* __SAMSUNG_DMA_OPS_H_ */ 70