All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] dmaengine: move to enum dma_transfer_direction
@ 2011-10-14  5:38 Vinod Koul
  2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
                   ` (12 more replies)
  0 siblings, 13 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul

From: Vinod Koul <vinod.koul@linux.intel.com>

As discussed recently on new interleaved dma patchset, the direction in
dmaengine needs improvement and as suggested by Jassi, this patchset move
dmaengine and dmacs, clients to use new enum dma_transfer_direction to indicate
the dma direction and mode

Vinod Koul (10):
  dmaengine: add new enum dma_transfer_direction
  dmaengine: move drivers to dma_transfer_direction
  plat-samsung: move to dma_transfer_direction
  media-video: move to dma_transfer_direction
  carma: move to dma_transfer_direction
  mmc-host: move to dma_transfer_direction
  spi, serial: move to dma_transfer_direction
  sound-soc: move to dma_transfer_direction
  USB: move to dma_transfer_direction
  net-ks8842: move to dma_transfer_direction

 arch/arm/mach-ep93xx/include/mach/dma.h        |    6 ++--
 arch/arm/plat-nomadik/include/plat/ste_dma40.h |    4 +-
 arch/arm/plat-samsung/dma-ops.c                |    4 +-
 arch/arm/plat-samsung/include/plat/dma-ops.h   |    4 +-
 drivers/dma/amba-pl08x.c                       |   24 +++++++++++-----------
 drivers/dma/at_hdmac.c                         |   22 ++++++++++----------
 drivers/dma/coh901318.c                        |   12 +++++-----
 drivers/dma/coh901318_lli.c                    |   23 ++++++++++-----------
 drivers/dma/coh901318_lli.h                    |    4 +-
 drivers/dma/dw_dmac.c                          |   14 ++++++------
 drivers/dma/ep93xx_dma.c                       |   22 ++++++++++----------
 drivers/dma/fsldma.c                           |    4 +-
 drivers/dma/imx-dma.c                          |   10 ++++----
 drivers/dma/imx-sdma.c                         |   10 ++++----
 drivers/dma/intel_mid_dma.c                    |   14 ++++++------
 drivers/dma/intel_mid_dma_regs.h               |    2 +-
 drivers/dma/ipu/ipu_idmac.c                    |    4 +-
 drivers/dma/mxs-dma.c                          |    8 +++---
 drivers/dma/pch_dma.c                          |   12 +++++-----
 drivers/dma/pl330.c                            |   18 ++++++++--------
 drivers/dma/shdma.c                            |   25 +++++++++++------------
 drivers/dma/ste_dma40.c                        |   26 ++++++++++++------------
 drivers/dma/timb_dma.c                         |   18 ++++++++--------
 drivers/dma/txx9dmac.c                         |   12 +++++-----
 drivers/media/video/mx3_camera.c               |    2 +-
 drivers/media/video/timblogiw.c                |    2 +-
 drivers/misc/carma/carma-fpga-program.c        |    2 +-
 drivers/mmc/host/atmel-mci.c                   |    9 +++++--
 drivers/mmc/host/mmci.c                        |   11 ++++++---
 drivers/mmc/host/mxcmmc.c                      |   10 ++++++--
 drivers/mmc/host/mxs-mmc.c                     |    7 +++++-
 drivers/mmc/host/sh_mmcif.c                    |    4 +-
 drivers/mmc/host/tmio_mmc_dma.c                |    4 +-
 drivers/net/ks8842.c                           |    4 +-
 drivers/spi/spi-dw-mid.c                       |    8 +++---
 drivers/spi/spi-ep93xx.c                       |    5 +++-
 drivers/spi/spi-pl022.c                        |    8 +++---
 drivers/spi/spi-topcliff-pch.c                 |    4 +-
 drivers/tty/serial/amba-pl011.c                |    8 +++---
 drivers/tty/serial/pch_uart.c                  |    4 +-
 drivers/tty/serial/sh-sci.c                    |    4 +-
 drivers/usb/musb/ux500_dma.c                   |    4 +-
 drivers/usb/renesas_usbhs/fifo.c               |    4 +-
 drivers/video/mx3fb.c                          |    4 +-
 include/linux/amba/pl08x.h                     |    4 +-
 include/linux/dmaengine.h                      |   22 +++++++++++++++----
 include/linux/dw_dmac.h                        |    2 +-
 include/linux/sh_dma.h                         |    2 +-
 sound/atmel/abdac.c                            |    2 +-
 sound/atmel/ac97c.c                            |   10 ++++----
 sound/soc/ep93xx/ep93xx-pcm.c                  |    4 +-
 sound/soc/imx/imx-pcm-dma-mx2.c                |    6 ++--
 sound/soc/samsung/dma.c                        |    4 +-
 sound/soc/sh/siu_pcm.c                         |    4 +-
 sound/soc/txx9/txx9aclc.c                      |    2 +-
 55 files changed, 250 insertions(+), 222 deletions(-)


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 01/10] dmaengine: add new enum dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14  6:15   ` Barry Song
  2011-10-15 12:46   ` Russell King
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
                   ` (11 subsequent siblings)
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul

From: Vinod Koul <vinod.koul@linux.intel.com>

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>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
  2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-15 19:02   ` Mika Westerberg
                     ` (5 more replies)
  2011-10-14  5:38 ` [PATCH 03/10] plat-samsung: move " Vinod Koul
                   ` (10 subsequent siblings)
  12 siblings, 6 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Russell King, Viresh Kumar, Linus Walleij, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Zhang Wei <zw@zh-kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Yong Wang <yong.y.wang@intel.com>
Cc: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
Cc: Boojin Kim <boojin.kim@samsung.com>
Cc: Barry Song <Baohua.Song@csr.com>
---
 arch/arm/mach-ep93xx/include/mach/dma.h        |    6 ++--
 arch/arm/plat-nomadik/include/plat/ste_dma40.h |    4 +-
 drivers/dma/amba-pl08x.c                       |   24 +++++++++++-----------
 drivers/dma/at_hdmac.c                         |   22 ++++++++++----------
 drivers/dma/coh901318.c                        |   12 +++++-----
 drivers/dma/coh901318_lli.c                    |   23 ++++++++++-----------
 drivers/dma/coh901318_lli.h                    |    4 +-
 drivers/dma/dw_dmac.c                          |   14 ++++++------
 drivers/dma/ep93xx_dma.c                       |   22 ++++++++++----------
 drivers/dma/fsldma.c                           |    4 +-
 drivers/dma/imx-dma.c                          |   10 ++++----
 drivers/dma/imx-sdma.c                         |   10 ++++----
 drivers/dma/intel_mid_dma.c                    |   14 ++++++------
 drivers/dma/intel_mid_dma_regs.h               |    2 +-
 drivers/dma/ipu/ipu_idmac.c                    |    4 +-
 drivers/dma/mxs-dma.c                          |    8 +++---
 drivers/dma/pch_dma.c                          |   12 +++++-----
 drivers/dma/pl330.c                            |   18 ++++++++--------
 drivers/dma/shdma.c                            |   25 +++++++++++------------
 drivers/dma/ste_dma40.c                        |   26 ++++++++++++------------
 drivers/dma/timb_dma.c                         |   18 ++++++++--------
 drivers/dma/txx9dmac.c                         |   12 +++++-----
 include/linux/amba/pl08x.h                     |    4 +-
 include/linux/dw_dmac.h                        |    2 +-
 include/linux/sh_dma.h                         |    2 +-
 25 files changed, 150 insertions(+), 152 deletions(-)

diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h
index 46d4d87..ba4767b 100644
--- a/arch/arm/mach-ep93xx/include/mach/dma.h
+++ b/arch/arm/mach-ep93xx/include/mach/dma.h
@@ -37,7 +37,7 @@
  */
 struct ep93xx_dma_data {
 	int				port;
-	enum dma_data_direction		direction;
+	enum dma_transfer_direction	direction;
 	const char			*name;
 };
 
@@ -80,14 +80,14 @@ static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
  * channel supports given DMA direction. Only M2P channels have such
  * limitation, for M2M channels the direction is configurable.
  */
-static inline enum dma_data_direction
+static inline enum dma_transfer_direction
 ep93xx_dma_chan_direction(struct dma_chan *chan)
 {
 	if (!ep93xx_dma_chan_is_m2p(chan))
 		return DMA_NONE;
 
 	/* even channels are for TX, odd for RX */
-	return (chan->chan_id % 2 == 0) ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+	return (chan->chan_id % 2 == 0) ? MEM_TO_DEV : DEV_TO_MEM;
 }
 
 #endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/plat-nomadik/include/plat/ste_dma40.h b/arch/arm/plat-nomadik/include/plat/ste_dma40.h
index 685c787..38b041a 100644
--- a/arch/arm/plat-nomadik/include/plat/ste_dma40.h
+++ b/arch/arm/plat-nomadik/include/plat/ste_dma40.h
@@ -187,7 +187,7 @@ static inline struct
 dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
 					    dma_addr_t addr,
 					    unsigned int size,
-					    enum dma_data_direction direction,
+					    enum dma_transfer_direction direction,
 					    unsigned long flags)
 {
 	struct scatterlist sg;
@@ -209,7 +209,7 @@ static inline struct
 dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
 					    dma_addr_t addr,
 					    unsigned int size,
-					    enum dma_data_direction direction,
+					    enum dma_transfer_direction direction,
 					    unsigned long flags)
 {
 	return NULL;
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index b7cbd1a..36cb9af 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -882,9 +882,9 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
 		ch->signal = ret;
 
 		/* Assign the flow control signal to this channel */
-		if (txd->direction == DMA_TO_DEVICE)
+		if (txd->direction == MEM_TO_DEV)
 			txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
-		else if (txd->direction == DMA_FROM_DEVICE)
+		else if (txd->direction == DEV_TO_MEM)
 			txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
 	}
 
