Boojin Kim | c4e1662 | 2011-09-02 09:44:35 +0900 | [diff] [blame] | 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> |
Mark Brown | 6fd9dd3 | 2011-12-26 20:28:57 +0900 | [diff] [blame] | 17 | #include <mach/dma.h> |
Boojin Kim | c4e1662 | 2011-09-02 09:44:35 +0900 | [diff] [blame] | 18 | |
| 19 | struct samsung_dma_prep_info { |
| 20 | enum dma_transaction_type cap; |
Vinod Koul | 20dd5a3 | 2011-10-14 10:35:16 +0530 | [diff] [blame] | 21 | enum dma_transfer_direction direction; |
Boojin Kim | c4e1662 | 2011-09-02 09:44:35 +0900 | [diff] [blame] | 22 | dma_addr_t buf; |
| 23 | unsigned long period; |
| 24 | unsigned long len; |
| 25 | void (*fp)(void *data); |
| 26 | void *fp_param; |
| 27 | }; |
| 28 | |
| 29 | struct samsung_dma_info { |
| 30 | enum dma_transaction_type cap; |
Vinod Koul | 20dd5a3 | 2011-10-14 10:35:16 +0530 | [diff] [blame] | 31 | enum dma_transfer_direction direction; |
Boojin Kim | c4e1662 | 2011-09-02 09:44:35 +0900 | [diff] [blame] | 32 | enum dma_slave_buswidth width; |
| 33 | dma_addr_t fifo; |
| 34 | struct s3c2410_dma_client *client; |
Thomas Abraham | 4972a80 | 2011-10-24 11:43:38 +0200 | [diff] [blame] | 35 | struct property *dt_dmach_prop; |
Boojin Kim | c4e1662 | 2011-09-02 09:44:35 +0900 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | struct samsung_dma_ops { |
| 39 | unsigned (*request)(enum dma_ch ch, struct samsung_dma_info *info); |
| 40 | int (*release)(unsigned ch, struct s3c2410_dma_client *client); |
| 41 | int (*prepare)(unsigned ch, struct samsung_dma_prep_info *info); |
| 42 | int (*trigger)(unsigned ch); |
| 43 | int (*started)(unsigned ch); |
| 44 | int (*flush)(unsigned ch); |
| 45 | int (*stop)(unsigned ch); |
| 46 | }; |
| 47 | |
| 48 | extern void *samsung_dmadev_get_ops(void); |
| 49 | extern void *s3c_dma_get_ops(void); |
| 50 | |
| 51 | static inline void *__samsung_dma_get_ops(void) |
| 52 | { |
| 53 | if (samsung_dma_is_dmadev()) |
| 54 | return samsung_dmadev_get_ops(); |
| 55 | else |
| 56 | return s3c_dma_get_ops(); |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | * samsung_dma_get_ops |
| 61 | * get the set of samsung dma operations |
| 62 | */ |
| 63 | #define samsung_dma_get_ops() __samsung_dma_get_ops() |
| 64 | |
| 65 | #endif /* __SAMSUNG_DMA_OPS_H_ */ |