aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@linux.intel.com>2011-10-13 05:45:27 -0400
committerVinod Koul <vinod.koul@linux.intel.com>2011-10-27 11:23:06 -0400
commit49920bc66984a512f4bcc7735a61642cd0e4d6f2 (patch)
treed695d94f6c07a2d55fa5eb18cbad89fdbd572b92 /include/linux
parent4598fc2c94b68740e0269db03c98a1e7ad5af773 (diff)
dmaengine: add new enum dma_transfer_direction
This new enum removes usage of dma_data_direction for dma direction. The new enum cleans tells the DMA direction and mode This further paves way for merging the dmaengine _prep operations and also for interleaved dma Suggested-by: Jassi Brar <jaswinder.singh@linaro.org> Reviewed-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dmaengine.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index ace51af4369f..d946ef7f5e67 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -23,7 +23,6 @@
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-direction.h>
27#include <linux/scatterlist.h> 26#include <linux/scatterlist.h>
28 27
29/** 28/**
@@ -75,6 +74,19 @@ enum dma_transaction_type {
75/* last transaction type for creation of the capabilities mask */ 74/* last transaction type for creation of the capabilities mask */
76#define DMA_TX_TYPE_END (DMA_CYCLIC + 1) 75#define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
77 76
77/**
78 * enum dma_transfer_direction - dma transfer mode and direction indicator
79 * @DMA_MEM_TO_MEM: Async/Memcpy mode
80 * @DMA_MEM_TO_DEV: Slave mode & From Memory to Device
81 * @DMA_DEV_TO_MEM: Slave mode & From Device to Memory
82 * @DMA_DEV_TO_DEV: Slave mode & From Device to Device
83 */
84enum dma_transfer_direction {
85 DMA_MEM_TO_MEM,
86 DMA_MEM_TO_DEV,
87 DMA_DEV_TO_MEM,
88 DMA_DEV_TO_DEV,
89};
78 90
79/** 91/**
80 * enum dma_ctrl_flags - DMA flags to augment operation preparation, 92 * enum dma_ctrl_flags - DMA flags to augment operation preparation,
@@ -267,7 +279,7 @@ enum dma_slave_buswidth {
267 * struct, if applicable. 279 * struct, if applicable.
268 */ 280 */
269struct dma_slave_config { 281struct dma_slave_config {
270 enum dma_data_direction direction; 282 enum dma_transfer_direction direction;
271 dma_addr_t src_addr; 283 dma_addr_t src_addr;
272 dma_addr_t dst_addr; 284 dma_addr_t dst_addr;
273 enum dma_slave_buswidth src_addr_width; 285 enum dma_slave_buswidth src_addr_width;
@@ -490,11 +502,11 @@ struct dma_device {
490 502
491 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 503 struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
492 struct dma_chan *chan, struct scatterlist *sgl, 504 struct dma_chan *chan, struct scatterlist *sgl,
493 unsigned int sg_len, enum dma_data_direction direction, 505 unsigned int sg_len, enum dma_transfer_direction direction,
494 unsigned long flags); 506 unsigned long flags);
495 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( 507 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
496 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 508 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
497 size_t period_len, enum dma_data_direction direction); 509 size_t period_len, enum dma_transfer_direction direction);
498 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 510 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
499 unsigned long arg); 511 unsigned long arg);
500 512
@@ -520,7 +532,7 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
520 532
521static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( 533static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
522 struct dma_chan *chan, void *buf, size_t len, 534 struct dma_chan *chan, void *buf, size_t len,
523 enum dma_data_direction dir, unsigned long flags) 535 enum dma_transfer_direction dir, unsigned long flags)
524{ 536{
525 struct scatterlist sg; 537 struct scatterlist sg;
526 sg_init_one(&sg, buf, len); 538 sg_init_one(&sg, buf, len);