@@ -1102,10 +1102,10 @@ static int dma_set_runtime_config(struct dma_chan *chan,
 
 	/* Transfer direction */
 	plchan->runtime_direction = config->direction;
-	if (config->direction == DMA_TO_DEVICE) {
+	if (config->direction == MEM_TO_DEV) {
 		addr_width = config->dst_addr_width;
 		maxburst = config->dst_maxburst;
-	} else if (config->direction == DMA_FROM_DEVICE) {
+	} else if (config->direction == DEV_TO_MEM) {
 		addr_width = config->src_addr_width;
 		maxburst = config->src_maxburst;
 	} else {
@@ -1136,7 +1136,7 @@ static int dma_set_runtime_config(struct dma_chan *chan,
 	cctl |= burst << PL080_CONTROL_SB_SIZE_SHIFT;
 	cctl |= burst << PL080_CONTROL_DB_SIZE_SHIFT;
 
-	if (plchan->runtime_direction == DMA_FROM_DEVICE) {
+	if (plchan->runtime_direction == DEV_TO_MEM) {
 		plchan->src_addr = config->src_addr;
 		plchan->src_cctl = pl08x_cctl(cctl) | PL080_CONTROL_DST_INCR |
 			pl08x_select_bus(plchan->cd->periph_buses,
@@ -1152,7 +1152,7 @@ static int dma_set_runtime_config(struct dma_chan *chan,
 		"configured channel %s (%s) for %s, data width %d, "
 		"maxburst %d words, LE, CCTL=0x%08x\n",
 		dma_chan_name(chan), plchan->name,
-		(config->direction == DMA_FROM_DEVICE) ? "RX" : "TX",
+		(config->direction == DEV_TO_MEM) ? "RX" : "TX",
 		addr_width,
 		maxburst,
 		cctl);
@@ -1322,7 +1322,7 @@ static struct dma_async_tx_descriptor *pl08x_prep_dma_memcpy(
 
 static struct dma_async_tx_descriptor *pl08x_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 pl08x_dma_chan *plchan = to_pl08x_chan(chan);
@@ -1354,10 +1354,10 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
 	 */
 	txd->direction = direction;
 
-	if (direction == DMA_TO_DEVICE) {
+	if (direction == MEM_TO_DEV) {
 		txd->cctl = plchan->dst_cctl;
 		slave_addr = plchan->dst_addr;
-	} else if (direction == DMA_FROM_DEVICE) {
+	} else if (direction == DEV_TO_MEM) {
 		txd->cctl = plchan->src_cctl;
 		slave_addr = plchan->src_addr;
 	} else {
@@ -1368,10 +1368,10 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
 	}
 
 	if (plchan->cd->device_fc)
-		tmp = (direction == DMA_TO_DEVICE) ? PL080_FLOW_MEM2PER_PER :
+		tmp = (direction == MEM_TO_DEV) ? PL080_FLOW_MEM2PER_PER :
 			PL080_FLOW_PER2MEM_PER;
 	else
-		tmp = (direction == DMA_TO_DEVICE) ? PL080_FLOW_MEM2PER :
+		tmp = (direction == MEM_TO_DEV) ? PL080_FLOW_MEM2PER :
 			PL080_FLOW_PER2MEM;
 
 	txd->ccfg |= tmp << PL080_CONFIG_FLOW_CONTROL_SHIFT;
@@ -1387,7 +1387,7 @@ static struct dma_async_tx_descriptor *pl08x_prep_slave_sg(
 		list_add_tail(&dsg->node, &txd->dsg_list);
 
 		dsg->len = sg_dma_len(sg);
-		if (direction == DMA_TO_DEVICE) {
+		if (direction == MEM_TO_DEV) {
 			dsg->src_addr = sg_phys(sg);
 			dsg->dst_addr = slave_addr;
 		} else {
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index fcfa0a8..7968a81 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -660,7 +660,7 @@ err_desc_get:
  */
 static struct dma_async_tx_descriptor *
 atc_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 at_dma_chan	*atchan = to_at_dma_chan(chan);
@@ -678,7 +678,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 
 	dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n",
 			sg_len,
-			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
+			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
 			flags);
 
 	if (unlikely(!atslave || !sg_len)) {
@@ -692,7 +692,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 	ctrlb = ATC_IEN;
 
 	switch (direction) {
-	case DMA_TO_DEVICE:
+	case MEM_TO_DEV:
 		ctrla |=  ATC_DST_WIDTH(reg_width);
 		ctrlb |=  ATC_DST_ADDR_MODE_FIXED
 			| ATC_SRC_ADDR_MODE_INCR
@@ -725,7 +725,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 			total_len += len;
 		}
 		break;
-	case DMA_FROM_DEVICE:
+	case DEV_TO_MEM:
 		ctrla |=  ATC_SRC_WIDTH(reg_width);
 		ctrlb |=  ATC_DST_ADDR_MODE_INCR
 			| ATC_SRC_ADDR_MODE_FIXED
@@ -787,7 +787,7 @@ err_desc_get:
  */
 static int
 atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	if (period_len > (ATC_BTSIZE_MAX << reg_width))
 		goto err_out;
@@ -795,7 +795,7 @@ atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
 		goto err_out;
 	if (unlikely(buf_addr & ((1 << reg_width) - 1)))
 		goto err_out;
-	if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE))))
+	if (unlikely(!(direction & (DEV_TO_MEM | MEM_TO_DEV))))
 		goto err_out;
 
 	return 0;
@@ -810,7 +810,7 @@ err_out:
 static int
 atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
 		unsigned int period_index, dma_addr_t buf_addr,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	u32		ctrla;
 	unsigned int	reg_width = atslave->reg_width;
@@ -822,7 +822,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
 		| period_len >> reg_width;
 
 	switch (direction) {
-	case DMA_TO_DEVICE:
+	case MEM_TO_DEV:
 		desc->lli.saddr = buf_addr + (period_len * period_index);
 		desc->lli.daddr = atslave->tx_reg;
 		desc->lli.ctrla = ctrla;
@@ -833,7 +833,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
 				| ATC_DIF(AT_DMA_PER_IF);
 		break;
 
-	case DMA_FROM_DEVICE:
+	case DEV_TO_MEM:
 		desc->lli.saddr = atslave->rx_reg;
 		desc->lli.daddr = buf_addr + (period_len * period_index);
 		desc->lli.ctrla = ctrla;
@@ -861,7 +861,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
  */
 static struct dma_async_tx_descriptor *
 atc_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)
 {
 	struct at_dma_chan	*atchan = to_at_dma_chan(chan);
 	struct at_dma_slave	*atslave = chan->private;
@@ -872,7 +872,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
 	unsigned int		i;
 
 	dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n",
-			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
+			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
 			buf_addr,
 			periods, buf_len, period_len);
 
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index 4234f41..ca4d6c1 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -39,7 +39,7 @@ struct coh901318_desc {
 	struct scatterlist *sg;
 	unsigned int sg_len;
 	struct coh901318_lli *lli;
-	enum dma_data_direction dir;
+	enum dma_transfer_direction dir;
 	unsigned long flags;
 	u32 head_config;
 	u32 head_ctrl;
@@ -1034,7 +1034,7 @@ coh901318_prep_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 
 static struct dma_async_tx_descriptor *
 coh901318_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 coh901318_chan *cohc = to_coh901318_chan(chan);
@@ -1077,7 +1077,7 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 	ctrl_last |= cohc->runtime_ctrl;
 	ctrl |= cohc->runtime_ctrl;
 
-	if (direction == DMA_TO_DEVICE) {
+	if (direction == MEM_TO_DEV) {
 		u32 tx_flags = COH901318_CX_CTRL_PRDD_SOURCE |
 			COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE;
 
@@ -1085,7 +1085,7 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 		ctrl_chained |= tx_flags;
 		ctrl_last |= tx_flags;
 		ctrl |= tx_flags;
-	} else if (direction == DMA_FROM_DEVICE) {
+	} else if (direction == DEV_TO_MEM) {
 		u32 rx_flags = COH901318_CX_CTRL_PRDD_DEST |
 			COH901318_CX_CTRL_DST_ADDR_INC_ENABLE;
 
@@ -1274,11 +1274,11 @@ static void coh901318_dma_set_runtimeconfig(struct dma_chan *chan,
 	int i = 0;
 
 	/* We only support mem to per or per to mem transfers */
-	if (config->direction == DMA_FROM_DEVICE) {
+	if (config->direction == DEV_TO_MEM) {
 		addr = config->src_addr;
 		addr_width = config->src_addr_width;
 		maxburst = config->src_maxburst;
-	} else if (config->direction == DMA_TO_DEVICE) {
+	} else if (config->direction == MEM_TO_DEV) {
 		addr = config->dst_addr;
 		addr_width = config->dst_addr_width;
 		maxburst = config->dst_maxburst;
diff --git a/drivers/dma/coh901318_lli.c b/drivers/dma/coh901318_lli.c
index 9f7e0e6..c895bd8 100644
--- a/drivers/dma/coh901318_lli.c
+++ b/drivers/dma/coh901318_lli.c
@@ -7,11 +7,10 @@
  * Author: Per Friden <per.friden@stericsson.com>
  */
 
-#include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
-#include <linux/dmapool.h>
 #include <linux/memory.h>
 #include <linux/gfp.h>
+#include <linux/dmapool.h>
 #include <mach/coh901318.h>
 
 #include "coh901318_lli.h"
@@ -177,18 +176,18 @@ coh901318_lli_fill_single(struct coh901318_pool *pool,
 			  struct coh901318_lli *lli,
 			  dma_addr_t buf, unsigned int size,
 			  dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_eom,
-			  enum dma_data_direction dir)
+			  enum dma_transfer_direction dir)
 {
 	int s = size;
 	dma_addr_t src;
 	dma_addr_t dst;
 
 
-	if (dir == DMA_TO_DEVICE) {
+	if (dir == MEM_TO_DEV) {
 		src = buf;
 		dst = dev_addr;
 
-	} else if (dir == DMA_FROM_DEVICE) {
+	} else if (dir == DEV_TO_MEM) {
 
 		src = dev_addr;
 		dst = buf;
@@ -215,9 +214,9 @@ coh901318_lli_fill_single(struct coh901318_pool *pool,
 
 		lli = coh901318_lli_next(lli);
 
-		if (dir == DMA_TO_DEVICE)
+		if (dir == MEM_TO_DEV)
 			src += block_size;
-		else if (dir == DMA_FROM_DEVICE)
+		else if (dir == DEV_TO_MEM)
 			dst += block_size;
 	}
 
@@ -234,7 +233,7 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
 		      struct scatterlist *sgl, unsigned int nents,
 		      dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl,
 		      u32 ctrl_last,
-		      enum dma_data_direction dir, u32 ctrl_irq_mask)
+		      enum dma_transfer_direction dir, u32 ctrl_irq_mask)
 {
 	int i;
 	struct scatterlist *sg;
@@ -249,9 +248,9 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
 
 	spin_lock(&pool->lock);
 
-	if (dir == DMA_TO_DEVICE)
+	if (dir == MEM_TO_DEV)
 		dst = dev_addr;
-	else if (dir == DMA_FROM_DEVICE)
+	else if (dir == DEV_TO_MEM)
 		src = dev_addr;
 	else
 		goto err;
@@ -269,7 +268,7 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
 			ctrl_sg = ctrl ? ctrl : ctrl_last;
 
 
-		if (dir == DMA_TO_DEVICE)
+		if (dir == MEM_TO_DEV)
 			/* increment source address */
 			src = sg_phys(sg);
 		else
@@ -293,7 +292,7 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
 			lli->src_addr = src;
 			lli->dst_addr = dst;
 
-			if (dir == DMA_FROM_DEVICE)
+			if (dir == DEV_TO_MEM)
 				dst += elem_size;
 			else
 				src += elem_size;
diff --git a/drivers/dma/coh901318_lli.h b/drivers/dma/coh901318_lli.h
index 7a5c809..abff371 100644
--- a/drivers/dma/coh901318_lli.h
+++ b/drivers/dma/coh901318_lli.h
@@ -97,7 +97,7 @@ coh901318_lli_fill_single(struct coh901318_pool *pool,
 			  struct coh901318_lli *lli,
 			  dma_addr_t buf, unsigned int size,
 			  dma_addr_t dev_addr, u32 ctrl_chained, u32 ctrl_last,
-			  enum dma_data_direction dir);
+			  enum dma_transfer_direction dir);
 
 /**
  * coh901318_lli_fill_single() - Prepares the lli:s for dma scatter list transfer
@@ -119,6 +119,6 @@ coh901318_lli_fill_sg(struct coh901318_pool *pool,
 		      struct scatterlist *sg, unsigned int nents,
 		      dma_addr_t dev_addr, u32 ctrl_chained,
 		      u32 ctrl, u32 ctrl_last,
-		      enum dma_data_direction dir, u32 ctrl_irq_mask);
+		      enum dma_transfer_direction dir, u32 ctrl_irq_mask);
 
 #endif /* COH901318_LLI_H */
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 9bfd6d3..ff05382 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -696,7 +696,7 @@ err_desc_get:
 
 static struct dma_async_tx_descriptor *
 dwc_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 dw_dma_chan	*dwc = to_dw_dma_chan(chan);
@@ -720,7 +720,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 	prev = first = NULL;
 
 	switch (direction) {
-	case DMA_TO_DEVICE:
+	case MEM_TO_DEV:
 		ctllo = (DWC_DEFAULT_CTLLO(chan->private)
 				| DWC_CTLL_DST_WIDTH(reg_width)
 				| DWC_CTLL_DST_FIX
@@ -777,7 +777,7 @@ slave_sg_todev_fill_desc:
 				goto slave_sg_todev_fill_desc;
 		}
 		break;
-	case DMA_FROM_DEVICE:
+	case DEV_TO_MEM:
 		ctllo = (DWC_DEFAULT_CTLLO(chan->private)
 				| DWC_CTLL_SRC_WIDTH(reg_width)
 				| DWC_CTLL_DST_INC
@@ -1165,7 +1165,7 @@ EXPORT_SYMBOL(dw_dma_cyclic_stop);
  */
 struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
 		dma_addr_t buf_addr, size_t buf_len, size_t period_len,
-		enum dma_data_direction direction)
+		enum dma_transfer_direction direction)
 {
 	struct dw_dma_chan		*dwc = to_dw_dma_chan(chan);
 	struct dw_cyclic_desc		*cdesc;
@@ -1206,7 +1206,7 @@ struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
 		goto out_err;
 	if (unlikely(buf_addr & ((1 << reg_width) - 1)))
 		goto out_err;
-	if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE))))
+	if (unlikely(!(direction & (MEM_TO_DEV | DEV_TO_MEM))))
 		goto out_err;
 
 	retval = ERR_PTR(-ENOMEM);
@@ -1228,7 +1228,7 @@ struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
 			goto out_err_desc_get;
 
 		switch (direction) {
-		case DMA_TO_DEVICE:
+		case MEM_TO_DEV:
 			desc->lli.dar = dws->tx_reg;
 			desc->lli.sar = buf_addr + (period_len * i);
 			desc->lli.ctllo = (DWC_DEFAULT_CTLLO(chan->private)
@@ -1239,7 +1239,7 @@ struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
 					| DWC_CTLL_FC(dws->fc)
 					| DWC_CTLL_INT_EN);
 			break;
-		case DMA_FROM_DEVICE:
+		case DEV_TO_MEM:
 			desc->lli.dar = buf_addr + (period_len * i);
 			desc->lli.sar = dws->rx_reg;
 			desc->lli.ctllo = (DWC_DEFAULT_CTLLO(chan->private)
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index 5d7a49b..42c4698 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -329,7 +329,7 @@ static void m2p_fill_desc(struct ep93xx_dma_chan *edmac)
 	struct ep93xx_dma_desc *desc = ep93xx_dma_get_active(edmac);
 	u32 bus_addr;
 
-	if (ep93xx_dma_chan_direction(&edmac->chan) == DMA_TO_DEVICE)
+	if (ep93xx_dma_chan_direction(&edmac->chan) == MEM_TO_DEV)
 		bus_addr = desc->src_addr;
 	else
 		bus_addr = desc->dst_addr;
@@ -442,7 +442,7 @@ static int m2m_hw_setup(struct ep93xx_dma_chan *edmac)
 		control = (5 << M2M_CONTROL_PWSC_SHIFT);
 		control |= M2M_CONTROL_NO_HDSK;
 
-		if (data->direction == DMA_TO_DEVICE) {
+		if (data->direction == MEM_TO_DEV) {
 			control |= M2M_CONTROL_DAH;
 			control |= M2M_CONTROL_TM_TX;
 			control |= M2M_CONTROL_RSS_SSPTX;
@@ -462,7 +462,7 @@ static int m2m_hw_setup(struct ep93xx_dma_chan *edmac)
 		control |= M2M_CONTROL_RSS_IDE;
 		control |= M2M_CONTROL_PW_16;
 
-		if (data->direction == DMA_TO_DEVICE) {
+		if (data->direction == MEM_TO_DEV) {
 			/* Worst case from the UG */
 			control = (3 << M2M_CONTROL_PWSC_SHIFT);
 			control |= M2M_CONTROL_DAH;
@@ -802,8 +802,8 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
 			switch (data->port) {
 			case EP93XX_DMA_SSP:
 			case EP93XX_DMA_IDE:
-				if (data->direction != DMA_TO_DEVICE &&
-				    data->direction != DMA_FROM_DEVICE)
+				if (data->direction != MEM_TO_DEV &&
+				    data->direction != DEV_TO_MEM)
 					return -EINVAL;
 				break;
 			default:
@@ -951,7 +951,7 @@ fail:
  */
 static struct dma_async_tx_descriptor *
 ep93xx_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
-			 unsigned int sg_len, enum dma_data_direction dir,
+			 unsigned int sg_len, enum dma_transfer_direction dir,
 			 unsigned long flags)
 {
 	struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan);
@@ -987,7 +987,7 @@ ep93xx_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 			goto fail;
 		}
 
-		if (dir == DMA_TO_DEVICE) {
+		if (dir == MEM_TO_DEV) {
 			desc->src_addr = sg_dma_address(sg);
 			desc->dst_addr = edmac->runtime_addr;
 		} else {
@@ -1031,7 +1031,7 @@ fail:
 static struct dma_async_tx_descriptor *
 ep93xx_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
 			   size_t buf_len, size_t period_len,
-			   enum dma_data_direction dir)
+			   enum dma_transfer_direction dir)
 {
 	struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan);
 	struct ep93xx_dma_desc *desc, *first;
@@ -1064,7 +1064,7 @@ ep93xx_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
 			goto fail;
 		}
 
-		if (dir == DMA_TO_DEVICE) {
+		if (dir == MEM_TO_DEV) {
 			desc->src_addr = dma_addr + offset;
 			desc->dst_addr = edmac->runtime_addr;
 		} else {
@@ -1132,12 +1132,12 @@ static int ep93xx_dma_slave_config(struct ep93xx_dma_chan *edmac,
 		return -EINVAL;
 
 	switch (config->direction) {
-	case DMA_FROM_DEVICE:
+	case DEV_TO_MEM:
 		width = config->src_addr_width;
 		addr = config->src_addr;
 		break;
 
-	case DMA_TO_DEVICE:
+	case MEM_TO_DEV:
 		width = config->dst_addr_width;
 		addr = config->dst_addr;
 		break;
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 8a78154..fc980f0 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -772,7 +772,7 @@ fail:
  */
 static struct dma_async_tx_descriptor *fsl_dma_prep_slave_sg(
 	struct dma_chan *dchan, struct scatterlist *sgl, unsigned int sg_len,
-	enum dma_data_direction direction, unsigned long flags)
+	enum dma_transfer_direction direction, unsigned long flags)
 {
 	/*
 	 * This operation is not supported on the Freescale DMA controller
@@ -819,7 +819,7 @@ static int fsl_dma_device_control(struct dma_chan *dchan,
 			return -ENXIO;
 
 		/* we set the controller burst size depending on direction */
-		if (config->direction == DMA_TO_DEVICE)
+		if (config->direction == MEM_TO_DEV)
 			size = config->dst_addr_width * config->dst_maxburst;
 		else
 			size = config->src_addr_width * config->src_maxburst;
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index d746899..a47c312 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -106,7 +106,7 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 		imx_dma_disable(imxdmac->imxdma_channel);
 		return 0;
 	case DMA_SLAVE_CONFIG:
-		if (dmaengine_cfg->direction == DMA_FROM_DEVICE) {
+		if (dmaengine_cfg->direction == DEV_TO_MEM) {
 			imxdmac->per_address = dmaengine_cfg->src_addr;
 			imxdmac->watermark_level = dmaengine_cfg->src_maxburst;
 			imxdmac->word_size = dmaengine_cfg->src_addr_width;
@@ -223,7 +223,7 @@ static void imxdma_free_chan_resources(struct dma_chan *chan)
 
 static struct dma_async_tx_descriptor *imxdma_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 imxdma_channel *imxdmac = to_imxdma_chan(chan);
@@ -240,7 +240,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
 		dma_length += sg->length;
 	}
 
-	if (direction == DMA_FROM_DEVICE)
+	if (direction == DEV_TO_MEM)
 		dmamode = DMA_MODE_READ;
 	else
 		dmamode = DMA_MODE_WRITE;
@@ -270,7 +270,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
 
 static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
 		struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	struct imxdma_channel *imxdmac = to_imxdma_chan(chan);
 	struct imxdma_engine *imxdma = imxdmac->imxdma;
@@ -316,7 +316,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
 	imxdmac->sg_list[periods].page_link =
 		((unsigned long)imxdmac->sg_list | 0x01) & ~0x02;
 
-	if (direction == DMA_FROM_DEVICE)
+	if (direction == DEV_TO_MEM)
 		dmamode = DMA_MODE_READ;
 	else
 		dmamode = DMA_MODE_WRITE;
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index eab1fe7..ae0c9a0 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -246,7 +246,7 @@ struct sdma_engine;
 struct sdma_channel {
 	struct sdma_engine		*sdma;
 	unsigned int			channel;
-	enum dma_data_direction		direction;
+	enum dma_transfer_direction		direction;
 	enum sdma_peripheral_type	peripheral_type;
 	unsigned int			event_id0;
 	unsigned int			event_id1;
@@ -649,7 +649,7 @@ static int sdma_load_context(struct sdma_channel *sdmac)
 	struct sdma_buffer_descriptor *bd0 = sdma->channel[0].bd;
 	int ret;
 
-	if (sdmac->direction == DMA_FROM_DEVICE) {
+	if (sdmac->direction == DEV_TO_MEM) {
 		load_address = sdmac->pc_from_device;
 	} else {
 		load_address = sdmac->pc_to_device;
@@ -910,7 +910,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 static struct dma_async_tx_descriptor *sdma_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 sdma_channel *sdmac = to_sdma_chan(chan);
@@ -1007,7 +1007,7 @@ err_out:
 
 static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic(
 		struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	struct sdma_channel *sdmac = to_sdma_chan(chan);
 	struct sdma_engine *sdma = sdmac->sdma;
@@ -1092,7 +1092,7 @@ static int sdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 		sdma_disable_channel(sdmac);
 		return 0;
 	case DMA_SLAVE_CONFIG:
-		if (dmaengine_cfg->direction == DMA_FROM_DEVICE) {
+		if (dmaengine_cfg->direction == DEV_TO_MEM) {
 			sdmac->per_address = dmaengine_cfg->src_addr;
 			sdmac->watermark_level = dmaengine_cfg->src_maxburst;
 			sdmac->word_size = dmaengine_cfg->src_addr_width;
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index cf74a66..e4f34c4 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -396,10 +396,10 @@ static int midc_lli_fill_sg(struct intel_mid_dma_chan *midc,
 							midc->dma->block_size);
 		/*Populate SAR and DAR values*/
 		sg_phy_addr = sg_phys(sg);
-		if (desc->dirn ==  DMA_TO_DEVICE) {
+		if (desc->dirn ==  MEM_TO_DEV) {
 			lli_bloc_desc->sar  = sg_phy_addr;
 			lli_bloc_desc->dar  = mids->dma_slave.dst_addr;
-		} else if (desc->dirn ==  DMA_FROM_DEVICE) {
+		} else if (desc->dirn ==  DEV_TO_MEM) {
 			lli_bloc_desc->sar  = mids->dma_slave.src_addr;
 			lli_bloc_desc->dar  = sg_phy_addr;
 		}
@@ -633,13 +633,13 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_memcpy(
 		if (midc->dma->pimr_mask) {
 			cfg_hi.cfgx.protctl = 0x0; /*default value*/
 			cfg_hi.cfgx.fifo_mode = 1;
-			if (mids->dma_slave.direction == DMA_TO_DEVICE) {
+			if (mids->dma_slave.direction == MEM_TO_DEV) {
 				cfg_hi.cfgx.src_per = 0;
 				if (mids->device_instance == 0)
 					cfg_hi.cfgx.dst_per = 3;
 				if (mids->device_instance == 1)
 					cfg_hi.cfgx.dst_per = 1;
-			} else if (mids->dma_slave.direction == DMA_FROM_DEVICE) {
+			} else if (mids->dma_slave.direction == DEV_TO_MEM) {
 				if (mids->device_instance == 0)
 					cfg_hi.cfgx.src_per = 2;
 				if (mids->device_instance == 1)
@@ -683,11 +683,11 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_memcpy(
 		ctl_lo.ctlx.sinc = 0;
 		ctl_lo.ctlx.dinc = 0;
 	} else {
-		if (mids->dma_slave.direction == DMA_TO_DEVICE) {
+		if (mids->dma_slave.direction == MEM_TO_DEV) {
 			ctl_lo.ctlx.sinc = 0;
 			ctl_lo.ctlx.dinc = 2;
 			ctl_lo.ctlx.tt_fc = 1;
-		} else if (mids->dma_slave.direction == DMA_FROM_DEVICE) {
+		} else if (mids->dma_slave.direction == DEV_TO_MEM) {
 			ctl_lo.ctlx.sinc = 2;
 			ctl_lo.ctlx.dinc = 0;
 			ctl_lo.ctlx.tt_fc = 2;
@@ -733,7 +733,7 @@ err_desc_get:
  */
 static struct dma_async_tx_descriptor *intel_mid_dma_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 intel_mid_dma_chan *midc = NULL;
diff --git a/drivers/dma/intel_mid_dma_regs.h b/drivers/dma/intel_mid_dma_regs.h
index aea5ee8..c6de919 100644
--- a/drivers/dma/intel_mid_dma_regs.h
+++ b/drivers/dma/intel_mid_dma_regs.h
@@ -262,7 +262,7 @@ struct intel_mid_dma_desc {
 	unsigned int			lli_length;
 	unsigned int			current_lli;
 	dma_addr_t			next;
-	enum dma_data_direction		dirn;
+	enum dma_transfer_direction		dirn;
 	enum dma_status			status;
 	enum dma_slave_buswidth		width; /*width of DMA txn*/
 	enum intel_mid_dma_mode		cfg_mode; /*mode configuration*/
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index 6815905..8bb6556 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1362,7 +1362,7 @@ static void ipu_gc_tasklet(unsigned long arg)
 /* Allocate and initialise a transfer descriptor. */
 static struct dma_async_tx_descriptor *idmac_prep_slave_sg(struct dma_chan *chan,
 		struct scatterlist *sgl, unsigned int sg_len,
-		enum dma_data_direction direction, unsigned long tx_flags)
+		enum dma_transfer_direction direction, unsigned long tx_flags)
 {
 	struct idmac_channel *ichan = to_idmac_chan(chan);
 	struct idmac_tx_desc *desc = NULL;
@@ -1374,7 +1374,7 @@ static struct dma_async_tx_descriptor *idmac_prep_slave_sg(struct dma_chan *chan
 	    chan->chan_id != IDMAC_IC_7)
 		return NULL;
 
-	if (direction != DMA_FROM_DEVICE && direction != DMA_TO_DEVICE) {
+	if (direction != DEV_TO_MEM && direction != MEM_TO_DEV) {
 		dev_err(chan->device->dev, "Invalid DMA direction %d!\n", direction);
 		return NULL;
 	}
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index b4588bd..be3c613 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -377,7 +377,7 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
 
 static struct dma_async_tx_descriptor *mxs_dma_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 append)
 {
 	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
@@ -450,7 +450,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 			ccw->bits |= CCW_CHAIN;
 			ccw->bits |= CCW_HALT_ON_TERM;
 			ccw->bits |= CCW_TERM_FLUSH;
-			ccw->bits |= BF_CCW(direction == DMA_FROM_DEVICE ?
+			ccw->bits |= BF_CCW(direction == DEV_TO_MEM ?
 					MXS_DMA_CMD_WRITE : MXS_DMA_CMD_READ,
 					COMMAND);
 
@@ -472,7 +472,7 @@ err_out:
 
 static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic(
 		struct dma_chan *chan, dma_addr_t dma_addr, size_t buf_len,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -515,7 +515,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_dma_cyclic(
 		ccw->bits |= CCW_IRQ;
 		ccw->bits |= CCW_HALT_ON_TERM;
 		ccw->bits |= CCW_TERM_FLUSH;
-		ccw->bits |= BF_CCW(direction == DMA_FROM_DEVICE ?
+		ccw->bits |= BF_CCW(direction == DEV_TO_MEM ?
 				MXS_DMA_CMD_WRITE : MXS_DMA_CMD_READ, COMMAND);
 
 		dma_addr += period_len;
diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index a6d0e3d..cd35e59 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -99,7 +99,7 @@ struct pch_dma_desc {
 struct pch_dma_chan {
 	struct dma_chan		chan;
 	void __iomem *membase;
-	enum dma_data_direction	dir;
+	enum dma_transfer_direction dir;
 	struct tasklet_struct	tasklet;
 	unsigned long		err_status;
 
@@ -224,7 +224,7 @@ static void pdc_set_dir(struct dma_chan *chan)
 		mask_ctl = DMA_MASK_CTL0_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
 				       (DMA_CTL0_BITS_PER_CH * chan->chan_id));
 		val &= mask_mode;
-		if (pd_chan->dir == DMA_TO_DEVICE)
+		if (pd_chan->dir == MEM_TO_DEV)
 			val |= 0x1 << (DMA_CTL0_BITS_PER_CH * chan->chan_id +
 				       DMA_CTL0_DIR_SHIFT_BITS);
 		else
@@ -242,7 +242,7 @@ static void pdc_set_dir(struct dma_chan *chan)
 		mask_ctl = DMA_MASK_CTL2_MODE & ~(DMA_CTL0_MODE_MASK_BITS <<
 						 (DMA_CTL0_BITS_PER_CH * ch));
 		val &= mask_mode;
-		if (pd_chan->dir == DMA_TO_DEVICE)
+		if (pd_chan->dir == MEM_TO_DEV)
 			val |= 0x1 << (DMA_CTL0_BITS_PER_CH * ch +
 				       DMA_CTL0_DIR_SHIFT_BITS);
 		else
@@ -607,7 +607,7 @@ static void pd_issue_pending(struct dma_chan *chan)
 
 static struct dma_async_tx_descriptor *pd_prep_slave_sg(struct dma_chan *chan,
 			struct scatterlist *sgl, unsigned int sg_len,
-			enum dma_data_direction direction, unsigned long flags)
+			enum dma_transfer_direction direction, unsigned long flags)
 {
 	struct pch_dma_chan *pd_chan = to_pd_chan(chan);
 	struct pch_dma_slave *pd_slave = chan->private;
@@ -623,9 +623,9 @@ static struct dma_async_tx_descriptor *pd_prep_slave_sg(struct dma_chan *chan,
 		return NULL;
 	}
 
-	if (direction == DMA_FROM_DEVICE)
+	if (direction == DEV_TO_MEM)
 		reg = pd_slave->rx_reg;
-	else if (direction == DMA_TO_DEVICE)
+	else if (direction == MEM_TO_DEV)
 		reg = pd_slave->tx_reg;
 	else
 		return NULL;
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 5710414..91e8d1f 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -320,14 +320,14 @@ static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned
 	case DMA_SLAVE_CONFIG:
 		slave_config = (struct dma_slave_config *)arg;
 
-		if (slave_config->direction == DMA_TO_DEVICE) {
+		if (slave_config->direction == MEM_TO_DEV) {
 			if (slave_config->dst_addr)
 				pch->fifo_addr = slave_config->dst_addr;
 			if (slave_config->dst_addr_width)
 				pch->burst_sz = __ffs(slave_config->dst_addr_width);
 			if (slave_config->dst_maxburst)
 				pch->burst_len = slave_config->dst_maxburst;
-		} else if (slave_config->direction == DMA_FROM_DEVICE) {
+		} else if (slave_config->direction == DEV_TO_MEM) {
 			if (slave_config->src_addr)
 				pch->fifo_addr = slave_config->src_addr;
 			if (slave_config->src_addr_width)
@@ -597,7 +597,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len)
 
 static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
 		struct dma_chan *chan, dma_addr_t dma_addr, size_t len,
-		size_t period_len, enum dma_data_direction direction)
+		size_t period_len, enum dma_transfer_direction direction)
 {
 	struct dma_pl330_desc *desc;
 	struct dma_pl330_chan *pch = to_pchan(chan);
@@ -612,13 +612,13 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
 	}
 
 	switch (direction) {
-	case DMA_TO_DEVICE:
+	case MEM_TO_DEV:
 		desc->rqcfg.src_inc = 1;
 		desc->rqcfg.dst_inc = 0;
 		src = dma_addr;
 		dst = pch->fifo_addr;
 		break;
-	case DMA_FROM_DEVICE:
+	case DEV_TO_MEM:
 		desc->rqcfg.src_inc = 0;
 		desc->rqcfg.dst_inc = 1;
 		src = pch->fifo_addr;
@@ -687,7 +687,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 
 static struct dma_async_tx_descriptor *
 pl330_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 flg)
 {
 	struct dma_pl330_desc *first, *desc = NULL;
@@ -702,9 +702,9 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 		return NULL;
 
 	/* Make sure the direction is consistent */
-	if ((direction == DMA_TO_DEVICE &&
+	if ((direction == MEM_TO_DEV &&
 				peri->rqtype != MEMTODEV) ||
-			(direction == DMA_FROM_DEVICE &&
+			(direction == DEV_TO_MEM &&
 				peri->rqtype != DEVTOMEM)) {
 		dev_err(pch->dmac->pif.dev, "%s:%d Invalid Direction\n",
 				__func__, __LINE__);
@@ -747,7 +747,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 		else
 			list_add_tail(&desc->node, &first->node);
 
-		if (direction == DMA_TO_DEVICE) {
+		if (direction == MEM_TO_DEV) {
 			desc->rqcfg.src_inc = 1;
 			desc->rqcfg.dst_inc = 0;
 			fill_px(&desc->px,
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 81809c2..cab7d3e 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -23,7 +23,6 @@
 #include <linux/interrupt.h>
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
-#include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/sh_dma.h>
@@ -479,19 +478,19 @@ static void sh_dmae_free_chan_resources(struct dma_chan *chan)
  * @sh_chan:	DMA channel
  * @flags:	DMA transfer flags
  * @dest:	destination DMA address, incremented when direction equals
- *		DMA_FROM_DEVICE or DMA_BIDIRECTIONAL
+ *		DEV_TO_MEM
  * @src:	source DMA address, incremented when direction equals
- *		DMA_TO_DEVICE or DMA_BIDIRECTIONAL
+ *		MEM_TO_DEV
  * @len:	DMA transfer length
  * @first:	if NULL, set to the current descriptor and cookie set to -EBUSY
  * @direction:	needed for slave DMA to decide which address to keep constant,
- *		equals DMA_BIDIRECTIONAL for MEMCPY
+ *		equals MEM_TO_MEM for MEMCPY
  * Returns 0 or an error
  * Locks: called with desc_lock held
  */
 static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
 	unsigned long flags, dma_addr_t *dest, dma_addr_t *src, size_t *len,
-	struct sh_desc **first, enum dma_data_direction direction)
+	struct sh_desc **first, enum dma_transfer_direction direction)
 {
 	struct sh_desc *new;
 	size_t copy_size;
@@ -531,9 +530,9 @@ static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
 	new->direction = direction;
 
 	*len -= copy_size;
-	if (direction == DMA_BIDIRECTIONAL || direction == DMA_TO_DEVICE)
+	if (direction == MEM_TO_MEM || direction == MEM_TO_DEV)
 		*src += copy_size;
-	if (direction == DMA_BIDIRECTIONAL || direction == DMA_FROM_DEVICE)
+	if (direction == MEM_TO_MEM || direction == DEV_TO_MEM)
 		*dest += copy_size;
 
 	return new;
@@ -546,12 +545,12 @@ static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
  * converted to scatter-gather to guarantee consistent locking and a correct
  * list manipulation. For slave DMA direction carries the usual meaning, and,
  * logically, the SG list is RAM and the addr variable contains slave address,
- * e.g., the FIFO I/O register. For MEMCPY direction equals DMA_BIDIRECTIONAL
+ * e.g., the FIFO I/O register. For MEMCPY direction equals MEM_TO_MEM
  * and the SG list contains only one element and points at the source buffer.
  */
 static struct dma_async_tx_descriptor *sh_dmae_prep_sg(struct sh_dmae_chan *sh_chan,
 	struct scatterlist *sgl, unsigned int sg_len, dma_addr_t *addr,
-	enum dma_data_direction direction, unsigned long flags)
+	enum dma_transfer_direction direction, unsigned long flags)
 {
 	struct scatterlist *sg;
 	struct sh_desc *first = NULL, *new = NULL /* compiler... */;
@@ -592,7 +591,7 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_sg(struct sh_dmae_chan *sh_c
 			dev_dbg(sh_chan->dev, "Add SG #%d@%p[%d], dma %llx\n",
 				i, sg, len, (unsigned long long)sg_addr);
 
-			if (direction == DMA_FROM_DEVICE)
+			if (direction == DEV_TO_MEM)
 				new = sh_dmae_add_desc(sh_chan, flags,
 						&sg_addr, addr, &len, &first,
 						direction);
@@ -646,13 +645,13 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_memcpy(
 	sg_dma_address(&sg) = dma_src;
 	sg_dma_len(&sg) = len;
 
-	return sh_dmae_prep_sg(sh_chan, &sg, 1, &dma_dest, DMA_BIDIRECTIONAL,
+	return sh_dmae_prep_sg(sh_chan, &sg, 1, &dma_dest, MEM_TO_MEM,
 			       flags);
 }
 
 static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
 	struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len,
-	enum dma_data_direction direction, unsigned long flags)
+	enum dma_transfer_direction direction, unsigned long flags)
 {
 	struct sh_dmae_slave *param;
 	struct sh_dmae_chan *sh_chan;
@@ -996,7 +995,7 @@ static void dmae_do_tasklet(unsigned long data)
 	spin_lock_irq(&sh_chan->desc_lock);
 	list_for_each_entry(desc, &sh_chan->ld_queue, node) {
 		if (desc->mark == DESC_SUBMITTED &&
-		    ((desc->direction == DMA_FROM_DEVICE &&
+		    ((desc->direction == DEV_TO_MEM &&
 		      (desc->hw.dar + desc->hw.tcr) == dar_buf) ||
 		     (desc->hw.sar + desc->hw.tcr) == sar_buf)) {
 			dev_dbg(sh_chan->dev, "done #%d@%p dst %u\n",
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 467e4dc..1e600e2 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -216,7 +216,7 @@ struct d40_chan {
 	struct d40_log_lli_full		*lcpa;
 	/* Runtime reconfiguration */
 	dma_addr_t			runtime_addr;
-	enum dma_data_direction		runtime_direction;
+	enum dma_transfer_direction	runtime_direction;
 };
 
 /**
@@ -1854,7 +1854,7 @@ err:
 }
 
 static dma_addr_t
-d40_get_dev_addr(struct d40_chan *chan, enum dma_data_direction direction)
+d40_get_dev_addr(struct d40_chan *chan, enum dma_transfer_direction direction)
 {
 	struct stedma40_platform_data *plat = chan->base->plat_data;
 	struct stedma40_chan_cfg *cfg = &chan->dma_cfg;
@@ -1863,9 +1863,9 @@ d40_get_dev_addr(struct d40_chan *chan, enum dma_data_direction direction)
 	if (chan->runtime_addr)
 		return chan->runtime_addr;
 
-	if (direction == DMA_FROM_DEVICE)
+	if (direction == DEV_TO_MEM)
 		addr = plat->dev_rx[cfg->src_dev_type];
-	else if (direction == DMA_TO_DEVICE)
+	else if (direction == MEM_TO_DEV)
 		addr = plat->dev_tx[cfg->dst_dev_type];
 
 	return addr;
@@ -1874,7 +1874,7 @@ d40_get_dev_addr(struct d40_chan *chan, enum dma_data_direction direction)
 static struct dma_async_tx_descriptor *
 d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
 	    struct scatterlist *sg_dst, unsigned int sg_len,
-	    enum dma_data_direction direction, unsigned long dma_flags)
+	    enum dma_transfer_direction direction, unsigned long dma_flags)
 {
 	struct d40_chan *chan = container_of(dchan, struct d40_chan, chan);
 	dma_addr_t src_dev_addr = 0;
@@ -1901,9 +1901,9 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
 	if (direction != DMA_NONE) {
 		dma_addr_t dev_addr = d40_get_dev_addr(chan, direction);
 
-		if (direction == DMA_FROM_DEVICE)
+		if (direction == DEV_TO_MEM)
 			src_dev_addr = dev_addr;
-		else if (direction == DMA_TO_DEVICE)
+		else if (direction == MEM_TO_DEV)
 			dst_dev_addr = dev_addr;
 	}
 
@@ -2107,10 +2107,10 @@ d40_prep_memcpy_sg(struct dma_chan *chan,
 static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan,
 							 struct scatterlist *sgl,
 							 unsigned int sg_len,
-							 enum dma_data_direction direction,
+							 enum dma_transfer_direction direction,
 							 unsigned long dma_flags)
 {
-	if (direction != DMA_FROM_DEVICE && direction != DMA_TO_DEVICE)
+	if (direction != DEV_TO_MEM && direction != MEM_TO_DEV)
 		return NULL;
 
 	return d40_prep_sg(chan, sgl, sgl, sg_len, direction, dma_flags);
@@ -2119,7 +2119,7 @@ static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan,
 static struct dma_async_tx_descriptor *
 dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
 		     size_t buf_len, size_t period_len,
-		     enum dma_data_direction direction)
+		     enum dma_transfer_direction direction)
 {
 	unsigned int periods = buf_len / period_len;
 	struct dma_async_tx_descriptor *txd;
@@ -2268,7 +2268,7 @@ static int d40_set_runtime_config(struct dma_chan *chan,
 	dst_addr_width = config->dst_addr_width;
 	dst_maxburst = config->dst_maxburst;
 
-	if (config->direction == DMA_FROM_DEVICE) {
+	if (config->direction == DEV_TO_MEM) {
 		dma_addr_t dev_addr_rx =
 			d40c->base->plat_data->dev_rx[cfg->src_dev_type];
 
@@ -2291,7 +2291,7 @@ static int d40_set_runtime_config(struct dma_chan *chan,
 		if (dst_maxburst == 0)
 			dst_maxburst = src_maxburst;
 
-	} else if (config->direction == DMA_TO_DEVICE) {
+	} else if (config->direction == MEM_TO_DEV) {
 		dma_addr_t dev_addr_tx =
 			d40c->base->plat_data->dev_tx[cfg->dst_dev_type];
 
@@ -2356,7 +2356,7 @@ static int d40_set_runtime_config(struct dma_chan *chan,
 		"configured channel %s for %s, data width %d/%d, "
 		"maxburst %d/%d elements, LE, no flow control\n",
 		dma_chan_name(chan),
-		(config->direction == DMA_FROM_DEVICE) ? "RX" : "TX",
+		(config->direction == DEV_TO_MEM) ? "RX" : "TX",
 		src_addr_width, dst_addr_width,
 		src_maxburst, dst_maxburst);
 
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index a4a398f..764ae74 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -90,7 +90,7 @@ struct timb_dma_chan {
 	struct list_head	queue;
 	struct list_head	free_list;
 	unsigned int		bytes_per_line;
-	enum dma_data_direction	direction;
+	enum dma_transfer_direction	direction;
 	unsigned int		descs; /* Descriptors to allocate */
 	unsigned int		desc_elems; /* number of elems per descriptor */
 };
@@ -235,7 +235,7 @@ static void __td_start_dma(struct timb_dma_chan *td_chan)
 		"td_chan: %p, chan: %d, membase: %p\n",
 		td_chan, td_chan->chan.chan_id, td_chan->membase);
 
-	if (td_chan->direction == DMA_FROM_DEVICE) {
+	if (td_chan->direction == DEV_TO_MEM) {
 
 		/* descriptor address */
 		iowrite32(0, td_chan->membase + TIMBDMA_OFFS_RX_DHAR);
@@ -278,7 +278,7 @@ static void __td_finish(struct timb_dma_chan *td_chan)
 		txd->cookie);
 
 	/* make sure to stop the transfer */
-	if (td_chan->direction == DMA_FROM_DEVICE)
+	if (td_chan->direction == DEV_TO_MEM)
 		iowrite32(0, td_chan->membase + TIMBDMA_OFFS_RX_ER);
 /* Currently no support for stopping DMA transfers
 	else
@@ -398,7 +398,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
 	td_desc->txd.flags = DMA_CTRL_ACK;
 
 	td_desc->txd.phys = dma_map_single(chan2dmadev(chan),
-		td_desc->desc_list, td_desc->desc_list_len, DMA_TO_DEVICE);
+		td_desc->desc_list, td_desc->desc_list_len, MEM_TO_DEV);
 
 	err = dma_mapping_error(chan2dmadev(chan), td_desc->txd.phys);
 	if (err) {
@@ -419,7 +419,7 @@ static void td_free_desc(struct timb_dma_desc *td_desc)
 {
 	dev_dbg(chan2dev(td_desc->txd.chan), "Freeing desc: %p\n", td_desc);
 	dma_unmap_single(chan2dmadev(td_desc->txd.chan), td_desc->txd.phys,
-		td_desc->desc_list_len, DMA_TO_DEVICE);
+		td_desc->desc_list_len, MEM_TO_DEV);
 
 	kfree(td_desc->desc_list);
 	kfree(td_desc);
@@ -558,7 +558,7 @@ static void td_issue_pending(struct dma_chan *chan)
 
 static struct dma_async_tx_descriptor *td_prep_slave_sg(struct dma_chan *chan,
 	struct scatterlist *sgl, unsigned int sg_len,
-	enum dma_data_direction direction, unsigned long flags)
+	enum dma_transfer_direction direction, unsigned long flags)
 {
 	struct timb_dma_chan *td_chan =
 		container_of(chan, struct timb_dma_chan, chan);
@@ -606,7 +606,7 @@ static struct dma_async_tx_descriptor *td_prep_slave_sg(struct dma_chan *chan,
 	}
 
 	dma_sync_single_for_device(chan2dmadev(chan), td_desc->txd.phys,
-		td_desc->desc_list_len, DMA_TO_DEVICE);
+		td_desc->desc_list_len, MEM_TO_DEV);
 
 	return &td_desc->txd;
 }
@@ -775,8 +775,8 @@ static int __devinit td_probe(struct platform_device *pdev)
 		td_chan->descs = pchan->descriptors;
 		td_chan->desc_elems = pchan->descriptor_elements;
 		td_chan->bytes_per_line = pchan->bytes_per_line;
-		td_chan->direction = pchan->rx ? DMA_FROM_DEVICE :
-			DMA_TO_DEVICE;
+		td_chan->direction = pchan->rx ? DEV_TO_MEM :
+			MEM_TO_DEV;
 
 		td_chan->membase = td->membase +
 			(i / 2) * TIMBDMA_INSTANCE_OFFSET +
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
index cbd83e3..ce6e772 100644
--- a/drivers/dma/txx9dmac.c
+++ b/drivers/dma/txx9dmac.c
@@ -845,7 +845,7 @@ txx9dmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 
 static struct dma_async_tx_descriptor *
 txx9dmac_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 txx9dmac_chan *dc = to_txx9dmac_chan(chan);
@@ -860,9 +860,9 @@ txx9dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 
 	BUG_ON(!ds || !ds->reg_width);
 	if (ds->tx_reg)
-		BUG_ON(direction != DMA_TO_DEVICE);
+		BUG_ON(direction != MEM_TO_DEV);
 	else
-		BUG_ON(direction != DMA_FROM_DEVICE);
+		BUG_ON(direction != DEV_TO_MEM);
 	if (unlikely(!sg_len))
 		return NULL;
 
@@ -882,7 +882,7 @@ txx9dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 		mem = sg_dma_address(sg);
 
 		if (__is_dmac64(ddev)) {
-			if (direction == DMA_TO_DEVICE) {
+			if (direction == MEM_TO_DEV) {
 				desc->hwdesc.SAR = mem;
 				desc->hwdesc.DAR = ds->tx_reg;
 			} else {
@@ -891,7 +891,7 @@ txx9dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 			}
 			desc->hwdesc.CNTR = sg_dma_len(sg);
 		} else {
-			if (direction == DMA_TO_DEVICE) {
+			if (direction == MEM_TO_DEV) {
 				desc->hwdesc32.SAR = mem;
 				desc->hwdesc32.DAR = ds->tx_reg;
 			} else {
@@ -900,7 +900,7 @@ txx9dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 			}
 			desc->hwdesc32.CNTR = sg_dma_len(sg);
 		}
-		if (direction == DMA_TO_DEVICE) {
+		if (direction == MEM_TO_DEV) {
 			sai = ds->reg_width;
 			dai = 0;
 		} else {
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 9eabffb..033f6aa 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -134,7 +134,7 @@ struct pl08x_txd {
 	struct dma_async_tx_descriptor tx;
 	struct list_head node;
 	struct list_head dsg_list;
-	enum dma_data_direction	direction;
+	enum dma_transfer_direction direction;
 	dma_addr_t llis_bus;
 	struct pl08x_lli *llis_va;
 	/* Default cctl value for LLIs */
@@ -197,7 +197,7 @@ struct pl08x_dma_chan {
 	dma_addr_t dst_addr;
 	u32 src_cctl;
 	u32 dst_cctl;
-	enum dma_data_direction	runtime_direction;
+	enum dma_transfer_direction runtime_direction;
 	dma_cookie_t lc;
 	struct list_head pend_list;
 	struct pl08x_txd *at;
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index 4bfe0a2..f2c64f9 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -127,7 +127,7 @@ struct dw_cyclic_desc {
 
 struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
 		dma_addr_t buf_addr, size_t buf_len, size_t period_len,
-		enum dma_data_direction direction);
+		enum dma_transfer_direction direction);
 void dw_dma_cyclic_free(struct dma_chan *chan);
 int dw_dma_cyclic_start(struct dma_chan *chan);
 void dw_dma_cyclic_stop(struct dma_chan *chan);
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index cb2dd11..62ef693 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -30,7 +30,7 @@ struct sh_desc {
 	struct sh_dmae_regs hw;
 	struct list_head node;
 	struct dma_async_tx_descriptor async_tx;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	dma_cookie_t cookie;
 	size_t partial;
 	int chunks;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 03/10] plat-samsung: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
  2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14  7:28   ` Kukjin Kim
  2011-10-14  5:38 ` [PATCH 04/10] media-video: " Vinod Koul
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Ben Dooks, Kukjin Kim, Boojin Kim

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Boojin Kim <boojin.kim@samsung.com>
---
 arch/arm/plat-samsung/dma-ops.c              |    4 ++--
 arch/arm/plat-samsung/include/plat/dma-ops.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index 6e3d9ab..a044171 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -35,14 +35,14 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
 
 	chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
 
-	if (info->direction == DMA_FROM_DEVICE) {
+	if (info->direction == DEV_TO_MEM) {
 		memset(&slave_config, 0, sizeof(struct dma_slave_config));
 		slave_config.direction = info->direction;
 		slave_config.src_addr = info->fifo;
 		slave_config.src_addr_width = info->width;
 		slave_config.src_maxburst = 1;
 		dmaengine_slave_config(chan, &slave_config);
-	} else if (info->direction == DMA_TO_DEVICE) {
+	} else if (info->direction == MEM_TO_DEV) {
 		memset(&slave_config, 0, sizeof(struct dma_slave_config));
 		slave_config.direction = info->direction;
 		slave_config.dst_addr = info->fifo;
diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h
index 4c1a363..1256115 100644
--- a/arch/arm/plat-samsung/include/plat/dma-ops.h
+++ b/arch/arm/plat-samsung/include/plat/dma-ops.h
@@ -17,7 +17,7 @@
 
 struct samsung_dma_prep_info {
 	enum dma_transaction_type cap;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	dma_addr_t buf;
 	unsigned long period;
 	unsigned long len;
@@ -27,7 +27,7 @@ struct samsung_dma_prep_info {
 
 struct samsung_dma_info {
 	enum dma_transaction_type cap;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	enum dma_slave_buswidth width;
 	dma_addr_t fifo;
 	struct s3c2410_dma_client *client;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 04/10] media-video: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (2 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 03/10] plat-samsung: move " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-17 12:52   ` Guennadi Liakhovetski
  2011-10-14  5:38 ` [PATCH 05/10] carma: " Vinod Koul
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Mauro Carvalho Chehab, Paul Mundt, Guennadi Liakhovetski

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/media/video/mx3_camera.c |    2 +-
 drivers/media/video/timblogiw.c  |    2 +-
 drivers/video/mx3fb.c            |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index c045b47..b6ac932 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -251,7 +251,7 @@ static int mx3_videobuf_prepare(struct vb2_buffer *vb)
 		sg_dma_len(sg)		= new_size;
 
 		buf->txd = ichan->dma_chan.device->device_prep_slave_sg(
-			&ichan->dma_chan, sg, 1, DMA_FROM_DEVICE,
+			&ichan->dma_chan, sg, 1, DEV_TO_MEM,
 			DMA_PREP_INTERRUPT);
 		if (!buf->txd)
 			return -EIO;
diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
index 84cd1b6..1940d47 100644
--- a/drivers/media/video/timblogiw.c
+++ b/drivers/media/video/timblogiw.c
@@ -564,7 +564,7 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
 	spin_unlock_irq(&fh->queue_lock);
 
 	desc = fh->chan->device->device_prep_slave_sg(fh->chan,
-		buf->sg, sg_elems, DMA_FROM_DEVICE,
+		buf->sg, sg_elems, DEV_TO_MEM,
 		DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
 	if (!desc) {
 		spin_lock_irq(&fh->queue_lock);
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 7e3a490..7b0232f 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -334,7 +334,7 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
 	/* This enables the channel */
 	if (mx3_fbi->cookie < 0) {
 		mx3_fbi->txd = dma_chan->device->device_prep_slave_sg(dma_chan,
-		      &mx3_fbi->sg[0], 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT);
+		      &mx3_fbi->sg[0], 1, MEM_TO_DEV, DMA_PREP_INTERRUPT);
 		if (!mx3_fbi->txd) {
 			dev_err(mx3fb->dev, "Cannot allocate descriptor on %d\n",
 				dma_chan->chan_id);
@@ -1104,7 +1104,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
 		async_tx_ack(mx3_fbi->txd);
 
 	txd = dma_chan->device->device_prep_slave_sg(dma_chan, sg +
-		mx3_fbi->cur_ipu_buf, 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT);
+		mx3_fbi->cur_ipu_buf, 1, MEM_TO_DEV, DMA_PREP_INTERRUPT);
 	if (!txd) {
 		dev_err(fbi->device,
 			"Error preparing a DMA transaction descriptor.\n");
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 05/10] carma: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (3 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 04/10] media-video: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14  5:38 ` [PATCH 06/10] mmc-host: " Vinod Koul
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
CC Ira W. Snyder <iws@ovro.caltech.edu>
---
 drivers/misc/carma/carma-fpga-program.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c
index 7ce6065..c13e578 100644
--- a/drivers/misc/carma/carma-fpga-program.c
+++ b/drivers/misc/carma/carma-fpga-program.c
@@ -513,7 +513,7 @@ static noinline int fpga_program_dma(struct fpga_dev *priv)
 	 * transaction, and then put it under external control
 	 */
 	memset(&config, 0, sizeof(config));
-	config.direction = DMA_TO_DEVICE;
+	config.direction = MEM_TO_DEV;
 	config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
 	config.dst_maxburst = fpga_fifo_size(priv->regs) / 2 / 4;
 	ret = chan->device->device_control(chan, DMA_SLAVE_CONFIG,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 06/10] mmc-host: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (4 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 05/10] carma: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-17  9:56   ` Nicolas Ferre
  2011-10-17 12:59   ` Guennadi Liakhovetski
  2011-10-14  5:38 ` [PATCH 07/10] spi, serial: " Vinod Koul
                   ` (6 subsequent siblings)
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Nicolas Ferre, Chris Ball, Guennadi Liakhovetski

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/atmel-mci.c    |    9 ++++++---
 drivers/mmc/host/mmci.c         |   11 +++++++----
 drivers/mmc/host/mxcmmc.c       |   10 +++++++---
 drivers/mmc/host/mxs-mmc.c      |    7 ++++++-
 drivers/mmc/host/sh_mmcif.c     |    4 ++--
 drivers/mmc/host/tmio_mmc_dma.c |    4 ++--
 6 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index fa8cae1..7c9d28a 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -681,16 +681,19 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
 	if (atmci_is_mci2())
 		mci_writel(host, DMA, MCI_DMA_CHKSIZE(3) | MCI_DMAEN);
 
-	if (data->flags & MMC_DATA_READ)
+	if (data->flags & MMC_DATA_READ) {
 		direction = DMA_FROM_DEVICE;
-	else
+		slave_dirn = DEV_TO_MEM;
+	} else {
 		direction = DMA_TO_DEVICE;
+		slave_dirn = MEM_TO_DEV;
+	}
 
 	sglen = dma_map_sg(chan->device->dev, data->sg,
 			   data->sg_len, direction);
 
 	desc = chan->device->device_prep_slave_sg(chan,
-			data->sg, sglen, direction,
+			data->sg, sglen, slave_dirn,
 			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc)
 		goto unmap_exit;
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 56e9a41..efbc743 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -372,6 +372,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
 	struct dma_chan *chan;
 	struct dma_device *device;
 	struct dma_async_tx_descriptor *desc;
+	enum dma_data_direction buffer_dirn;
 	int nr_sg;
 
 	/* Check if next job is already prepared */
@@ -385,10 +386,12 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
 	}
 
 	if (data->flags & MMC_DATA_READ) {
-		conf.direction = DMA_FROM_DEVICE;
+		conf.direction = DEV_TO_MEM;
+		buffer_dirn = DMA_FROM_DEVICE;
 		chan = host->dma_rx_channel;
 	} else {
-		conf.direction = DMA_TO_DEVICE;
+		conf.direction = MEM_TO_DEV;
+		buffer_dirn = DMA_TO_DEVICE;
 		chan = host->dma_tx_channel;
 	}
 
@@ -401,7 +404,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
 		return -EINVAL;
 
 	device = chan->device;
-	nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, conf.direction);
+	nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
 	if (nr_sg == 0)
 		return -EINVAL;
 
@@ -424,7 +427,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
  unmap_exit:
 	if (!next)
 		dmaengine_terminate_all(chan);
-	dma_unmap_sg(device->dev, data->sg, data->sg_len, conf.direction);
+	dma_unmap_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
 	return -ENOMEM;
 }
 
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 14aa213..4115108 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -217,6 +217,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
 	unsigned int blksz = data->blksz;
 	unsigned int datasize = nob * blksz;
 	struct scatterlist *sg;
+	enum dma_transfer_direction slave_dirn;
 	int i, nents;
 
 	if (data->flags & MMC_DATA_STREAM)
@@ -239,10 +240,13 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
 		}
 	}
 
-	if (data->flags & MMC_DATA_READ)
+	if (data->flags & MMC_DATA_READ) {
 		host->dma_dir = DMA_FROM_DEVICE;
-	else
+		slave_dirn = DEV_TO_MEM;
+	} else {
 		host->dma_dir = DMA_TO_DEVICE;
+		slave_dirn = MEM_TO_DEV;
+	}
 
 	nents = dma_map_sg(host->dma->device->dev, data->sg,
 				     data->sg_len,  host->dma_dir);
@@ -250,7 +254,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
 		return -EINVAL;
 
 	host->desc = host->dma->device->device_prep_slave_sg(host->dma,
-		data->sg, data->sg_len, host->dma_dir,
+		data->sg, data->sg_len, slave_dirn,
 		DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 
 	if (!host->desc) {
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index d513d47..c0a3def 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -153,6 +153,7 @@ struct mxs_mmc_host {
 	struct dma_chan         	*dmach;
 	struct mxs_dma_data		dma_data;
 	unsigned int			dma_dir;
+	enum dma_transfer_direction	slave_dirn;
 	u32				ssp_pio_words[SSP_PIO_NUM];
 
 	unsigned int			version;
@@ -323,7 +324,7 @@ static struct dma_async_tx_descriptor *mxs_mmc_prep_dma(
 	}
 
 	desc = host->dmach->device->device_prep_slave_sg(host->dmach,
-				sgl, sg_len, host->dma_dir, append);
+				sgl, sg_len, host->slave_dirn, append);
 	if (desc) {
 		desc->callback = mxs_mmc_dma_irq_callback;
 		desc->callback_param = host;
@@ -432,6 +433,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	int i;
 
 	unsigned short dma_data_dir, timeout;
+	enum dma_transfer_direction slave_dirn;
 	unsigned int data_size = 0, log2_blksz;
 	unsigned int blocks = data->blocks;
 
@@ -447,9 +449,11 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 
 	if (data->flags & MMC_DATA_WRITE) {
 		dma_data_dir = DMA_TO_DEVICE;
+		slave_dirn = MEM_TO_DEV;
 		read = 0;
 	} else {
 		dma_data_dir = DMA_FROM_DEVICE;
+		slave_dirn = DEV_TO_MEM;
 		read = BM_SSP_CTRL0_READ;
 	}
 
@@ -517,6 +521,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	WARN_ON(host->data != NULL);
 	host->data = data;
 	host->dma_dir = dma_data_dir;
+	host->slave_dirn = slave_dirn;
 	desc = mxs_mmc_prep_dma(host, 1);
 	if (!desc)
 		goto out;
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 557886b..7a374c9 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -230,7 +230,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
 	if (ret > 0) {
 		host->dma_active = true;
 		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-			DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+			DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	}
 
 	if (desc) {
@@ -278,7 +278,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
 	if (ret > 0) {
 		host->dma_active = true;
 		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-			DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+			MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	}
 
 	if (desc) {
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 86f259c..663624c 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -77,7 +77,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
 	ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
 	if (ret > 0)
 		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-			DMA_FROM_DEVICE, DMA_CTRL_ACK);
+			DEV_TO_MEM, DMA_CTRL_ACK);
 
 	if (desc) {
 		cookie = dmaengine_submit(desc);
@@ -158,7 +158,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
 	ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
 	if (ret > 0)
 		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
-			DMA_TO_DEVICE, DMA_CTRL_ACK);
+			MEM_TO_DEV, DMA_CTRL_ACK);
 
 	if (desc) {
 		cookie = dmaengine_submit(desc);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 07/10] spi, serial: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (5 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 06/10] mmc-host: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-15 19:00   ` Mika Westerberg
  2011-10-16  4:21   ` Grant Likely
  2011-10-14  5:38 ` [PATCH 08/10] sound-soc: " Vinod Koul
                   ` (5 subsequent siblings)
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Grant Likely, Alan Cox

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Alan Cox <alan@linux.intel.com>
---
 drivers/spi/spi-dw-mid.c        |    8 ++++----
 drivers/spi/spi-ep93xx.c        |    5 ++++-
 drivers/spi/spi-pl022.c         |    8 ++++----
 drivers/spi/spi-topcliff-pch.c  |    4 ++--
 drivers/tty/serial/amba-pl011.c |    8 ++++----
 drivers/tty/serial/pch_uart.c   |    4 ++--
 drivers/tty/serial/sh-sci.c     |    4 ++--
 7 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index 130e555..0e88d91 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -131,7 +131,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
 	rxchan = dws->rxchan;
 
 	/* 2. Prepare the TX dma transfer */
-	txconf.direction = DMA_TO_DEVICE;
+	txconf.direction = MEM_TO_DEV;
 	txconf.dst_addr = dws->dma_addr;
 	txconf.dst_maxburst = LNW_DMA_MSIZE_16;
 	txconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -147,13 +147,13 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
 	txdesc = txchan->device->device_prep_slave_sg(txchan,
 				&dws->tx_sgl,
 				1,
-				DMA_TO_DEVICE,
+				MEM_TO_DEV,
 				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
 	txdesc->callback = dw_spi_dma_done;
 	txdesc->callback_param = dws;
 
 	/* 3. Prepare the RX dma transfer */
-	rxconf.direction = DMA_FROM_DEVICE;
+	rxconf.direction = DEV_TO_MEM;
 	rxconf.src_addr = dws->dma_addr;
 	rxconf.src_maxburst = LNW_DMA_MSIZE_16;
 	rxconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -169,7 +169,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
 	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
 				&dws->rx_sgl,
 				1,
-				DMA_FROM_DEVICE,
+				DEV_TO_MEM,
 				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
 	rxdesc->callback = dw_spi_dma_done;
 	rxdesc->callback_param = dws;
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index 1cf6454..8754a39 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -550,6 +550,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
 	struct dma_async_tx_descriptor *txd;
 	enum dma_slave_buswidth buswidth;
 	struct dma_slave_config conf;
+	enum dma_transfer_direction slave_dirn;
 	struct scatterlist *sg;
 	struct sg_table *sgt;
 	struct dma_chan *chan;
@@ -572,6 +573,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
 
 		conf.src_addr = espi->sspdr_phys;
 		conf.src_addr_width = buswidth;
+		slave_dirn = DEV_TO_MEM;
 	} else {
 		chan = espi->dma_tx;
 		buf = t->tx_buf;
@@ -579,6 +581,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
 
 		conf.dst_addr = espi->sspdr_phys;
 		conf.dst_addr_width = buswidth;
+		slave_dirn = MEM_TO_DEV;
 	}
 
 	ret = dmaengine_slave_config(chan, &conf);
@@ -630,7 +633,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
 		return ERR_PTR(-ENOMEM);
 
 	txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
-						 dir, DMA_CTRL_ACK);
+						 slave_dirn, DMA_CTRL_ACK);
 	if (!txd) {
 		dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
 		return ERR_PTR(-ENOMEM);
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 730b4a3..33bcca6 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -910,11 +910,11 @@ static int configure_dma(struct pl022 *pl022)
 {
 	struct dma_slave_config rx_conf = {
 		.src_addr = SSP_DR(pl022->phybase),
-		.direction = DMA_FROM_DEVICE,
+		.direction = DEV_TO_MEM,
 	};
 	struct dma_slave_config tx_conf = {
 		.dst_addr = SSP_DR(pl022->phybase),
-		.direction = DMA_TO_DEVICE,
+		.direction = MEM_TO_DEV,
 	};
 	unsigned int pages;
 	int ret;
@@ -1051,7 +1051,7 @@ static int configure_dma(struct pl022 *pl022)
 	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
 				      pl022->sgt_rx.sgl,
 				      rx_sglen,
-				      DMA_FROM_DEVICE,
+				      DEV_TO_MEM,
 				      DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!rxdesc)
 		goto err_rxdesc;
@@ -1059,7 +1059,7 @@ static int configure_dma(struct pl022 *pl022)
 	txdesc = txchan->device->device_prep_slave_sg(txchan,
 				      pl022->sgt_tx.sgl,
 				      tx_sglen,
-				      DMA_TO_DEVICE,
+				      MEM_TO_DEV,
 				      DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!txdesc)
 		goto err_txdesc;
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 1d23f38..11232a0 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1051,7 +1051,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
 	}
 	sg = dma->sg_rx_p;
 	desc_rx = dma->chan_rx->device->device_prep_slave_sg(dma->chan_rx, sg,
-					num, DMA_FROM_DEVICE,
+					num, DEV_TO_MEM,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc_rx) {
 		dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",
@@ -1086,7 +1086,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
 	}
 	sg = dma->sg_tx_p;
 	desc_tx = dma->chan_tx->device->device_prep_slave_sg(dma->chan_tx,
-					sg, num, DMA_TO_DEVICE,
+					sg, num, MEM_TO_DEV,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc_tx) {
 		dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index f5f6831..d5305af 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -268,7 +268,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
 	struct dma_slave_config tx_conf = {
 		.dst_addr = uap->port.mapbase + UART01x_DR,
 		.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
-		.direction = DMA_TO_DEVICE,
+		.direction = MEM_TO_DEV,
 		.dst_maxburst = uap->fifosize >> 1,
 	};
 	struct dma_chan *chan;
@@ -301,7 +301,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
 		struct dma_slave_config rx_conf = {
 			.src_addr = uap->port.mapbase + UART01x_DR,
 			.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
-			.direction = DMA_FROM_DEVICE,
+			.direction = DEV_TO_MEM,
 			.src_maxburst = uap->fifosize >> 1,
 		};
 
@@ -480,7 +480,7 @@ static int pl011_dma_tx_refill(struct uart_amba_port *uap)
 		return -EBUSY;
 	}
 
-	desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, DMA_TO_DEVICE,
+	desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, MEM_TO_DEV,
 					     DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE);
@@ -676,7 +676,7 @@ static int pl011_dma_rx_trigger_dma(struct uart_amba_port *uap)
 		&uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
 	dma_dev = rxchan->device;
 	desc = rxchan->device->device_prep_slave_sg(rxchan, &sgbuf->sg, 1,
-					DMA_FROM_DEVICE,
+					DEV_TO_MEM,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	/*
 	 * If the DMA engine is busy and cannot prepare a
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index b46218d..162189e 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -747,7 +747,7 @@ static int dma_handle_rx(struct eg20t_port *priv)
 	sg_dma_address(sg) = priv->rx_buf_dma;
 
 	desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx,
-			sg, 1, DMA_FROM_DEVICE,
+			sg, 1, DEV_TO_MEM,
 			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 
 	if (!desc)
@@ -906,7 +906,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv)
 	}
 
 	desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx,
-					priv->sg_tx_p, nent, DMA_TO_DEVICE,
+					priv->sg_tx_p, nent, MEM_TO_DEV,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		dev_err(priv->port.dev, "%s:device_prep_slave_sg Failed\n",
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index dbd32a1..e147e65 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1207,7 +1207,7 @@ static void sci_submit_rx(struct sci_port *s)
 		struct dma_async_tx_descriptor *desc;
 
 		desc = chan->device->device_prep_slave_sg(chan,
-			sg, 1, DMA_FROM_DEVICE, DMA_PREP_INTERRUPT);
+			sg, 1, DEV_TO_MEM, DMA_PREP_INTERRUPT);
 
 		if (desc) {
 			s->desc_rx[i] = desc;
@@ -1322,7 +1322,7 @@ static void work_fn_tx(struct work_struct *work)
 	BUG_ON(!sg_dma_len(sg));
 
 	desc = chan->device->device_prep_slave_sg(chan,
-			sg, s->sg_len_tx, DMA_TO_DEVICE,
+			sg, s->sg_len_tx, MEM_TO_DEV,
 			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		/* switch to PIO */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 08/10] sound-soc: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (6 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 07/10] spi, serial: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14  9:40   ` Mark Brown
  2011-10-14  5:38 ` [PATCH 09/10] USB: " Vinod Koul
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Liam Girdwood, Mark Brown

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/atmel/abdac.c             |    2 +-
 sound/atmel/ac97c.c             |   10 +++++-----
 sound/soc/ep93xx/ep93xx-pcm.c   |    4 ++--
 sound/soc/imx/imx-pcm-dma-mx2.c |    6 +++---
 sound/soc/samsung/dma.c         |    4 ++--
 sound/soc/sh/siu_pcm.c          |    4 ++--
 sound/soc/txx9/txx9aclc.c       |    2 +-
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index 6fd9391..4c2d9ae 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -133,7 +133,7 @@ static int atmel_abdac_prepare_dma(struct atmel_abdac *dac,
 	period_len = frames_to_bytes(runtime, runtime->period_size);
 
 	cdesc = dw_dma_cyclic_prep(chan, runtime->dma_addr, buffer_len,
-			period_len, DMA_TO_DEVICE);
+			period_len, MEM_TO_DEV);
 	if (IS_ERR(cdesc)) {
 		dev_dbg(&dac->pdev->dev, "could not prepare cyclic DMA\n");
 		return PTR_ERR(cdesc);
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 6e5adde..d03663e 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -102,7 +102,7 @@ static void atmel_ac97c_dma_capture_period_done(void *arg)
 
 static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip,
 		struct snd_pcm_substream *substream,
-		enum dma_data_direction direction)
+		enum dma_transfer_direction direction)
 {
 	struct dma_chan			*chan;
 	struct dw_cyclic_desc		*cdesc;
@@ -118,7 +118,7 @@ static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip,
 		return -EINVAL;
 	}
 
-	if (direction == DMA_TO_DEVICE)
+	if (direction == MEM_TO_DEV)
 		chan = chip->dma.tx_chan;
 	else
 		chan = chip->dma.rx_chan;
@@ -133,7 +133,7 @@ static int atmel_ac97c_prepare_dma(struct atmel_ac97c *chip,
 		return PTR_ERR(cdesc);
 	}
 
-	if (direction == DMA_TO_DEVICE) {
+	if (direction == MEM_TO_DEV) {
 		cdesc->period_callback = atmel_ac97c_dma_playback_period_done;
 		set_bit(DMA_TX_READY, &chip->flags);
 	} else {
@@ -393,7 +393,7 @@ static int atmel_ac97c_playback_prepare(struct snd_pcm_substream *substream)
 	if (cpu_is_at32ap7000()) {
 		if (!test_bit(DMA_TX_READY, &chip->flags))
 			retval = atmel_ac97c_prepare_dma(chip, substream,
-					DMA_TO_DEVICE);
+					MEM_TO_DEV);
 	} else {
 		/* Initialize and start the PDC */
 		writel(runtime->dma_addr, chip->regs + ATMEL_PDC_TPR);
@@ -484,7 +484,7 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
 	if (cpu_is_at32ap7000()) {
 		if (!test_bit(DMA_RX_READY, &chip->flags))
 			retval = atmel_ac97c_prepare_dma(chip, substream,
-					DMA_FROM_DEVICE);
+					DEV_TO_MEM);
 	} else {
 		/* Initialize and start the PDC */
 		writel(runtime->dma_addr, chip->regs + ATMEL_PDC_RPR);
diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c
index 8dfd3ad..0f9dd1f 100644
--- a/sound/soc/ep93xx/ep93xx-pcm.c
+++ b/sound/soc/ep93xx/ep93xx-pcm.c
@@ -113,9 +113,9 @@ static int ep93xx_pcm_open(struct snd_pcm_substream *substream)
 	rtd->dma_data.name = dma_params->name;
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		rtd->dma_data.direction = DMA_TO_DEVICE;
+		rtd->dma_data.direction = MEM_TO_DEV;
 	else
-		rtd->dma_data.direction = DMA_FROM_DEVICE;
+		rtd->dma_data.direction = DEV_TO_MEM;
 
 	rtd->dma_chan = dma_request_channel(mask, ep93xx_pcm_dma_filter,
 					    &rtd->dma_data);
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index 43fdc24..b5eeaa7 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -107,12 +107,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream,
 	}
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		slave_config.direction = DMA_TO_DEVICE;
+		slave_config.direction = MEM_TO_DEV;
 		slave_config.dst_addr = dma_params->dma_addr;
 		slave_config.dst_addr_width = buswidth;
 		slave_config.dst_maxburst = dma_params->burstsize;
 	} else {
-		slave_config.direction = DMA_FROM_DEVICE;
+		slave_config.direction = DEV_TO_MEM;
 		slave_config.src_addr = dma_params->dma_addr;
 		slave_config.src_addr_width = buswidth;
 		slave_config.src_maxburst = dma_params->burstsize;
@@ -159,7 +159,7 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream,
 			iprtd->period_bytes * iprtd->periods,
 			iprtd->period_bytes,
 			substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
-			DMA_TO_DEVICE : DMA_FROM_DEVICE);
+			MEM_TO_DEV : DEV_TO_MEM);
 	if (!iprtd->desc) {
 		dev_err(&chan->dev->device, "cannot prepare slave dma\n");
 		return -EINVAL;
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index 851346f..47a4093 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -85,7 +85,7 @@ static void dma_enqueue(struct snd_pcm_substream *substream)
 	dma_info.cap = (samsung_dma_has_circular() ? DMA_CYCLIC : DMA_SLAVE);
 	dma_info.direction =
 		(substream->stream == SNDRV_PCM_STREAM_PLAYBACK
-		? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+		? MEM_TO_DEV : DEV_TO_MEM);
 	dma_info.fp = audio_buffdone;
 	dma_info.fp_param = substream;
 	dma_info.period = prtd->dma_period;
@@ -170,7 +170,7 @@ static int dma_hw_params(struct snd_pcm_substream *substream,
 		dma_info.client = prtd->params->client;
 		dma_info.direction =
 			(substream->stream == SNDRV_PCM_STREAM_PLAYBACK
-			? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+			? MEM_TO_DEV : DEV_TO_MEM);
 		dma_info.width = prtd->params->dma_size;
 		dma_info.fifo = prtd->params->dma_addr;
 		prtd->params->ch = prtd->params->ops->request(
diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
index f8f6816..0b9b323 100644
--- a/sound/soc/sh/siu_pcm.c
+++ b/sound/soc/sh/siu_pcm.c
@@ -131,7 +131,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info,
 	sg_dma_address(&sg) = buff;
 
 	desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
-		&sg, 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+		&sg, 1, MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		dev_err(dev, "Failed to allocate a dma descriptor\n");
 		return -ENOMEM;
@@ -181,7 +181,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info,
 	sg_dma_address(&sg) = buff;
 
 	desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
-		&sg, 1, DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
+		&sg, 1, DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		dev_err(dev, "Failed to allocate dma descriptor\n");
 		return -ENOMEM;
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
index 3de99af..c3c890a 100644
--- a/sound/soc/txx9/txx9aclc.c
+++ b/sound/soc/txx9/txx9aclc.c
@@ -134,7 +134,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr)
 	sg_dma_address(&sg) = buf_dma_addr;
 	desc = chan->device->device_prep_slave_sg(chan, &sg, 1,
 		dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
-		DMA_TO_DEVICE : DMA_FROM_DEVICE,
+		MEM_TO_DEV : DEV_TO_MEM,
 		DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 	if (!desc) {
 		dev_err(&chan->dev->device, "cannot prepare slave dma\n");
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 09/10] USB: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (7 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 08/10] sound-soc: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14  7:20   ` Felipe Balbi
  2011-10-14 11:01   ` Jassi Brar
  2011-10-14  5:38 ` [PATCH 10/10] net-ks8842: " Vinod Koul
                   ` (3 subsequent siblings)
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Felipe Balbi, Greg Kroah-Hartman

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/ux500_dma.c     |    4 ++--
 drivers/usb/renesas_usbhs/fifo.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index ef4333f..9587bdd 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -112,7 +112,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
 	struct musb_hw_ep *hw_ep = ux500_channel->hw_ep;
 	struct dma_chan *dma_chan = ux500_channel->dma_chan;
 	struct dma_async_tx_descriptor *dma_desc;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	struct scatterlist sg;
 	struct dma_slave_config slave_conf;
 	enum dma_slave_buswidth addr_width;
@@ -132,7 +132,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
 	sg_dma_address(&sg) = dma_addr;
 	sg_dma_len(&sg) = len;
 
-	direction = ux500_channel->is_tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+	slave_dirn = ux500_channel->is_tx ? MEM_TO_DEV : DEV_TO_MEM;
 	addr_width = (len & 0x3) ? DMA_SLAVE_BUSWIDTH_1_BYTE :
 					DMA_SLAVE_BUSWIDTH_4_BYTES;
 
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index a34430f..f5bc370 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -591,10 +591,10 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
 	struct dma_async_tx_descriptor *desc;
 	struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt);
 	struct device *dev = usbhs_priv_to_dev(priv);
-	enum dma_data_direction dir;
+	enum dma_transfer_direction dir;
 	dma_cookie_t cookie;
 
-	dir = usbhs_pipe_is_dir_in(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+	dir = usbhs_pipe_is_dir_in(pipe) ? DEV_TO_MEM : MEM_TO_DEV;
 
 	sg_init_table(&sg, 1);
 	sg_set_page(&sg, virt_to_page(pkt->dma),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 10/10] net-ks8842: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (8 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 09/10] USB: " Vinod Koul
@ 2011-10-14  5:38 ` Vinod Koul
  2011-10-14 16:39 ` [PATCH v2 1/2] USB-musb: " Vinod Koul
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  5:38 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	David S. Miller, Samuel Ortiz

From: Vinod Koul <vinod.koul@linux.intel.com>

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/net/ks8842.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index 4a6ae05..7ca0640 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -459,7 +459,7 @@ static int ks8842_tx_frame_dma(struct sk_buff *skb, struct net_device *netdev)
 		sg_dma_len(&ctl->sg) += 4 - sg_dma_len(&ctl->sg) % 4;
 
 	ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan,
-		&ctl->sg, 1, DMA_TO_DEVICE,
+		&ctl->sg, 1, MEM_TO_DEV,
 		DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
 	if (!ctl->adesc)
 		return NETDEV_TX_BUSY;
@@ -571,7 +571,7 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev)
 		sg_dma_len(sg) = DMA_BUFFER_SIZE;
 
 		ctl->adesc = ctl->chan->device->device_prep_slave_sg(ctl->chan,
-			sg, 1, DMA_FROM_DEVICE,
+			sg, 1, DEV_TO_MEM,
 			DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
 
 		if (!ctl->adesc)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] dmaengine: add new enum dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
@ 2011-10-14  6:15   ` Barry Song
  2011-10-15 12:46   ` Russell King
  1 sibling, 0 replies; 52+ messages in thread
From: Barry Song @ 2011-10-14  6:15 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, rmk, Vinod Koul,
	DL-SHA-WorkGroupLinux

2011/10/14 Vinod Koul <vinod.koul@intel.com>:
> From: Vinod Koul <vinod.koul@linux.intel.com>
>
> 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>
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>

Reviewed-by: Barry Song <Baohua.Song@csr.com>

> ---
>  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
>
>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] USB: move to dma_transfer_direction
  2011-10-14  7:20   ` Felipe Balbi
@ 2011-10-14  7:17     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14  7:17 UTC (permalink / raw)
  To: balbi
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Greg Kroah-Hartman

On Fri, 2011-10-14 at 10:20 +0300, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Oct 14, 2011 at 11:08:24AM +0530, Vinod Koul wrote:
> > From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> please add a description here.
> 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> > ---
> >  drivers/usb/musb/ux500_dma.c     |    4 ++--
> >  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> can you split this patch into two parts ? One for musb and one renesas ?
Well it was easier to do small change per subsystem rather than per driver

Can split if you insist

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] USB: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 09/10] USB: " Vinod Koul
@ 2011-10-14  7:20   ` Felipe Balbi
  2011-10-14  7:17     ` Vinod Koul
  2011-10-14 11:01   ` Jassi Brar
  1 sibling, 1 reply; 52+ messages in thread
From: Felipe Balbi @ 2011-10-14  7:20 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Felipe Balbi, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

Hi,

On Fri, Oct 14, 2011 at 11:08:24AM +0530, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>

please add a description here.

> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> ---
>  drivers/usb/musb/ux500_dma.c     |    4 ++--
>  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

can you split this patch into two parts ? One for musb and one renesas ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH 03/10] plat-samsung: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 03/10] plat-samsung: move " Vinod Koul
@ 2011-10-14  7:28   ` Kukjin Kim
  2011-10-14 16:14     ` Vinod Koul
  0 siblings, 1 reply; 52+ messages in thread
From: Kukjin Kim @ 2011-10-14  7:28 UTC (permalink / raw)
  To: 'Vinod Koul', dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, 'Vinod Koul',
	'Ben Dooks', 'Boojin Kim'

Vinod Koul wrote:
> 
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Kukjin Kim <kgene.kim@samsung.com>

Hi Vinod,
If you want to take this in your tree, you can go ahead with ack from me.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> Cc: Boojin Kim <boojin.kim@samsung.com>
> ---
>  arch/arm/plat-samsung/dma-ops.c              |    4 ++--
>  arch/arm/plat-samsung/include/plat/dma-ops.h |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/dma-ops.c
b/arch/arm/plat-samsung/dma-ops.c
> index 6e3d9ab..a044171 100644
> --- a/arch/arm/plat-samsung/dma-ops.c
> +++ b/arch/arm/plat-samsung/dma-ops.c
> @@ -35,14 +35,14 @@ static unsigned samsung_dmadev_request(enum dma_ch
> dma_ch,
> 
>  	chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
> 
> -	if (info->direction == DMA_FROM_DEVICE) {
> +	if (info->direction == DEV_TO_MEM) {
>  		memset(&slave_config, 0, sizeof(struct dma_slave_config));
>  		slave_config.direction = info->direction;
>  		slave_config.src_addr = info->fifo;
>  		slave_config.src_addr_width = info->width;
>  		slave_config.src_maxburst = 1;
>  		dmaengine_slave_config(chan, &slave_config);
> -	} else if (info->direction == DMA_TO_DEVICE) {
> +	} else if (info->direction == MEM_TO_DEV) {
>  		memset(&slave_config, 0, sizeof(struct dma_slave_config));
>  		slave_config.direction = info->direction;
>  		slave_config.dst_addr = info->fifo;
> diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-
> samsung/include/plat/dma-ops.h
> index 4c1a363..1256115 100644
> --- a/arch/arm/plat-samsung/include/plat/dma-ops.h
> +++ b/arch/arm/plat-samsung/include/plat/dma-ops.h
> @@ -17,7 +17,7 @@
> 
>  struct samsung_dma_prep_info {
>  	enum dma_transaction_type cap;
> -	enum dma_data_direction direction;
> +	enum dma_transfer_direction direction;
>  	dma_addr_t buf;
>  	unsigned long period;
>  	unsigned long len;
> @@ -27,7 +27,7 @@ struct samsung_dma_prep_info {
> 
>  struct samsung_dma_info {
>  	enum dma_transaction_type cap;
> -	enum dma_data_direction direction;
> +	enum dma_transfer_direction direction;
>  	enum dma_slave_buswidth width;
>  	dma_addr_t fifo;
>  	struct s3c2410_dma_client *client;
> --
> 1.7.0.4


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/10] sound-soc: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 08/10] sound-soc: " Vinod Koul
@ 2011-10-14  9:40   ` Mark Brown
  0 siblings, 0 replies; 52+ messages in thread
From: Mark Brown @ 2011-10-14  9:40 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Liam Girdwood

On Fri, Oct 14, 2011 at 11:08:23AM +0530, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Liam Girdwood <lrg@ti.com>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] USB: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 09/10] USB: " Vinod Koul
  2011-10-14  7:20   ` Felipe Balbi
@ 2011-10-14 11:01   ` Jassi Brar
  2011-10-14 16:13     ` Vinod Koul
  1 sibling, 1 reply; 52+ messages in thread
From: Jassi Brar @ 2011-10-14 11:01 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, 21cnbao, rmk, Vinod Koul,
	Felipe Balbi, Greg Kroah-Hartman

On 14 October 2011 11:08, Vinod Koul <vinod.koul@intel.com> wrote:
>
> diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
> index ef4333f..9587bdd 100644
> --- a/drivers/usb/musb/ux500_dma.c
> +++ b/drivers/usb/musb/ux500_dma.c
> @@ -112,7 +112,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
>        struct musb_hw_ep *hw_ep = ux500_channel->hw_ep;
>        struct dma_chan *dma_chan = ux500_channel->dma_chan;
>        struct dma_async_tx_descriptor *dma_desc;
> -       enum dma_data_direction direction;
> +       enum dma_transfer_direction direction;
>        struct scatterlist sg;
>        struct dma_slave_config slave_conf;
>        enum dma_slave_buswidth addr_width;
> @@ -132,7 +132,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
>        sg_dma_address(&sg) = dma_addr;
>        sg_dma_len(&sg) = len;
>
> -       direction = ux500_channel->is_tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
> +       slave_dirn = ux500_channel->is_tx ? MEM_TO_DEV : DEV_TO_MEM;
>        addr_width = (len & 0x3) ? DMA_SLAVE_BUSWIDTH_1_BYTE :
>                                        DMA_SLAVE_BUSWIDTH_4_BYTES;
>
s/slave_dirn/direction ?

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] USB: move to dma_transfer_direction
  2011-10-14 11:01   ` Jassi Brar
@ 2011-10-14 16:13     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14 16:13 UTC (permalink / raw)
  To: Jassi Brar
  Cc: dan.j.williams, linux-kernel, 21cnbao, rmk, Felipe Balbi,
	Greg Kroah-Hartman

On Fri, 2011-10-14 at 16:31 +0530, Jassi Brar wrote:
> On 14 October 2011 11:08, Vinod Koul <vinod.koul@intel.com> wrote:
> >
> > diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
> > index ef4333f..9587bdd 100644
> > --- a/drivers/usb/musb/ux500_dma.c
> > +++ b/drivers/usb/musb/ux500_dma.c
> > @@ -112,7 +112,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
> >        struct musb_hw_ep *hw_ep = ux500_channel->hw_ep;
> >        struct dma_chan *dma_chan = ux500_channel->dma_chan;
> >        struct dma_async_tx_descriptor *dma_desc;
> > -       enum dma_data_direction direction;
> > +       enum dma_transfer_direction direction;
> >        struct scatterlist sg;
> >        struct dma_slave_config slave_conf;
> >        enum dma_slave_buswidth addr_width;
> > @@ -132,7 +132,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
> >        sg_dma_address(&sg) = dma_addr;
> >        sg_dma_len(&sg) = len;
> >
> > -       direction = ux500_channel->is_tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
> > +       slave_dirn = ux500_channel->is_tx ? MEM_TO_DEV : DEV_TO_MEM;
> >        addr_width = (len & 0x3) ? DMA_SLAVE_BUSWIDTH_1_BYTE :
> >                                        DMA_SLAVE_BUSWIDTH_4_BYTES;
> >
> s/slave_dirn/direction ?
Oops, some how much scripts seems to have failed to build usb, hence
didnt find. Thanks for pointing out.

I will revise this and split into two as requested by Filipe


-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: [PATCH 03/10] plat-samsung: move to dma_transfer_direction
  2011-10-14  7:28   ` Kukjin Kim
@ 2011-10-14 16:14     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14 16:14 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	'Ben Dooks', 'Boojin Kim'

On Fri, 2011-10-14 at 16:28 +0900, Kukjin Kim wrote:
> Vinod Koul wrote:
> > 
> > From: Vinod Koul <vinod.koul@linux.intel.com>
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Cc: Kukjin Kim <kgene.kim@samsung.com>
> 
> Hi Vinod,
> If you want to take this in your tree, you can go ahead with ack from
> me.
> 
> Acked-by: Kukjin Kim <kgene.kim@samsung.com> 
Thanks, I think I will take the series thru my tree, makes things easier
to manage

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (9 preceding siblings ...)
  2011-10-14  5:38 ` [PATCH 10/10] net-ks8842: " Vinod Koul
@ 2011-10-14 16:39 ` Vinod Koul
  2011-11-08 14:02   ` Felipe Balbi
  2011-11-09  6:09   ` Felipe Balbi
  2011-10-14 16:39 ` [PATCH 2/2] USB-renesas: " Vinod Koul
  2011-11-17  9:19 ` [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14 16:39 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Felipe Balbi, Greg Kroah-Hartman

fixup usage of dma direction by introducing dma_transfer_direction,
this patch moves usb/musb driver to use new enum

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
v2: split the usb patch into two patches
    fix the error of direction variable

 drivers/usb/musb/ux500_dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index ef4333f..d5b5262 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -112,7 +112,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
 	struct musb_hw_ep *hw_ep = ux500_channel->hw_ep;
 	struct dma_chan *dma_chan = ux500_channel->dma_chan;
 	struct dma_async_tx_descriptor *dma_desc;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	struct scatterlist sg;
 	struct dma_slave_config slave_conf;
 	enum dma_slave_buswidth addr_width;
@@ -132,7 +132,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
 	sg_dma_address(&sg) = dma_addr;
 	sg_dma_len(&sg) = len;
 
-	direction = ux500_channel->is_tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+	direction = ux500_channel->is_tx ? MEM_TO_DEV : DEV_TO_MEM;
 	addr_width = (len & 0x3) ? DMA_SLAVE_BUSWIDTH_1_BYTE :
 					DMA_SLAVE_BUSWIDTH_4_BYTES;
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 2/2] USB-renesas: move to dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (10 preceding siblings ...)
  2011-10-14 16:39 ` [PATCH v2 1/2] USB-musb: " Vinod Koul
@ 2011-10-14 16:39 ` Vinod Koul
  2011-11-08 14:02   ` Felipe Balbi
  2011-11-09  6:10   ` Felipe Balbi
  2011-11-17  9:19 ` [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
  12 siblings, 2 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-14 16:39 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Vinod Koul,
	Felipe Balbi, Greg Kroah-Hartman

fixup usage of dma direction by introducing dma_transfer_direction,
this patch moves usb/renesas driver to use new enum

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
v2: split the usb patch into two patches

 drivers/usb/renesas_usbhs/fifo.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index a34430f..f5bc370 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -591,10 +591,10 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
 	struct dma_async_tx_descriptor *desc;
 	struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt);
 	struct device *dev = usbhs_priv_to_dev(priv);
-	enum dma_data_direction dir;
+	enum dma_transfer_direction dir;
 	dma_cookie_t cookie;
 
-	dir = usbhs_pipe_is_dir_in(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+	dir = usbhs_pipe_is_dir_in(pipe) ? DEV_TO_MEM : MEM_TO_DEV;
 
 	sg_init_table(&sg, 1);
 	sg_set_page(&sg, virt_to_page(pkt->dma),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] dmaengine: add new enum dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
  2011-10-14  6:15   ` Barry Song
@ 2011-10-15 12:46   ` Russell King
  2011-10-15 14:22     ` Barry Song
  2011-10-15 17:04     ` Vinod Koul
  1 sibling, 2 replies; 52+ messages in thread
From: Russell King @ 2011-10-15 12:46 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, Vinod Koul

On Fri, Oct 14, 2011 at 11:08:16AM +0530, Vinod Koul wrote:
> 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>
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> ---
>  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;

I thought we were killing this off - surely now is a good time, rather
than allowing it to persist with this ambiguous change of functionality.

>  	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,

Does this make any sense?  The API takes a single scatterlist of memory
locations - so MEM_TO_MEM and DEV_TO_DEV are meaningless for this API.

If it took two scatterlists and two device addresses, then maybe it would -
but I don't see the point of this change (and all the users of this API
also needing to change) when the API is specifically for memory scatterlist
to/from a device.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] dmaengine: add new enum dma_transfer_direction
  2011-10-15 12:46   ` Russell King
@ 2011-10-15 14:22     ` Barry Song
  2011-10-15 17:04     ` Vinod Koul
  1 sibling, 0 replies; 52+ messages in thread
From: Barry Song @ 2011-10-15 14:22 UTC (permalink / raw)
  To: Russell King
  Cc: Vinod Koul, dan.j.williams, linux-kernel, jaswinder.singh, Vinod Koul

2011/10/15 Russell King <rmk@arm.linux.org.uk>:
> On Fri, Oct 14, 2011 at 11:08:16AM +0530, Vinod Koul wrote:
>> 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>
>> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
>> ---
>>  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;
>
> I thought we were killing this off - surely now is a good time, rather
> than allowing it to persist with this ambiguous change of functionality.
>
>>       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,
>
> Does this make any sense?  The API takes a single scatterlist of memory
> locations - so MEM_TO_MEM and DEV_TO_DEV are meaningless for this API.

so people don't give MEM_TO_MEM and DEV_TO_DEV to this function.  This
function only accept a subset of the data_transfer_direction.

if we use dma_data_direction,  this function doesn't accept
DMA_BIDIRECTIONAL and DMA_NONE as well:
  enum dma_data_direction {
          DMA_BIDIRECTIONAL = 0,
          DMA_TO_DEVICE = 1,
          DMA_FROM_DEVICE = 2,
          DMA_NONE = 3,
  };
DMA_BIDIRECTIONAL and DMA_NONE are also meaningless for this API.

i think this patch makes sense if we consider dma_data_direction is
actually mapping direction. dma_transfer_direction is a new structure
describling the real dma source and dest. and the new interleaved api
will accept all 4 directions.

>
> If it took two scatterlists and two device addresses, then maybe it would -
> but I don't see the point of this change (and all the users of this API
> also needing to change) when the API is specifically for memory scatterlist
> to/from a device.
>
> --
> Russell King
>  Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
>  maintainer of:
>
-barry

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] dmaengine: add new enum dma_transfer_direction
  2011-10-15 12:46   ` Russell King
  2011-10-15 14:22     ` Barry Song
@ 2011-10-15 17:04     ` Vinod Koul
  1 sibling, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-15 17:04 UTC (permalink / raw)
  To: Russell King; +Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao

On Sat, 2011-10-15 at 13:46 +0100, Russell King wrote:
> On Fri, Oct 14, 2011 at 11:08:16AM +0530, Vinod Koul wrote:
> > 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
> >  
> >  /**
> >   * 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;
> 
> I thought we were killing this off - surely now is a good time, rather
> than allowing it to persist with this ambiguous change of functionality.
Ah yes, I will probably do that next week, this is by product of global
replace done on this file :)
> 
> >  	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,
> 
> Does this make any sense?  The API takes a single scatterlist of memory
> locations - so MEM_TO_MEM and DEV_TO_DEV are meaningless for this API.
> 
> If it took two scatterlists and two device addresses, then maybe it would -
> but I don't see the point of this change (and all the users of this API
> also needing to change) when the API is specifically for memory scatterlist
> to/from a device.

dma_data_direction is meaningless to dmacs. We were overloading that to
convey slave direction, so we came up with better way to handle this.
The big plus point would be for the proposed interleaved dmaengine api,
this would convey what is mode (memcpy/slave) and direction in case of
slave cleanly.

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] spi, serial: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 07/10] spi, serial: " Vinod Koul
@ 2011-10-15 19:00   ` Mika Westerberg
  2011-10-16  8:01     ` Vinod Koul
  2011-10-16  4:21   ` Grant Likely
  1 sibling, 1 reply; 52+ messages in thread
From: Mika Westerberg @ 2011-10-15 19:00 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Grant Likely, Alan Cox

On Fri, Oct 14, 2011 at 11:08:22AM +0530, Vinod Koul wrote:

> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index 1cf6454..8754a39 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -550,6 +550,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  	struct dma_async_tx_descriptor *txd;
>  	enum dma_slave_buswidth buswidth;
>  	struct dma_slave_config conf;
> +	enum dma_transfer_direction slave_dirn;
>  	struct scatterlist *sg;
>  	struct sg_table *sgt;
>  	struct dma_chan *chan;
> @@ -572,6 +573,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  
>  		conf.src_addr = espi->sspdr_phys;
>  		conf.src_addr_width = buswidth;
> +		slave_dirn = DEV_TO_MEM;
>  	} else {
>  		chan = espi->dma_tx;
>  		buf = t->tx_buf;
> @@ -579,6 +581,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  
>  		conf.dst_addr = espi->sspdr_phys;
>  		conf.dst_addr_width = buswidth;
> +		slave_dirn = MEM_TO_DEV;
>  	}
>  
>  	ret = dmaengine_slave_config(chan, &conf);
> @@ -630,7 +633,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  		return ERR_PTR(-ENOMEM);
>  
>  	txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
> -						 dir, DMA_CTRL_ACK);
> +						 slave_dirn, DMA_CTRL_ACK);
>  	if (!txd) {
>  		dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
>  		return ERR_PTR(-ENOMEM);

Can you also change the ep93xx_spi_setup_dma() function to use these new
values? Like the patch below.

Otherwise,

Acked-by: Mika Westerberg <mika.westerberg@iki.fi>

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index 66c3d9b..d97583f 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -982,7 +982,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
 	dma_cap_set(DMA_SLAVE, mask);
 
 	espi->dma_rx_data.port = EP93XX_DMA_SSP;
-	espi->dma_rx_data.direction = DMA_FROM_DEVICE;
+	espi->dma_rx_data.direction = DEV_TO_MEM;
 	espi->dma_rx_data.name = "ep93xx-spi-rx";
 
 	espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter,
@@ -993,7 +993,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
 	}
 
 	espi->dma_tx_data.port = EP93XX_DMA_SSP;
-	espi->dma_tx_data.direction = DMA_TO_DEVICE;
+	espi->dma_tx_data.direction = MEM_TO_DEV;
 	espi->dma_tx_data.name = "ep93xx-spi-tx";
 
 	espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter,

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
@ 2011-10-15 19:02   ` Mika Westerberg
  2011-10-16 11:02   ` Linus Walleij
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 52+ messages in thread
From: Mika Westerberg @ 2011-10-15 19:02 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Viresh Kumar, Linus Walleij,
	Nicolas Ferre, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

On Fri, Oct 14, 2011 at 11:08:17AM +0530, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Mika Westerberg <mika.westerberg@iki.fi>

For the ep93xx_dma part,

Acked-by: Mika Westerberg <mika.westerberg@iki.fi>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] spi, serial: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 07/10] spi, serial: " Vinod Koul
  2011-10-15 19:00   ` Mika Westerberg
@ 2011-10-16  4:21   ` Grant Likely
  2011-10-16  8:03     ` Vinod Koul
  1 sibling, 1 reply; 52+ messages in thread
From: Grant Likely @ 2011-10-16  4:21 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Alan Cox

On Fri, Oct 14, 2011 at 11:08:22AM +0530, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Alan Cox <alan@linux.intel.com>

This looks okay to me.  What tree does it need to be merged through?

g.

> ---
>  drivers/spi/spi-dw-mid.c        |    8 ++++----
>  drivers/spi/spi-ep93xx.c        |    5 ++++-
>  drivers/spi/spi-pl022.c         |    8 ++++----
>  drivers/spi/spi-topcliff-pch.c  |    4 ++--
>  drivers/tty/serial/amba-pl011.c |    8 ++++----
>  drivers/tty/serial/pch_uart.c   |    4 ++--
>  drivers/tty/serial/sh-sci.c     |    4 ++--
>  7 files changed, 22 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
> index 130e555..0e88d91 100644
> --- a/drivers/spi/spi-dw-mid.c
> +++ b/drivers/spi/spi-dw-mid.c
> @@ -131,7 +131,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
>  	rxchan = dws->rxchan;
>  
>  	/* 2. Prepare the TX dma transfer */
> -	txconf.direction = DMA_TO_DEVICE;
> +	txconf.direction = MEM_TO_DEV;
>  	txconf.dst_addr = dws->dma_addr;
>  	txconf.dst_maxburst = LNW_DMA_MSIZE_16;
>  	txconf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> @@ -147,13 +147,13 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
>  	txdesc = txchan->device->device_prep_slave_sg(txchan,
>  				&dws->tx_sgl,
>  				1,
> -				DMA_TO_DEVICE,
> +				MEM_TO_DEV,
>  				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
>  	txdesc->callback = dw_spi_dma_done;
>  	txdesc->callback_param = dws;
>  
>  	/* 3. Prepare the RX dma transfer */
> -	rxconf.direction = DMA_FROM_DEVICE;
> +	rxconf.direction = DEV_TO_MEM;
>  	rxconf.src_addr = dws->dma_addr;
>  	rxconf.src_maxburst = LNW_DMA_MSIZE_16;
>  	rxconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> @@ -169,7 +169,7 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change)
>  	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
>  				&dws->rx_sgl,
>  				1,
> -				DMA_FROM_DEVICE,
> +				DEV_TO_MEM,
>  				DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_DEST_UNMAP);
>  	rxdesc->callback = dw_spi_dma_done;
>  	rxdesc->callback_param = dws;
> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index 1cf6454..8754a39 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -550,6 +550,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  	struct dma_async_tx_descriptor *txd;
>  	enum dma_slave_buswidth buswidth;
>  	struct dma_slave_config conf;
> +	enum dma_transfer_direction slave_dirn;
>  	struct scatterlist *sg;
>  	struct sg_table *sgt;
>  	struct dma_chan *chan;
> @@ -572,6 +573,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  
>  		conf.src_addr = espi->sspdr_phys;
>  		conf.src_addr_width = buswidth;
> +		slave_dirn = DEV_TO_MEM;
>  	} else {
>  		chan = espi->dma_tx;
>  		buf = t->tx_buf;
> @@ -579,6 +581,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  
>  		conf.dst_addr = espi->sspdr_phys;
>  		conf.dst_addr_width = buswidth;
> +		slave_dirn = MEM_TO_DEV;
>  	}
>  
>  	ret = dmaengine_slave_config(chan, &conf);
> @@ -630,7 +633,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
>  		return ERR_PTR(-ENOMEM);
>  
>  	txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
> -						 dir, DMA_CTRL_ACK);
> +						 slave_dirn, DMA_CTRL_ACK);
>  	if (!txd) {
>  		dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
>  		return ERR_PTR(-ENOMEM);
> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> index 730b4a3..33bcca6 100644
> --- a/drivers/spi/spi-pl022.c
> +++ b/drivers/spi/spi-pl022.c
> @@ -910,11 +910,11 @@ static int configure_dma(struct pl022 *pl022)
>  {
>  	struct dma_slave_config rx_conf = {
>  		.src_addr = SSP_DR(pl022->phybase),
> -		.direction = DMA_FROM_DEVICE,
> +		.direction = DEV_TO_MEM,
>  	};
>  	struct dma_slave_config tx_conf = {
>  		.dst_addr = SSP_DR(pl022->phybase),
> -		.direction = DMA_TO_DEVICE,
> +		.direction = MEM_TO_DEV,
>  	};
>  	unsigned int pages;
>  	int ret;
> @@ -1051,7 +1051,7 @@ static int configure_dma(struct pl022 *pl022)
>  	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
>  				      pl022->sgt_rx.sgl,
>  				      rx_sglen,
> -				      DMA_FROM_DEVICE,
> +				      DEV_TO_MEM,
>  				      DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!rxdesc)
>  		goto err_rxdesc;
> @@ -1059,7 +1059,7 @@ static int configure_dma(struct pl022 *pl022)
>  	txdesc = txchan->device->device_prep_slave_sg(txchan,
>  				      pl022->sgt_tx.sgl,
>  				      tx_sglen,
> -				      DMA_TO_DEVICE,
> +				      MEM_TO_DEV,
>  				      DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!txdesc)
>  		goto err_txdesc;
> diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
> index 1d23f38..11232a0 100644
> --- a/drivers/spi/spi-topcliff-pch.c
> +++ b/drivers/spi/spi-topcliff-pch.c
> @@ -1051,7 +1051,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
>  	}
>  	sg = dma->sg_rx_p;
>  	desc_rx = dma->chan_rx->device->device_prep_slave_sg(dma->chan_rx, sg,
> -					num, DMA_FROM_DEVICE,
> +					num, DEV_TO_MEM,
>  					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc_rx) {
>  		dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",
> @@ -1086,7 +1086,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw)
>  	}
>  	sg = dma->sg_tx_p;
>  	desc_tx = dma->chan_tx->device->device_prep_slave_sg(dma->chan_tx,
> -					sg, num, DMA_TO_DEVICE,
> +					sg, num, MEM_TO_DEV,
>  					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc_tx) {
>  		dev_err(&data->master->dev, "%s:device_prep_slave_sg Failed\n",
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index f5f6831..d5305af 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -268,7 +268,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
>  	struct dma_slave_config tx_conf = {
>  		.dst_addr = uap->port.mapbase + UART01x_DR,
>  		.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
> -		.direction = DMA_TO_DEVICE,
> +		.direction = MEM_TO_DEV,
>  		.dst_maxburst = uap->fifosize >> 1,
>  	};
>  	struct dma_chan *chan;
> @@ -301,7 +301,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
>  		struct dma_slave_config rx_conf = {
>  			.src_addr = uap->port.mapbase + UART01x_DR,
>  			.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
> -			.direction = DMA_FROM_DEVICE,
> +			.direction = DEV_TO_MEM,
>  			.src_maxburst = uap->fifosize >> 1,
>  		};
>  
> @@ -480,7 +480,7 @@ static int pl011_dma_tx_refill(struct uart_amba_port *uap)
>  		return -EBUSY;
>  	}
>  
> -	desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, DMA_TO_DEVICE,
> +	desc = dma_dev->device_prep_slave_sg(chan, &dmatx->sg, 1, MEM_TO_DEV,
>  					     DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc) {
>  		dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE);
> @@ -676,7 +676,7 @@ static int pl011_dma_rx_trigger_dma(struct uart_amba_port *uap)
>  		&uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
>  	dma_dev = rxchan->device;
>  	desc = rxchan->device->device_prep_slave_sg(rxchan, &sgbuf->sg, 1,
> -					DMA_FROM_DEVICE,
> +					DEV_TO_MEM,
>  					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	/*
>  	 * If the DMA engine is busy and cannot prepare a
> diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
> index b46218d..162189e 100644
> --- a/drivers/tty/serial/pch_uart.c
> +++ b/drivers/tty/serial/pch_uart.c
> @@ -747,7 +747,7 @@ static int dma_handle_rx(struct eg20t_port *priv)
>  	sg_dma_address(sg) = priv->rx_buf_dma;
>  
>  	desc = priv->chan_rx->device->device_prep_slave_sg(priv->chan_rx,
> -			sg, 1, DMA_FROM_DEVICE,
> +			sg, 1, DEV_TO_MEM,
>  			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  
>  	if (!desc)
> @@ -906,7 +906,7 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv)
>  	}
>  
>  	desc = priv->chan_tx->device->device_prep_slave_sg(priv->chan_tx,
> -					priv->sg_tx_p, nent, DMA_TO_DEVICE,
> +					priv->sg_tx_p, nent, MEM_TO_DEV,
>  					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc) {
>  		dev_err(priv->port.dev, "%s:device_prep_slave_sg Failed\n",
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index dbd32a1..e147e65 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -1207,7 +1207,7 @@ static void sci_submit_rx(struct sci_port *s)
>  		struct dma_async_tx_descriptor *desc;
>  
>  		desc = chan->device->device_prep_slave_sg(chan,
> -			sg, 1, DMA_FROM_DEVICE, DMA_PREP_INTERRUPT);
> +			sg, 1, DEV_TO_MEM, DMA_PREP_INTERRUPT);
>  
>  		if (desc) {
>  			s->desc_rx[i] = desc;
> @@ -1322,7 +1322,7 @@ static void work_fn_tx(struct work_struct *work)
>  	BUG_ON(!sg_dma_len(sg));
>  
>  	desc = chan->device->device_prep_slave_sg(chan,
> -			sg, s->sg_len_tx, DMA_TO_DEVICE,
> +			sg, s->sg_len_tx, MEM_TO_DEV,
>  			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc) {
>  		/* switch to PIO */
> -- 
> 1.7.0.4
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] spi, serial: move to dma_transfer_direction
  2011-10-15 19:00   ` Mika Westerberg
@ 2011-10-16  8:01     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-16  8:01 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Grant Likely, Alan Cox

On Sat, 2011-10-15 at 22:00 +0300, Mika Westerberg wrote:
> On Fri, Oct 14, 2011 at 11:08:22AM +0530, Vinod Koul wrote:
> 
> > diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> > index 1cf6454..8754a39 100644
> > --- a/drivers/spi/spi-ep93xx.c
> > +++ b/drivers/spi/spi-ep93xx.c
> > @@ -550,6 +550,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  	struct dma_async_tx_descriptor *txd;
> >  	enum dma_slave_buswidth buswidth;
> >  	struct dma_slave_config conf;
> > +	enum dma_transfer_direction slave_dirn;
> >  	struct scatterlist *sg;
> >  	struct sg_table *sgt;
> >  	struct dma_chan *chan;
> > @@ -572,6 +573,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  
> >  		conf.src_addr = espi->sspdr_phys;
> >  		conf.src_addr_width = buswidth;
> > +		slave_dirn = DEV_TO_MEM;
> >  	} else {
> >  		chan = espi->dma_tx;
> >  		buf = t->tx_buf;
> > @@ -579,6 +581,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  
> >  		conf.dst_addr = espi->sspdr_phys;
> >  		conf.dst_addr_width = buswidth;
> > +		slave_dirn = MEM_TO_DEV;
> >  	}
> >  
> >  	ret = dmaengine_slave_config(chan, &conf);
> > @@ -630,7 +633,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir)
> >  		return ERR_PTR(-ENOMEM);
> >  
> >  	txd = chan->device->device_prep_slave_sg(chan, sgt->sgl, nents,
> > -						 dir, DMA_CTRL_ACK);
> > +						 slave_dirn, DMA_CTRL_ACK);
> >  	if (!txd) {
> >  		dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
> >  		return ERR_PTR(-ENOMEM);
> 
> Can you also change the ep93xx_spi_setup_dma() function to use these new
> values? Like the patch below.
> 
> Otherwise,
> 
> Acked-by: Mika Westerberg <mika.westerberg@iki.fi>
Thanks, I will add the below patche as well.

> 
> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index 66c3d9b..d97583f 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -982,7 +982,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
>  	dma_cap_set(DMA_SLAVE, mask);
>  
>  	espi->dma_rx_data.port = EP93XX_DMA_SSP;
> -	espi->dma_rx_data.direction = DMA_FROM_DEVICE;
> +	espi->dma_rx_data.direction = DEV_TO_MEM;
>  	espi->dma_rx_data.name = "ep93xx-spi-rx";
>  
>  	espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter,
> @@ -993,7 +993,7 @@ static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
>  	}
>  
>  	espi->dma_tx_data.port = EP93XX_DMA_SSP;
> -	espi->dma_tx_data.direction = DMA_TO_DEVICE;
> +	espi->dma_tx_data.direction = MEM_TO_DEV;
>  	espi->dma_tx_data.name = "ep93xx-spi-tx";
>  
>  	espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter,


-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] spi, serial: move to dma_transfer_direction
  2011-10-16  4:21   ` Grant Likely
@ 2011-10-16  8:03     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-16  8:03 UTC (permalink / raw)
  To: Grant Likely
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk, Alan Cox

On Sat, 2011-10-15 at 22:21 -0600, Grant Likely wrote:
> On Fri, Oct 14, 2011 at 11:08:22AM +0530, Vinod Koul wrote:
> > From: Vinod Koul <vinod.koul@linux.intel.com>
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Alan Cox <alan@linux.intel.com>
> 
> This looks okay to me.  What tree does it need to be merged through?
Can you pls send you formal ack

I plan to take this entire series thru slave-dma tree.

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
  2011-10-15 19:02   ` Mika Westerberg
@ 2011-10-16 11:02   ` Linus Walleij
  2011-10-17  5:28   ` Viresh Kumar
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 52+ messages in thread
From: Linus Walleij @ 2011-10-16 11:02 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Viresh Kumar, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

2011/10/14 Vinod Koul <vinod.koul@intel.com>:

Looks like the right thing to do following the recent sematic discussions,
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
  2011-10-15 19:02   ` Mika Westerberg
  2011-10-16 11:02   ` Linus Walleij
@ 2011-10-17  5:28   ` Viresh Kumar
  2011-10-17 13:15     ` Vinod Koul
  2011-10-17  9:58   ` Nicolas Ferre
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 52+ messages in thread
From: Viresh Kumar @ 2011-10-17  5:28 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Linus Walleij, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

On 10/14/2011 11:08 AM, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Mika Westerberg <mika.westerberg@iki.fi>
> Cc: H Hartley Sweeten <hartleys@visionengravers.com>
> Cc: Li Yang <leoli@freescale.com>
> Cc: Zhang Wei <zw@zh-kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> Cc: Yong Wang <yong.y.wang@intel.com>
> Cc: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
> Cc: Boojin Kim <boojin.kim@samsung.com>
> Cc: Barry Song <Baohua.Song@csr.com>
> ---
>  arch/arm/mach-ep93xx/include/mach/dma.h        |    6 ++--
>  arch/arm/plat-nomadik/include/plat/ste_dma40.h |    4 +-
>  drivers/dma/amba-pl08x.c                       |   24 +++++++++++-----------
>  drivers/dma/at_hdmac.c                         |   22 ++++++++++----------
>  drivers/dma/coh901318.c                        |   12 +++++-----
>  drivers/dma/coh901318_lli.c                    |   23 ++++++++++-----------
>  drivers/dma/coh901318_lli.h                    |    4 +-
>  drivers/dma/dw_dmac.c                          |   14 ++++++------
>  drivers/dma/ep93xx_dma.c                       |   22 ++++++++++----------
>  drivers/dma/fsldma.c                           |    4 +-
>  drivers/dma/imx-dma.c                          |   10 ++++----
>  drivers/dma/imx-sdma.c                         |   10 ++++----
>  drivers/dma/intel_mid_dma.c                    |   14 ++++++------
>  drivers/dma/intel_mid_dma_regs.h               |    2 +-
>  drivers/dma/ipu/ipu_idmac.c                    |    4 +-
>  drivers/dma/mxs-dma.c                          |    8 +++---
>  drivers/dma/pch_dma.c                          |   12 +++++-----
>  drivers/dma/pl330.c                            |   18 ++++++++--------
>  drivers/dma/shdma.c                            |   25 +++++++++++------------
>  drivers/dma/ste_dma40.c                        |   26 ++++++++++++------------
>  drivers/dma/timb_dma.c                         |   18 ++++++++--------
>  drivers/dma/txx9dmac.c                         |   12 +++++-----
>  include/linux/amba/pl08x.h                     |    4 +-
>  include/linux/dw_dmac.h                        |    2 +-
>  include/linux/sh_dma.h                         |    2 +-
>  25 files changed, 150 insertions(+), 152 deletions(-)

For amba-pl08x and dw_dmac:

Acked-by: Viresh Kumar <viresh.kumar@st.com>

Can you please add something in the commit message, to explain why is it done.

-- 
viresh

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/10] mmc-host: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 06/10] mmc-host: " Vinod Koul
@ 2011-10-17  9:56   ` Nicolas Ferre
  2011-10-17 12:59   ` Guennadi Liakhovetski
  1 sibling, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2011-10-17  9:56 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Chris Ball, Guennadi Liakhovetski

On 10/14/2011 07:38 AM, Vinod Koul :
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/mmc/host/atmel-mci.c    |    9 ++++++---

[..]

> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -681,16 +681,19 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
>  	if (atmci_is_mci2())
>  		mci_writel(host, DMA, MCI_DMA_CHKSIZE(3) | MCI_DMAEN);
>  
> -	if (data->flags & MMC_DATA_READ)
> +	if (data->flags & MMC_DATA_READ) {
>  		direction = DMA_FROM_DEVICE;
> -	else
> +		slave_dirn = DEV_TO_MEM;

It seems that the slave_dirn declaration is missing...

> +	} else {
>  		direction = DMA_TO_DEVICE;
> +		slave_dirn = MEM_TO_DEV;
> +	}
>  
>  	sglen = dma_map_sg(chan->device->dev, data->sg,
>  			   data->sg_len, direction);
>  
>  	desc = chan->device->device_prep_slave_sg(chan,
> -			data->sg, sglen, direction,
> +			data->sg, sglen, slave_dirn,
>  			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc)
>  		goto unmap_exit;

When fixed:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Best regards,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
                     ` (2 preceding siblings ...)
  2011-10-17  5:28   ` Viresh Kumar
@ 2011-10-17  9:58   ` Nicolas Ferre
  2011-10-17 12:52   ` Guennadi Liakhovetski
  2011-11-21 12:20   ` Dan Carpenter
  5 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2011-10-17  9:58 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Viresh Kumar, Linus Walleij,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

On 10/14/2011 07:38 AM, Vinod Koul :
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

[..]

> index fcfa0a8..7968a81 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -660,7 +660,7 @@ err_desc_get:
>   */
>  static struct dma_async_tx_descriptor *
>  atc_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 at_dma_chan	*atchan = to_at_dma_chan(chan);
> @@ -678,7 +678,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  
>  	dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n",
>  			sg_len,
> -			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
> +			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
>  			flags);
>  
>  	if (unlikely(!atslave || !sg_len)) {
> @@ -692,7 +692,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  	ctrlb = ATC_IEN;
>  
>  	switch (direction) {
> -	case DMA_TO_DEVICE:
> +	case MEM_TO_DEV:
>  		ctrla |=  ATC_DST_WIDTH(reg_width);
>  		ctrlb |=  ATC_DST_ADDR_MODE_FIXED
>  			| ATC_SRC_ADDR_MODE_INCR
> @@ -725,7 +725,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  			total_len += len;
>  		}
>  		break;
> -	case DMA_FROM_DEVICE:
> +	case DEV_TO_MEM:
>  		ctrla |=  ATC_SRC_WIDTH(reg_width);
>  		ctrlb |=  ATC_DST_ADDR_MODE_INCR
>  			| ATC_SRC_ADDR_MODE_FIXED
> @@ -787,7 +787,7 @@ err_desc_get:
>   */
>  static int
>  atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
> -		size_t period_len, enum dma_data_direction direction)
> +		size_t period_len, enum dma_transfer_direction direction)
>  {
>  	if (period_len > (ATC_BTSIZE_MAX << reg_width))
>  		goto err_out;
> @@ -795,7 +795,7 @@ atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
>  		goto err_out;
>  	if (unlikely(buf_addr & ((1 << reg_width) - 1)))
>  		goto err_out;
> -	if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE))))
> +	if (unlikely(!(direction & (DEV_TO_MEM | MEM_TO_DEV))))
>  		goto err_out;
>  
>  	return 0;
> @@ -810,7 +810,7 @@ err_out:
>  static int
>  atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  		unsigned int period_index, dma_addr_t buf_addr,
> -		size_t period_len, enum dma_data_direction direction)
> +		size_t period_len, enum dma_transfer_direction direction)
>  {
>  	u32		ctrla;
>  	unsigned int	reg_width = atslave->reg_width;
> @@ -822,7 +822,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  		| period_len >> reg_width;
>  
>  	switch (direction) {
> -	case DMA_TO_DEVICE:
> +	case MEM_TO_DEV:
>  		desc->lli.saddr = buf_addr + (period_len * period_index);
>  		desc->lli.daddr = atslave->tx_reg;
>  		desc->lli.ctrla = ctrla;
> @@ -833,7 +833,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>  				| ATC_DIF(AT_DMA_PER_IF);
>  		break;
>  
> -	case DMA_FROM_DEVICE:
> +	case DEV_TO_MEM:
>  		desc->lli.saddr = atslave->rx_reg;
>  		desc->lli.daddr = buf_addr + (period_len * period_index);
>  		desc->lli.ctrla = ctrla;
> @@ -861,7 +861,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
>   */
>  static struct dma_async_tx_descriptor *
>  atc_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)
>  {
>  	struct at_dma_chan	*atchan = to_at_dma_chan(chan);
>  	struct at_dma_slave	*atslave = chan->private;
> @@ -872,7 +872,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
>  	unsigned int		i;
>  
>  	dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n",
> -			direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE",
> +			direction == MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
>  			buf_addr,
>  			periods, buf_len, period_len);
>  

For at_hdmac (Atmel DMA controller)

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Best regards,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
                     ` (3 preceding siblings ...)
  2011-10-17  9:58   ` Nicolas Ferre
@ 2011-10-17 12:52   ` Guennadi Liakhovetski
  2011-10-18  2:48     ` Vinod Koul
  2011-10-27 16:56     ` Vinod Koul
  2011-11-21 12:20   ` Dan Carpenter
  5 siblings, 2 replies; 52+ messages in thread
From: Guennadi Liakhovetski @ 2011-10-17 12:52 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Viresh Kumar, Linus Walleij,
	Nicolas Ferre, Mika Westerberg, H Hartley Sweeten, Li Yang,
	Zhang Wei, Sascha Hauer, Shawn Guo, Yong Wang, Tomoya MORINAGA,
	Boojin Kim, Barry Song

A general note to this rework. I haven't been cc'ed on patch 00/10, so, 
replying here. Are we sure it is a good idea to name these new macros like 
this:

MEM_TO_DEV,
DEV_TO_MEM,
...

i.e., without a common namespace? Wouldn't something like DMA_DIRECTION_* 
be better?

On Fri, 14 Oct 2011, Vinod Koul wrote:

> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Mika Westerberg <mika.westerberg@iki.fi>
> Cc: H Hartley Sweeten <hartleys@visionengravers.com>
> Cc: Li Yang <leoli@freescale.com>
> Cc: Zhang Wei <zw@zh-kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> Cc: Yong Wang <yong.y.wang@intel.com>
> Cc: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
> Cc: Boojin Kim <boojin.kim@samsung.com>
> Cc: Barry Song <Baohua.Song@csr.com>
> ---

[snip]

> diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
> index 81809c2..cab7d3e 100644
> --- a/drivers/dma/shdma.c
> +++ b/drivers/dma/shdma.c
> @@ -23,7 +23,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/dmaengine.h>
>  #include <linux/delay.h>
> -#include <linux/dma-mapping.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/sh_dma.h>
> @@ -479,19 +478,19 @@ static void sh_dmae_free_chan_resources(struct dma_chan *chan)
>   * @sh_chan:	DMA channel
>   * @flags:	DMA transfer flags
>   * @dest:	destination DMA address, incremented when direction equals
> - *		DMA_FROM_DEVICE or DMA_BIDIRECTIONAL
> + *		DEV_TO_MEM
>   * @src:	source DMA address, incremented when direction equals
> - *		DMA_TO_DEVICE or DMA_BIDIRECTIONAL
> + *		MEM_TO_DEV

Why have you changed the above two comments? Doesn't seem correct to me.

>   * @len:	DMA transfer length
>   * @first:	if NULL, set to the current descriptor and cookie set to -EBUSY
>   * @direction:	needed for slave DMA to decide which address to keep constant,
> - *		equals DMA_BIDIRECTIONAL for MEMCPY
> + *		equals MEM_TO_MEM for MEMCPY
>   * Returns 0 or an error
>   * Locks: called with desc_lock held
>   */
>  static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
>  	unsigned long flags, dma_addr_t *dest, dma_addr_t *src, size_t *len,
> -	struct sh_desc **first, enum dma_data_direction direction)
> +	struct sh_desc **first, enum dma_transfer_direction direction)
>  {
>  	struct sh_desc *new;
>  	size_t copy_size;
> @@ -531,9 +530,9 @@ static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
>  	new->direction = direction;
>  
>  	*len -= copy_size;
> -	if (direction == DMA_BIDIRECTIONAL || direction == DMA_TO_DEVICE)
> +	if (direction == MEM_TO_MEM || direction == MEM_TO_DEV)
>  		*src += copy_size;
> -	if (direction == DMA_BIDIRECTIONAL || direction == DMA_FROM_DEVICE)
> +	if (direction == MEM_TO_MEM || direction == DEV_TO_MEM)
>  		*dest += copy_size;
>  
>  	return new;
> @@ -546,12 +545,12 @@ static struct sh_desc *sh_dmae_add_desc(struct sh_dmae_chan *sh_chan,
>   * converted to scatter-gather to guarantee consistent locking and a correct
>   * list manipulation. For slave DMA direction carries the usual meaning, and,
>   * logically, the SG list is RAM and the addr variable contains slave address,
> - * e.g., the FIFO I/O register. For MEMCPY direction equals DMA_BIDIRECTIONAL
> + * e.g., the FIFO I/O register. For MEMCPY direction equals MEM_TO_MEM
>   * and the SG list contains only one element and points at the source buffer.
>   */
>  static struct dma_async_tx_descriptor *sh_dmae_prep_sg(struct sh_dmae_chan *sh_chan,
>  	struct scatterlist *sgl, unsigned int sg_len, dma_addr_t *addr,
> -	enum dma_data_direction direction, unsigned long flags)
> +	enum dma_transfer_direction direction, unsigned long flags)
>  {
>  	struct scatterlist *sg;
>  	struct sh_desc *first = NULL, *new = NULL /* compiler... */;
> @@ -592,7 +591,7 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_sg(struct sh_dmae_chan *sh_c
>  			dev_dbg(sh_chan->dev, "Add SG #%d@%p[%d], dma %llx\n",
>  				i, sg, len, (unsigned long long)sg_addr);
>  
> -			if (direction == DMA_FROM_DEVICE)
> +			if (direction == DEV_TO_MEM)
>  				new = sh_dmae_add_desc(sh_chan, flags,
>  						&sg_addr, addr, &len, &first,
>  						direction);
> @@ -646,13 +645,13 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_memcpy(
>  	sg_dma_address(&sg) = dma_src;
>  	sg_dma_len(&sg) = len;
>  
> -	return sh_dmae_prep_sg(sh_chan, &sg, 1, &dma_dest, DMA_BIDIRECTIONAL,
> +	return sh_dmae_prep_sg(sh_chan, &sg, 1, &dma_dest, MEM_TO_MEM,
>  			       flags);
>  }
>  
>  static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg(
>  	struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len,
> -	enum dma_data_direction direction, unsigned long flags)
> +	enum dma_transfer_direction direction, unsigned long flags)
>  {
>  	struct sh_dmae_slave *param;
>  	struct sh_dmae_chan *sh_chan;
> @@ -996,7 +995,7 @@ static void dmae_do_tasklet(unsigned long data)
>  	spin_lock_irq(&sh_chan->desc_lock);
>  	list_for_each_entry(desc, &sh_chan->ld_queue, node) {
>  		if (desc->mark == DESC_SUBMITTED &&
> -		    ((desc->direction == DMA_FROM_DEVICE &&
> +		    ((desc->direction == DEV_TO_MEM &&
>  		      (desc->hw.dar + desc->hw.tcr) == dar_buf) ||
>  		     (desc->hw.sar + desc->hw.tcr) == sar_buf)) {
>  			dev_dbg(sh_chan->dev, "done #%d@%p dst %u\n",

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 04/10] media-video: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 04/10] media-video: " Vinod Koul
@ 2011-10-17 12:52   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 52+ messages in thread
From: Guennadi Liakhovetski @ 2011-10-17 12:52 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Mauro Carvalho Chehab, Paul Mundt

This patch is not purely media/video:

On Fri, 14 Oct 2011, Vinod Koul wrote:

> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/media/video/mx3_camera.c |    2 +-
>  drivers/media/video/timblogiw.c  |    2 +-
>  drivers/video/mx3fb.c            |    4 ++--

This is a framebuffer driver, as such it has nothing to do with the media 
/ v4l subsystem, it just happens to use the same dmaengine driver, as 
mx3_camera. Not sure if you want to split this patch, or at least adjust 
its description.

As for the contents: for mx3_camera and mx3fb:

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks
Guennadi

>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
> index c045b47..b6ac932 100644
> --- a/drivers/media/video/mx3_camera.c
> +++ b/drivers/media/video/mx3_camera.c
> @@ -251,7 +251,7 @@ static int mx3_videobuf_prepare(struct vb2_buffer *vb)
>  		sg_dma_len(sg)		= new_size;
>  
>  		buf->txd = ichan->dma_chan.device->device_prep_slave_sg(
> -			&ichan->dma_chan, sg, 1, DMA_FROM_DEVICE,
> +			&ichan->dma_chan, sg, 1, DEV_TO_MEM,
>  			DMA_PREP_INTERRUPT);
>  		if (!buf->txd)
>  			return -EIO;
> diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
> index 84cd1b6..1940d47 100644
> --- a/drivers/media/video/timblogiw.c
> +++ b/drivers/media/video/timblogiw.c
> @@ -564,7 +564,7 @@ static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
>  	spin_unlock_irq(&fh->queue_lock);
>  
>  	desc = fh->chan->device->device_prep_slave_sg(fh->chan,
> -		buf->sg, sg_elems, DMA_FROM_DEVICE,
> +		buf->sg, sg_elems, DEV_TO_MEM,
>  		DMA_PREP_INTERRUPT | DMA_COMPL_SKIP_SRC_UNMAP);
>  	if (!desc) {
>  		spin_lock_irq(&fh->queue_lock);
> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
> index 7e3a490..7b0232f 100644
> --- a/drivers/video/mx3fb.c
> +++ b/drivers/video/mx3fb.c
> @@ -334,7 +334,7 @@ static void sdc_enable_channel(struct mx3fb_info *mx3_fbi)
>  	/* This enables the channel */
>  	if (mx3_fbi->cookie < 0) {
>  		mx3_fbi->txd = dma_chan->device->device_prep_slave_sg(dma_chan,
> -		      &mx3_fbi->sg[0], 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT);
> +		      &mx3_fbi->sg[0], 1, MEM_TO_DEV, DMA_PREP_INTERRUPT);
>  		if (!mx3_fbi->txd) {
>  			dev_err(mx3fb->dev, "Cannot allocate descriptor on %d\n",
>  				dma_chan->chan_id);
> @@ -1104,7 +1104,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
>  		async_tx_ack(mx3_fbi->txd);
>  
>  	txd = dma_chan->device->device_prep_slave_sg(dma_chan, sg +
> -		mx3_fbi->cur_ipu_buf, 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT);
> +		mx3_fbi->cur_ipu_buf, 1, MEM_TO_DEV, DMA_PREP_INTERRUPT);
>  	if (!txd) {
>  		dev_err(fbi->device,
>  			"Error preparing a DMA transaction descriptor.\n");
> -- 
> 1.7.0.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/10] mmc-host: move to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 06/10] mmc-host: " Vinod Koul
  2011-10-17  9:56   ` Nicolas Ferre
@ 2011-10-17 12:59   ` Guennadi Liakhovetski
  1 sibling, 0 replies; 52+ messages in thread
From: Guennadi Liakhovetski @ 2011-10-17 12:59 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Nicolas Ferre, Chris Ball

On Fri, 14 Oct 2011, Vinod Koul wrote:

> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

For sh_mmcifsh_mmcif and tmio_mmc_dma:

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

(of course, the macro naming comment still holds)

Thanks
Guennadi

> ---
>  drivers/mmc/host/atmel-mci.c    |    9 ++++++---
>  drivers/mmc/host/mmci.c         |   11 +++++++----
>  drivers/mmc/host/mxcmmc.c       |   10 +++++++---
>  drivers/mmc/host/mxs-mmc.c      |    7 ++++++-
>  drivers/mmc/host/sh_mmcif.c     |    4 ++--
>  drivers/mmc/host/tmio_mmc_dma.c |    4 ++--
>  6 files changed, 30 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index fa8cae1..7c9d28a 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -681,16 +681,19 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
>  	if (atmci_is_mci2())
>  		mci_writel(host, DMA, MCI_DMA_CHKSIZE(3) | MCI_DMAEN);
>  
> -	if (data->flags & MMC_DATA_READ)
> +	if (data->flags & MMC_DATA_READ) {
>  		direction = DMA_FROM_DEVICE;
> -	else
> +		slave_dirn = DEV_TO_MEM;
> +	} else {
>  		direction = DMA_TO_DEVICE;
> +		slave_dirn = MEM_TO_DEV;
> +	}
>  
>  	sglen = dma_map_sg(chan->device->dev, data->sg,
>  			   data->sg_len, direction);
>  
>  	desc = chan->device->device_prep_slave_sg(chan,
> -			data->sg, sglen, direction,
> +			data->sg, sglen, slave_dirn,
>  			DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	if (!desc)
>  		goto unmap_exit;
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 56e9a41..efbc743 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -372,6 +372,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
>  	struct dma_chan *chan;
>  	struct dma_device *device;
>  	struct dma_async_tx_descriptor *desc;
> +	enum dma_data_direction buffer_dirn;
>  	int nr_sg;
>  
>  	/* Check if next job is already prepared */
> @@ -385,10 +386,12 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
>  	}
>  
>  	if (data->flags & MMC_DATA_READ) {
> -		conf.direction = DMA_FROM_DEVICE;
> +		conf.direction = DEV_TO_MEM;
> +		buffer_dirn = DMA_FROM_DEVICE;
>  		chan = host->dma_rx_channel;
>  	} else {
> -		conf.direction = DMA_TO_DEVICE;
> +		conf.direction = MEM_TO_DEV;
> +		buffer_dirn = DMA_TO_DEVICE;
>  		chan = host->dma_tx_channel;
>  	}
>  
> @@ -401,7 +404,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
>  		return -EINVAL;
>  
>  	device = chan->device;
> -	nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, conf.direction);
> +	nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
>  	if (nr_sg == 0)
>  		return -EINVAL;
>  
> @@ -424,7 +427,7 @@ static int mmci_dma_prep_data(struct mmci_host *host, struct mmc_data *data,
>   unmap_exit:
>  	if (!next)
>  		dmaengine_terminate_all(chan);
> -	dma_unmap_sg(device->dev, data->sg, data->sg_len, conf.direction);
> +	dma_unmap_sg(device->dev, data->sg, data->sg_len, buffer_dirn);
>  	return -ENOMEM;
>  }
>  
> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index 14aa213..4115108 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
> @@ -217,6 +217,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
>  	unsigned int blksz = data->blksz;
>  	unsigned int datasize = nob * blksz;
>  	struct scatterlist *sg;
> +	enum dma_transfer_direction slave_dirn;
>  	int i, nents;
>  
>  	if (data->flags & MMC_DATA_STREAM)
> @@ -239,10 +240,13 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
>  		}
>  	}
>  
> -	if (data->flags & MMC_DATA_READ)
> +	if (data->flags & MMC_DATA_READ) {
>  		host->dma_dir = DMA_FROM_DEVICE;
> -	else
> +		slave_dirn = DEV_TO_MEM;
> +	} else {
>  		host->dma_dir = DMA_TO_DEVICE;
> +		slave_dirn = MEM_TO_DEV;
> +	}
>  
>  	nents = dma_map_sg(host->dma->device->dev, data->sg,
>  				     data->sg_len,  host->dma_dir);
> @@ -250,7 +254,7 @@ static int mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
>  		return -EINVAL;
>  
>  	host->desc = host->dma->device->device_prep_slave_sg(host->dma,
> -		data->sg, data->sg_len, host->dma_dir,
> +		data->sg, data->sg_len, slave_dirn,
>  		DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  
>  	if (!host->desc) {
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index d513d47..c0a3def 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -153,6 +153,7 @@ struct mxs_mmc_host {
>  	struct dma_chan         	*dmach;
>  	struct mxs_dma_data		dma_data;
>  	unsigned int			dma_dir;
> +	enum dma_transfer_direction	slave_dirn;
>  	u32				ssp_pio_words[SSP_PIO_NUM];
>  
>  	unsigned int			version;
> @@ -323,7 +324,7 @@ static struct dma_async_tx_descriptor *mxs_mmc_prep_dma(
>  	}
>  
>  	desc = host->dmach->device->device_prep_slave_sg(host->dmach,
> -				sgl, sg_len, host->dma_dir, append);
> +				sgl, sg_len, host->slave_dirn, append);
>  	if (desc) {
>  		desc->callback = mxs_mmc_dma_irq_callback;
>  		desc->callback_param = host;
> @@ -432,6 +433,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
>  	int i;
>  
>  	unsigned short dma_data_dir, timeout;
> +	enum dma_transfer_direction slave_dirn;
>  	unsigned int data_size = 0, log2_blksz;
>  	unsigned int blocks = data->blocks;
>  
> @@ -447,9 +449,11 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
>  
>  	if (data->flags & MMC_DATA_WRITE) {
>  		dma_data_dir = DMA_TO_DEVICE;
> +		slave_dirn = MEM_TO_DEV;
>  		read = 0;
>  	} else {
>  		dma_data_dir = DMA_FROM_DEVICE;
> +		slave_dirn = DEV_TO_MEM;
>  		read = BM_SSP_CTRL0_READ;
>  	}
>  
> @@ -517,6 +521,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
>  	WARN_ON(host->data != NULL);
>  	host->data = data;
>  	host->dma_dir = dma_data_dir;
> +	host->slave_dirn = slave_dirn;
>  	desc = mxs_mmc_prep_dma(host, 1);
>  	if (!desc)
>  		goto out;
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 557886b..7a374c9 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -230,7 +230,7 @@ static void sh_mmcif_start_dma_rx(struct sh_mmcif_host *host)
>  	if (ret > 0) {
>  		host->dma_active = true;
>  		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
> -			DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +			DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	}
>  
>  	if (desc) {
> @@ -278,7 +278,7 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host)
>  	if (ret > 0) {
>  		host->dma_active = true;
>  		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
> -			DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> +			MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>  	}
>  
>  	if (desc) {
> diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
> index 86f259c..663624c 100644
> --- a/drivers/mmc/host/tmio_mmc_dma.c
> +++ b/drivers/mmc/host/tmio_mmc_dma.c
> @@ -77,7 +77,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
>  	ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
>  	if (ret > 0)
>  		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
> -			DMA_FROM_DEVICE, DMA_CTRL_ACK);
> +			DEV_TO_MEM, DMA_CTRL_ACK);
>  
>  	if (desc) {
>  		cookie = dmaengine_submit(desc);
> @@ -158,7 +158,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
>  	ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
>  	if (ret > 0)
>  		desc = chan->device->device_prep_slave_sg(chan, sg, ret,
> -			DMA_TO_DEVICE, DMA_CTRL_ACK);
> +			MEM_TO_DEV, DMA_CTRL_ACK);
>  
>  	if (desc) {
>  		cookie = dmaengine_submit(desc);
> -- 
> 1.7.0.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-17  5:28   ` Viresh Kumar
@ 2011-10-17 13:15     ` Vinod Koul
  2011-10-18  9:06       ` Viresh Kumar
  0 siblings, 1 reply; 52+ messages in thread
From: Vinod Koul @ 2011-10-17 13:15 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Russell King, Linus Walleij, Nicolas Ferre, Mika Westerberg,
	H Hartley Sweeten, Li Yang, Zhang Wei, Sascha Hauer,
	Guennadi Liakhovetski, Shawn Guo, Yong Wang, Tomoya MORINAGA,
	Boojin Kim, Barry Song

On Mon, 2011-10-17 at 10:58 +0530, Viresh Kumar wrote:
> For amba-pl08x and dw_dmac:
> 
> Acked-by: Viresh Kumar <viresh.kumar@st.com>
Thanks
> 
> Can you please add something in the commit message, to explain why is
> it done.
I think 01/10 explains it well

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-17 12:52   ` Guennadi Liakhovetski
@ 2011-10-18  2:48     ` Vinod Koul
  2011-10-27 16:56     ` Vinod Koul
  1 sibling, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-18  2:48 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Russell King, Viresh Kumar, Linus Walleij, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Shawn Guo, Yong Wang, Tomoya MORINAGA, Boojin Kim,
	Barry Song

On Mon, 2011-10-17 at 14:52 +0200, Guennadi Liakhovetski wrote:
> A general note to this rework. I haven't been cc'ed on patch 00/10,
> so, 
> replying here. Are we sure it is a good idea to name these new macros
> like 
> this:
> 
> MEM_TO_DEV,
> DEV_TO_MEM,
> ...
> 
> i.e., without a common namespace? Wouldn't something like
> DMA_DIRECTION_* 
> be better? 
Yes makes sense. I am leaning towards DMA_*

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-17 13:15     ` Vinod Koul
@ 2011-10-18  9:06       ` Viresh Kumar
  0 siblings, 0 replies; 52+ messages in thread
From: Viresh Kumar @ 2011-10-18  9:06 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Russell King, Linus Walleij, Nicolas Ferre, Mika Westerberg,
	H Hartley Sweeten, Li Yang, Zhang Wei, Sascha Hauer,
	Guennadi Liakhovetski, Shawn Guo, Yong Wang, Tomoya MORINAGA,
	Boojin Kim, Barry Song

On 10/17/2011 6:45 PM, Vinod Koul wrote:
>> > Can you please add something in the commit message, to explain why is
>> > it done.
> I think 01/10 explains it well

Ok. I wasn't in cc of that patch, so couldn't link it. But still
i think every patch should have some sort of explanation or link to another patch
that explains why is it done. Isn't it?

-- 
viresh

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-17 12:52   ` Guennadi Liakhovetski
  2011-10-18  2:48     ` Vinod Koul
@ 2011-10-27 16:56     ` Vinod Koul
  1 sibling, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-10-27 16:56 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Russell King, Viresh Kumar, Linus Walleij, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Shawn Guo, Yong Wang, Tomoya MORINAGA, Boojin Kim,
	Barry Song

On Mon, 2011-10-17 at 14:52 +0200, Guennadi Liakhovetski wrote:

Sorry for replying late...
> > diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
> > index 81809c2..cab7d3e 100644
> > --- a/drivers/dma/shdma.c
> > +++ b/drivers/dma/shdma.c
> > @@ -23,7 +23,6 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/dmaengine.h>
> >  #include <linux/delay.h>
> > -#include <linux/dma-mapping.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/pm_runtime.h>
> >  #include <linux/sh_dma.h>
> > @@ -479,19 +478,19 @@ static void sh_dmae_free_chan_resources(struct
> dma_chan *chan)
> >   * @sh_chan: DMA channel
> >   * @flags:   DMA transfer flags
> >   * @dest:    destination DMA address, incremented when direction
> equals
> > - *           DMA_FROM_DEVICE or DMA_BIDIRECTIONAL
> > + *           DEV_TO_MEM
> >   * @src:     source DMA address, incremented when direction equals
> > - *           DMA_TO_DEVICE or DMA_BIDIRECTIONAL
> > + *           MEM_TO_DEV
> 
> Why have you changed the above two comments? Doesn't seem correct to
> me. 
No this is the right comment.

After the direction flag changes, the sh_dmae_add_desc will take new
flags for direction. The valid flags would be DEV_TO_MEM and
DEV_TO_DEVICE only.

-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-10-14 16:39 ` [PATCH v2 1/2] USB-musb: " Vinod Koul
@ 2011-11-08 14:02   ` Felipe Balbi
  2011-11-08 14:07     ` Felipe Balbi
  2011-11-09  6:09   ` Felipe Balbi
  1 sibling, 1 reply; 52+ messages in thread
From: Felipe Balbi @ 2011-11-08 14:02 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Felipe Balbi, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

On Fri, Oct 14, 2011 at 10:09:09PM +0530, Vinod Koul wrote:
> fixup usage of dma direction by introducing dma_transfer_direction,
> this patch moves usb/musb driver to use new enum
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

applied, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/2] USB-renesas: move to dma_transfer_direction
  2011-10-14 16:39 ` [PATCH 2/2] USB-renesas: " Vinod Koul
@ 2011-11-08 14:02   ` Felipe Balbi
  2011-11-09  6:10   ` Felipe Balbi
  1 sibling, 0 replies; 52+ messages in thread
From: Felipe Balbi @ 2011-11-08 14:02 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Felipe Balbi, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 360 bytes --]

On Fri, Oct 14, 2011 at 10:09:10PM +0530, Vinod Koul wrote:
> fixup usage of dma direction by introducing dma_transfer_direction,
> this patch moves usb/renesas driver to use new enum
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

applied, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-11-08 14:02   ` Felipe Balbi
@ 2011-11-08 14:07     ` Felipe Balbi
  2011-11-08 16:12       ` Vinod Koul
  0 siblings, 1 reply; 52+ messages in thread
From: Felipe Balbi @ 2011-11-08 14:07 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Vinod Koul, dan.j.williams, linux-kernel, jaswinder.singh,
	21cnbao, rmk, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On Tue, Nov 08, 2011 at 04:02:25PM +0200, Felipe Balbi wrote:
> On Fri, Oct 14, 2011 at 10:09:09PM +0530, Vinod Koul wrote:
> > fixup usage of dma direction by introducing dma_transfer_direction,
> > this patch moves usb/musb driver to use new enum
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> applied, thanks

I replied too early, this breaks compilation. Please review both
patches, compile test them at least, and resend Ccing linux-usb and the
maintainers of musb (myself) and Renesas... to make it easier, run
scripts/get_maintainer.pl on both patches.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-11-08 14:07     ` Felipe Balbi
@ 2011-11-08 16:12       ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-11-08 16:12 UTC (permalink / raw)
  To: balbi
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Greg Kroah-Hartman

On Tue, 2011-11-08 at 16:07 +0200, Felipe Balbi wrote:
> On Tue, Nov 08, 2011 at 04:02:25PM +0200, Felipe Balbi wrote:
> > On Fri, Oct 14, 2011 at 10:09:09PM +0530, Vinod Koul wrote:
> > > fixup usage of dma direction by introducing dma_transfer_direction,
> > > this patch moves usb/musb driver to use new enum
> > > 
> > > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > > Cc: Felipe Balbi <balbi@ti.com>
> > > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> > 
> > applied, thanks
> 
> I replied too early, this breaks compilation. Please review both
> patches, compile test them at least, and resend Ccing linux-usb and the
> maintainers of musb (myself) and Renesas... to make it easier, run
> scripts/get_maintainer.pl on both patches.
These cant be applied individually as they depends on 1/10 of v1 I had
sent across, that explains your compilation failure.

If you are fine with this, please ACK it and I can carry these thru
slave-dmaengine tree


-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-10-14 16:39 ` [PATCH v2 1/2] USB-musb: " Vinod Koul
  2011-11-08 14:02   ` Felipe Balbi
@ 2011-11-09  6:09   ` Felipe Balbi
  2011-11-09  8:38     ` Mian Yousaf Kaukab
  1 sibling, 1 reply; 52+ messages in thread
From: Felipe Balbi @ 2011-11-09  6:09 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Felipe Balbi, Greg Kroah-Hartman, Mian Yousaf Kaukab

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

On Fri, Oct 14, 2011 at 10:09:09PM +0530, Vinod Koul wrote:
> fixup usage of dma direction by introducing dma_transfer_direction,
> this patch moves usb/musb driver to use new enum
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

This looks ok to me:

Acked-by: Felipe Balbi <balbi@ti.com>

Mian, if you agree with this patch, please reply with your Acked-by

> ---
> v2: split the usb patch into two patches
>     fix the error of direction variable
> 
>  drivers/usb/musb/ux500_dma.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
> index ef4333f..d5b5262 100644
> --- a/drivers/usb/musb/ux500_dma.c
> +++ b/drivers/usb/musb/ux500_dma.c
> @@ -112,7 +112,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
>  	struct musb_hw_ep *hw_ep = ux500_channel->hw_ep;
>  	struct dma_chan *dma_chan = ux500_channel->dma_chan;
>  	struct dma_async_tx_descriptor *dma_desc;
> -	enum dma_data_direction direction;
> +	enum dma_transfer_direction direction;
>  	struct scatterlist sg;
>  	struct dma_slave_config slave_conf;
>  	enum dma_slave_buswidth addr_width;
> @@ -132,7 +132,7 @@ static bool ux500_configure_channel(struct dma_channel *channel,
>  	sg_dma_address(&sg) = dma_addr;
>  	sg_dma_len(&sg) = len;
>  
> -	direction = ux500_channel->is_tx ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
> +	direction = ux500_channel->is_tx ? MEM_TO_DEV : DEV_TO_MEM;
>  	addr_width = (len & 0x3) ? DMA_SLAVE_BUSWIDTH_1_BYTE :
>  					DMA_SLAVE_BUSWIDTH_4_BYTES;
>  
> -- 
> 1.7.0.4
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/2] USB-renesas: move to dma_transfer_direction
  2011-10-14 16:39 ` [PATCH 2/2] USB-renesas: " Vinod Koul
  2011-11-08 14:02   ` Felipe Balbi
@ 2011-11-09  6:10   ` Felipe Balbi
  2011-11-10  0:06     ` Kuninori Morimoto
  2011-11-10  0:06     ` Kuninori Morimoto
  1 sibling, 2 replies; 52+ messages in thread
From: Felipe Balbi @ 2011-11-09  6:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Felipe Balbi, Greg Kroah-Hartman, Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

Hi,

On Fri, Oct 14, 2011 at 10:09:10PM +0530, Vinod Koul wrote:
> fixup usage of dma direction by introducing dma_transfer_direction,
> this patch moves usb/renesas driver to use new enum
> 
> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

This looks ok too:

Acked-by: Felipe Balbi <balbi@ti.com>

Kuninori-san, please have a look and reply with your Acked-by if you
think it's ok.

> ---
> v2: split the usb patch into two patches
> 
>  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
> index a34430f..f5bc370 100644
> --- a/drivers/usb/renesas_usbhs/fifo.c
> +++ b/drivers/usb/renesas_usbhs/fifo.c
> @@ -591,10 +591,10 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
>  	struct dma_async_tx_descriptor *desc;
>  	struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt);
>  	struct device *dev = usbhs_priv_to_dev(priv);
> -	enum dma_data_direction dir;
> +	enum dma_transfer_direction dir;
>  	dma_cookie_t cookie;
>  
> -	dir = usbhs_pipe_is_dir_in(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
> +	dir = usbhs_pipe_is_dir_in(pipe) ? DEV_TO_MEM : MEM_TO_DEV;
>  
>  	sg_init_table(&sg, 1);
>  	sg_set_page(&sg, virt_to_page(pkt->dma),
> -- 
> 1.7.0.4
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 1/2] USB-musb: move to dma_transfer_direction
  2011-11-09  6:09   ` Felipe Balbi
@ 2011-11-09  8:38     ` Mian Yousaf Kaukab
  0 siblings, 0 replies; 52+ messages in thread
From: Mian Yousaf Kaukab @ 2011-11-09  8:38 UTC (permalink / raw)
  To: balbi
  Cc: Vinod Koul, dan.j.williams, linux-kernel, jaswinder.singh,
	21cnbao, rmk, Greg Kroah-Hartman, linus.walleij

On 11/09/2011 07:09 AM, Felipe Balbi wrote:
> On Fri, Oct 14, 2011 at 10:09:09PM +0530, Vinod Koul wrote:
>> fixup usage of dma direction by introducing dma_transfer_direction,
>> this patch moves usb/musb driver to use new enum
>>
>> Signed-off-by: Vinod Koul<vinod.koul@linux.intel.com>
>> Cc: Felipe Balbi<balbi@ti.com>
>> Cc: Greg Kroah-Hartman<gregkh@suse.de>
> This looks ok to me:
>
> Acked-by: Felipe Balbi<balbi@ti.com>
>
> Mian, if you agree with this patch, please reply with your Acked-by

Looks ok to me as well:

Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>


Thanks,

-- 
Mian Yousaf Kaukab


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/2] USB-renesas: move to dma_transfer_direction
  2011-11-09  6:10   ` Felipe Balbi
@ 2011-11-10  0:06     ` Kuninori Morimoto
  2011-11-10  0:06     ` Kuninori Morimoto
  1 sibling, 0 replies; 52+ messages in thread
From: Kuninori Morimoto @ 2011-11-10  0:06 UTC (permalink / raw)
  To: balbi
  Cc: Vinod Koul, dan.j.williams, linux-kernel, jaswinder.singh,
	21cnbao, rmk, Greg Kroah-Hartman


Hi

> On Fri, Oct 14, 2011 at 10:09:10PM +0530, Vinod Koul wrote:
> > fixup usage of dma direction by introducing dma_transfer_direction,
> > this patch moves usb/renesas driver to use new enum
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> This looks ok too:
> 
> Acked-by: Felipe Balbi <balbi@ti.com>
> 
> Kuninori-san, please have a look and reply with your Acked-by if you
> think it's ok.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


> > ---
> > v2: split the usb patch into two patches
> > 
> >  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
> > index a34430f..f5bc370 100644
> > --- a/drivers/usb/renesas_usbhs/fifo.c
> > +++ b/drivers/usb/renesas_usbhs/fifo.c
> > @@ -591,10 +591,10 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
> >  	struct dma_async_tx_descriptor *desc;
> >  	struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt);
> >  	struct device *dev = usbhs_priv_to_dev(priv);
> > -	enum dma_data_direction dir;
> > +	enum dma_transfer_direction dir;
> >  	dma_cookie_t cookie;
> >  
> > -	dir = usbhs_pipe_is_dir_in(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
> > +	dir = usbhs_pipe_is_dir_in(pipe) ? DEV_TO_MEM : MEM_TO_DEV;
> >  
> >  	sg_init_table(&sg, 1);
> >  	sg_set_page(&sg, virt_to_page(pkt->dma),
> > -- 
> > 1.7.0.4
> > 
> 
> -- 
> balbi

Best regards
--
Kuninori Morimoto
 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 2/2] USB-renesas: move to dma_transfer_direction
  2011-11-09  6:10   ` Felipe Balbi
  2011-11-10  0:06     ` Kuninori Morimoto
@ 2011-11-10  0:06     ` Kuninori Morimoto
  1 sibling, 0 replies; 52+ messages in thread
From: Kuninori Morimoto @ 2011-11-10  0:06 UTC (permalink / raw)
  To: balbi
  Cc: Vinod Koul, dan.j.williams, linux-kernel, jaswinder.singh,
	21cnbao, rmk, Greg Kroah-Hartman


Hi

> On Fri, Oct 14, 2011 at 10:09:10PM +0530, Vinod Koul wrote:
> > fixup usage of dma direction by introducing dma_transfer_direction,
> > this patch moves usb/renesas driver to use new enum
> > 
> > Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> 
> This looks ok too:
> 
> Acked-by: Felipe Balbi <balbi@ti.com>
> 
> Kuninori-san, please have a look and reply with your Acked-by if you
> think it's ok.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


> > ---
> > v2: split the usb patch into two patches
> > 
> >  drivers/usb/renesas_usbhs/fifo.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
> > index a34430f..f5bc370 100644
> > --- a/drivers/usb/renesas_usbhs/fifo.c
> > +++ b/drivers/usb/renesas_usbhs/fifo.c
> > @@ -591,10 +591,10 @@ static void usbhsf_dma_prepare_tasklet(unsigned long data)
> >  	struct dma_async_tx_descriptor *desc;
> >  	struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt);
> >  	struct device *dev = usbhs_priv_to_dev(priv);
> > -	enum dma_data_direction dir;
> > +	enum dma_transfer_direction dir;
> >  	dma_cookie_t cookie;
> >  
> > -	dir = usbhs_pipe_is_dir_in(pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
> > +	dir = usbhs_pipe_is_dir_in(pipe) ? DEV_TO_MEM : MEM_TO_DEV;
> >  
> >  	sg_init_table(&sg, 1);
> >  	sg_set_page(&sg, virt_to_page(pkt->dma),
> > -- 
> > 1.7.0.4
> > 
> 
> -- 
> balbi

Best regards
--
Kuninori Morimoto
 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 00/10] dmaengine: move to enum dma_transfer_direction
  2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
                   ` (11 preceding siblings ...)
  2011-10-14 16:39 ` [PATCH 2/2] USB-renesas: " Vinod Koul
@ 2011-11-17  9:19 ` Vinod Koul
  12 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-11-17  9:19 UTC (permalink / raw)
  To: dan.j.williams
  Cc: linux-kernel, jaswinder.singh, 21cnbao, rmk, Viresh Kumar,
	Linus Walleij, Nicolas Ferre, H Hartley Sweeten, Li Yang,
	Zhang Wei, Sascha Hauer, Guennadi Liakhovetski, Shawn Guo,
	Yong Wang, Tomoya MORINAGA, Boojin Kim, Barry Song

On Fri, 2011-10-14 at 11:08 +0530, Vinod Koul wrote:
> From: Vinod Koul <vinod.koul@linux.intel.com>
> 
> As discussed recently on new interleaved dma patchset, the direction in
> dmaengine needs improvement and as suggested by Jassi, this patchset move
> dmaengine and dmacs, clients to use new enum dma_transfer_direction to indicate
> the dma direction and mode
> 
> Vinod Koul (10):
>   dmaengine: add new enum dma_transfer_direction
>   dmaengine: move drivers to dma_transfer_direction
>   plat-samsung: move to dma_transfer_direction
>   media-video: move to dma_transfer_direction
>   carma: move to dma_transfer_direction
>   mmc-host: move to dma_transfer_direction
>   spi, serial: move to dma_transfer_direction
>   sound-soc: move to dma_transfer_direction
>   USB: move to dma_transfer_direction
>   net-ks8842: move to dma_transfer_direction
> 
the version 2 of this patchset is available now
in the git repository at:

  git://git.infradead.org/users/vkoul/slave-dma.git dma_slave_direction

The change being the addition of DMA_xxx to the dma_slave_direction
values  as suggesting during last review. I have also added the acks
received from various folks.

Please note I plan to merge this tomorrow which would be followed by
merge of the 2d-xfer patches. If you have any objection on either series
please let me know.

Vinod Koul (11):
      dmaengine: add new enum dma_transfer_direction
      dmaengine: move drivers to dma_transfer_direction
      plat-samsung: move to dma_transfer_direction
      media, video: move to dma_transfer_direction
      carma: move to dma_transfer_direction
      mmc-host: move to dma_transfer_direction
      spi, serial: move to dma_transfer_direction
      sound-soc: move to dma_transfer_direction
      net-ks8842: move to dma_transfer_direction
      USB-musb: move to dma_transfer_direction
      USB-renesas: move to dma_transfer_direction

 arch/arm/mach-ep93xx/include/mach/dma.h        |    6 ++--
 arch/arm/plat-nomadik/include/plat/ste_dma40.h |    4 +-
 arch/arm/plat-samsung/dma-ops.c                |    4 +-
 arch/arm/plat-samsung/include/plat/dma-ops.h   |    4 +-
 drivers/dma/amba-pl08x.c                       |   24 +++++++++++-----------
 drivers/dma/at_hdmac.c                         |   22 ++++++++++----------
 drivers/dma/coh901318.c                        |   12 +++++-----
 drivers/dma/coh901318_lli.c                    |   23 ++++++++++-----------
 drivers/dma/coh901318_lli.h                    |    4 +-
 drivers/dma/dw_dmac.c                          |   14 ++++++------
 drivers/dma/ep93xx_dma.c                       |   22 ++++++++++----------
 drivers/dma/fsldma.c                           |    4 +-
 drivers/dma/imx-dma.c                          |   10 ++++----
 drivers/dma/imx-sdma.c                         |   10 ++++----
 drivers/dma/intel_mid_dma.c                    |   14 ++++++------
 drivers/dma/intel_mid_dma_regs.h               |    2 +-
 drivers/dma/ipu/ipu_idmac.c                    |    4 +-
 drivers/dma/mxs-dma.c                          |    8 +++---
 drivers/dma/pch_dma.c                          |   12 +++++-----
 drivers/dma/pl330.c                            |   18 ++++++++--------
 drivers/dma/shdma.c                            |   25 +++++++++++------------
 drivers/dma/ste_dma40.c                        |   26 ++++++++++++------------
 drivers/dma/timb_dma.c                         |   18 ++++++++--------
 drivers/dma/txx9dmac.c                         |   12 +++++-----
 drivers/media/video/mx3_camera.c               |    2 +-
 drivers/media/video/timblogiw.c                |    2 +-
 drivers/misc/carma/carma-fpga-program.c        |    2 +-
 drivers/mmc/host/atmel-mci.c                   |   10 ++++++--
 drivers/mmc/host/mmci.c                        |   11 ++++++---
 drivers/mmc/host/mxcmmc.c                      |   10 ++++++--
 drivers/mmc/host/mxs-mmc.c                     |    7 +++++-
 drivers/mmc/host/sh_mmcif.c                    |    4 +-
 drivers/mmc/host/tmio_mmc_dma.c                |    4 +-
 drivers/net/ks8842.c                           |    4 +-
 drivers/spi/spi-dw-mid.c                       |    8 +++---
 drivers/spi/spi-ep93xx.c                       |    9 +++++--
 drivers/spi/spi-pl022.c                        |    8 +++---
 drivers/spi/spi-topcliff-pch.c                 |    4 +-
 drivers/tty/serial/amba-pl011.c                |    8 +++---
 drivers/tty/serial/pch_uart.c                  |    4 +-
 drivers/tty/serial/sh-sci.c                    |    4 +-
 drivers/usb/musb/ux500_dma.c                   |    4 +-
 drivers/usb/renesas_usbhs/fifo.c               |    4 +-
 drivers/video/mx3fb.c                          |    4 +-
 include/linux/amba/pl08x.h                     |    4 +-
 include/linux/dmaengine.h                      |   22 +++++++++++++++----
 include/linux/dw_dmac.h                        |    2 +-
 include/linux/sh_dma.h                         |    2 +-
 sound/atmel/abdac.c                            |    2 +-
 sound/atmel/ac97c.c                            |   10 ++++----
 sound/soc/ep93xx/ep93xx-pcm.c                  |    4 +-
 sound/soc/imx/imx-pcm-dma-mx2.c                |    6 ++--
 sound/soc/samsung/dma.c                        |    4 +-
 sound/soc/sh/siu_pcm.c                         |    4 +-
 sound/soc/txx9/txx9aclc.c                      |    2 +-
 55 files changed, 253 insertions(+), 224 deletions(-)



-- 
~Vinod


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
                     ` (4 preceding siblings ...)
  2011-10-17 12:52   ` Guennadi Liakhovetski
@ 2011-11-21 12:20   ` Dan Carpenter
  2011-11-21 16:03     ` Vinod Koul
  5 siblings, 1 reply; 52+ messages in thread
From: Dan Carpenter @ 2011-11-21 12:20 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Vinod Koul, Russell King, Viresh Kumar, Linus Walleij,
	Nicolas Ferre, Mika Westerberg, H Hartley Sweeten, Li Yang,
	Zhang Wei, Sascha Hauer, Guennadi Liakhovetski, Shawn Guo,
	Yong Wang, Tomoya MORINAGA, Boojin Kim, Barry Song

[-- Attachment #1: Type: text/plain, Size: 573 bytes --]

I haven't followed this discussion at all so perhaps you were aware
but this introduces a Sparse warning in linux-next.

drivers/dma/timb_dma.c:168:17: warning: mixing different enum types
drivers/dma/timb_dma.c:168:17:     int enum dma_transfer_direction  versus
drivers/dma/timb_dma.c:168:17:     int enum dma_data_direction 
drivers/dma/timb_dma.c:172:32: warning: mixing different enum types
drivers/dma/timb_dma.c:172:32:     int enum dma_transfer_direction  versus
drivers/dma/timb_dma.c:172:32:     int enum dma_data_direction 

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction
  2011-11-21 12:20   ` Dan Carpenter
@ 2011-11-21 16:03     ` Vinod Koul
  0 siblings, 0 replies; 52+ messages in thread
From: Vinod Koul @ 2011-11-21 16:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: dan.j.williams, linux-kernel, jaswinder.singh, 21cnbao, rmk,
	Russell King, Viresh Kumar, Linus Walleij, Nicolas Ferre,
	Mika Westerberg, H Hartley Sweeten, Li Yang, Zhang Wei,
	Sascha Hauer, Guennadi Liakhovetski, Shawn Guo, Yong Wang,
	Tomoya MORINAGA, Boojin Kim, Barry Song

On Mon, 2011-11-21 at 15:20 +0300, Dan Carpenter wrote:
> I haven't followed this discussion at all so perhaps you were aware
> but this introduces a Sparse warning in linux-next.
> 
> drivers/dma/timb_dma.c:168:17: warning: mixing different enum types
> drivers/dma/timb_dma.c:168:17:     int enum dma_transfer_direction  versus
> drivers/dma/timb_dma.c:168:17:     int enum dma_data_direction 
> drivers/dma/timb_dma.c:172:32: warning: mixing different enum types
> drivers/dma/timb_dma.c:172:32:     int enum dma_transfer_direction  versus
> drivers/dma/timb_dma.c:172:32:     int enum dma_data_direction 

Thanks, below should fix this

diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 8c88072..d142ae1 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -166,10 +166,10 @@ static void __td_unmap_desc(struct timb_dma_chan *td_chan, const u8 *dma_desc,
 
 	if (single)
 		dma_unmap_single(chan2dev(&td_chan->chan), addr, len,
-			td_chan->direction);
+			DMA_TO_DEVICE);
 	else
 		dma_unmap_page(chan2dev(&td_chan->chan), addr, len,
-			td_chan->direction);
+			DMA_TO_DEVICE);
 }
 
 static void __td_unmap_descs(struct timb_dma_desc *td_desc, bool single)
@@ -398,7 +398,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
 	td_desc->txd.flags = DMA_CTRL_ACK;
 
 	td_desc->txd.phys = dma_map_single(chan2dmadev(chan),
-		td_desc->desc_list, td_desc->desc_list_len, DMA_MEM_TO_DEV);
+		td_desc->desc_list, td_desc->desc_list_len, DMA_TO_DEVICE);
 
 	err = dma_mapping_error(chan2dmadev(chan), td_desc->txd.phys);
 	if (err) {
@@ -419,7 +419,7 @@ static void td_free_desc(struct timb_dma_desc *td_desc)
 {
 	dev_dbg(chan2dev(td_desc->txd.chan), "Freeing desc: %p\n", td_desc);
 	dma_unmap_single(chan2dmadev(td_desc->txd.chan), td_desc->txd.phys,
-		td_desc->desc_list_len, DMA_MEM_TO_DEV);
+		td_desc->desc_list_len, DMA_TO_DEVICE);
 
 	kfree(td_desc->desc_list);
 	kfree(td_desc);



-- 
~Vinod


^ permalink raw reply related	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2011-11-21 16:07 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14  5:38 [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul
2011-10-14  5:38 ` [PATCH 01/10] dmaengine: add new " Vinod Koul
2011-10-14  6:15   ` Barry Song
2011-10-15 12:46   ` Russell King
2011-10-15 14:22     ` Barry Song
2011-10-15 17:04     ` Vinod Koul
2011-10-14  5:38 ` [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction Vinod Koul
2011-10-15 19:02   ` Mika Westerberg
2011-10-16 11:02   ` Linus Walleij
2011-10-17  5:28   ` Viresh Kumar
2011-10-17 13:15     ` Vinod Koul
2011-10-18  9:06       ` Viresh Kumar
2011-10-17  9:58   ` Nicolas Ferre
2011-10-17 12:52   ` Guennadi Liakhovetski
2011-10-18  2:48     ` Vinod Koul
2011-10-27 16:56     ` Vinod Koul
2011-11-21 12:20   ` Dan Carpenter
2011-11-21 16:03     ` Vinod Koul
2011-10-14  5:38 ` [PATCH 03/10] plat-samsung: move " Vinod Koul
2011-10-14  7:28   ` Kukjin Kim
2011-10-14 16:14     ` Vinod Koul
2011-10-14  5:38 ` [PATCH 04/10] media-video: " Vinod Koul
2011-10-17 12:52   ` Guennadi Liakhovetski
2011-10-14  5:38 ` [PATCH 05/10] carma: " Vinod Koul
2011-10-14  5:38 ` [PATCH 06/10] mmc-host: " Vinod Koul
2011-10-17  9:56   ` Nicolas Ferre
2011-10-17 12:59   ` Guennadi Liakhovetski
2011-10-14  5:38 ` [PATCH 07/10] spi, serial: " Vinod Koul
2011-10-15 19:00   ` Mika Westerberg
2011-10-16  8:01     ` Vinod Koul
2011-10-16  4:21   ` Grant Likely
2011-10-16  8:03     ` Vinod Koul
2011-10-14  5:38 ` [PATCH 08/10] sound-soc: " Vinod Koul
2011-10-14  9:40   ` Mark Brown
2011-10-14  5:38 ` [PATCH 09/10] USB: " Vinod Koul
2011-10-14  7:20   ` Felipe Balbi
2011-10-14  7:17     ` Vinod Koul
2011-10-14 11:01   ` Jassi Brar
2011-10-14 16:13     ` Vinod Koul
2011-10-14  5:38 ` [PATCH 10/10] net-ks8842: " Vinod Koul
2011-10-14 16:39 ` [PATCH v2 1/2] USB-musb: " Vinod Koul
2011-11-08 14:02   ` Felipe Balbi
2011-11-08 14:07     ` Felipe Balbi
2011-11-08 16:12       ` Vinod Koul
2011-11-09  6:09   ` Felipe Balbi
2011-11-09  8:38     ` Mian Yousaf Kaukab
2011-10-14 16:39 ` [PATCH 2/2] USB-renesas: " Vinod Koul
2011-11-08 14:02   ` Felipe Balbi
2011-11-09  6:10   ` Felipe Balbi
2011-11-10  0:06     ` Kuninori Morimoto
2011-11-10  0:06     ` Kuninori Morimoto
2011-11-17  9:19 ` [PATCH 00/10] dmaengine: move to enum dma_transfer_direction Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.