Re: [PATCH 01/10] dmaengine: add new enum dma_transfer_direction

From: Barry Song
Date: Fri Oct 14 2011 - 02:16:33 EST


2011/10/14 Vinod Koul <vinod.koul@xxxxxxxxx>:
> From: Vinod Koul <vinod.koul@xxxxxxxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Vinod Koul <vinod.koul@xxxxxxxxxxxxxxx>

Reviewed-by: Barry Song <Baohua.Song@xxxxxxx>

> ---
> Âinclude/linux/dmaengine.h | Â 22 +++++++++++++++++-----
> Â1 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index ace51af..24942ad 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -23,7 +23,6 @@
>
> Â#include <linux/device.h>
> Â#include <linux/uio.h>
> -#include <linux/dma-direction.h>
> Â#include <linux/scatterlist.h>
>
> Â/**
> @@ -75,6 +74,19 @@ enum dma_transaction_type {
> Â/* last transaction type for creation of the capabilities mask */
> Â#define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
>
> +/**
> + * enum dma_transfer_direction - dma transfer mode and direction indicator
> + * @MEM_TO_MEM: Async/Memcpy mode
> + * @MEM_TO_DEV: Slave mode & From Memory to Device
> + * @DEV_TO_MEM: Slave mode & From Device to Memory
> + * @DEV_TO_DEV: Slave mode & From Device to Device
> + */
> +enum dma_transfer_direction {
> + Â Â Â MEM_TO_MEM,
> + Â Â Â MEM_TO_DEV,
> + Â Â Â DEV_TO_MEM,
> + Â Â Â DEV_TO_DEV,
> +};
>
> Â/**
> Â* enum dma_ctrl_flags - DMA flags to augment operation preparation,
> @@ -267,7 +279,7 @@ enum dma_slave_buswidth {
> Â* struct, if applicable.
> Â*/
> Âstruct dma_slave_config {
> - Â Â Â enum dma_data_direction direction;
> + Â Â Â enum dma_transfer_direction direction;
> Â Â Â Âdma_addr_t src_addr;
> Â Â Â Âdma_addr_t dst_addr;
> Â Â Â Âenum dma_slave_buswidth src_addr_width;
> @@ -490,11 +502,11 @@ struct dma_device {
>
> Â Â Â Âstruct dma_async_tx_descriptor *(*device_prep_slave_sg)(
> Â Â Â Â Â Â Â Âstruct dma_chan *chan, struct scatterlist *sgl,
> - Â Â Â Â Â Â Â unsigned int sg_len, enum dma_data_direction direction,
> + Â Â Â Â Â Â Â unsigned int sg_len, enum dma_transfer_direction direction,
> Â Â Â Â Â Â Â Âunsigned long flags);
> Â Â Â Âstruct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
> Â Â Â Â Â Â Â Âstruct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
> - Â Â Â Â Â Â Â size_t period_len, enum dma_data_direction direction);
> + Â Â Â Â Â Â Â size_t period_len, enum dma_transfer_direction direction);
> Â Â Â Âint (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
> Â Â Â Â Â Â Â Âunsigned long arg);
>
> @@ -520,7 +532,7 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
>
> Âstatic inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
> Â Â Â Âstruct dma_chan *chan, void *buf, size_t len,
> - Â Â Â enum dma_data_direction dir, unsigned long flags)
> + Â Â Â enum dma_transfer_direction dir, unsigned long flags)
> Â{
> Â Â Â Âstruct scatterlist sg;
> Â Â Â Âsg_init_one(&sg, buf, len);
> --
> 1.7.0.4
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/