Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+17 -5
+17 -5
include/linux/dmaengine.h
··· 23 23 24 24 #include <linux/device.h> 25 25 #include <linux/uio.h> 26 - #include <linux/dma-direction.h> 27 26 #include <linux/scatterlist.h> 28 27 29 28 /** ··· 74 75 /* last transaction type for creation of the capabilities mask */ 75 76 #define DMA_TX_TYPE_END (DMA_CYCLIC + 1) 76 77 78 + /** 79 + * enum dma_transfer_direction - dma transfer mode and direction indicator 80 + * @DMA_MEM_TO_MEM: Async/Memcpy mode 81 + * @DMA_MEM_TO_DEV: Slave mode & From Memory to Device 82 + * @DMA_DEV_TO_MEM: Slave mode & From Device to Memory 83 + * @DMA_DEV_TO_DEV: Slave mode & From Device to Device 84 + */ 85 + enum dma_transfer_direction { 86 + DMA_MEM_TO_MEM, 87 + DMA_MEM_TO_DEV, 88 + DMA_DEV_TO_MEM, 89 + DMA_DEV_TO_DEV, 90 + }; 77 91 78 92 /** 79 93 * enum dma_ctrl_flags - DMA flags to augment operation preparation, ··· 279 267 * struct, if applicable. 280 268 */ 281 269 struct dma_slave_config { 282 - enum dma_data_direction direction; 270 + enum dma_transfer_direction direction; 283 271 dma_addr_t src_addr; 284 272 dma_addr_t dst_addr; 285 273 enum dma_slave_buswidth src_addr_width; ··· 502 490 503 491 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 504 492 struct dma_chan *chan, struct scatterlist *sgl, 505 - unsigned int sg_len, enum dma_data_direction direction, 493 + unsigned int sg_len, enum dma_transfer_direction direction, 506 494 unsigned long flags); 507 495 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( 508 496 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 509 - size_t period_len, enum dma_data_direction direction); 497 + size_t period_len, enum dma_transfer_direction direction); 510 498 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 511 499 unsigned long arg); 512 500 ··· 532 520 533 521 static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( 534 522 struct dma_chan *chan, void *buf, size_t len, 535 - enum dma_data_direction dir, unsigned long flags) 523 + enum dma_transfer_direction dir, unsigned long flags) 536 524 { 537 525 struct scatterlist sg; 538 526 sg_init_one(&sg, buf, len);