linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b32955@freescale.com (Huang Shijie)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/10] MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg()
Date: Thu, 19 Jan 2012 14:16:04 +0800	[thread overview]
Message-ID: <1326953767-24155-8-git-send-email-b32955@freescale.com> (raw)
In-Reply-To: <1326953767-24155-1-git-send-email-b32955@freescale.com>

Rewrite the last parameter of mxs_dma_prep_slave_sg().
Add some more flags to let the driver sets the flags as it needs,
such as WAIT4END bit.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/dma/mxs-dma.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index c80fbed..cfcb8d8 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -352,7 +352,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_transfer_direction direction,
-		unsigned long append)
+		unsigned long flags)
 {
 	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -360,6 +360,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 	struct scatterlist *sg;
 	int i, j;
 	u32 *pio;
+	bool append = flags & MXS_DMA_F_APPEND;
 	int idx = append ? mxs_chan->desc_count : 0;
 
 	if (mxs_chan->status == DMA_IN_PROGRESS && !append)
@@ -386,7 +387,6 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 		ccw->bits |= CCW_CHAIN;
 		ccw->bits &= ~CCW_IRQ;
 		ccw->bits &= ~CCW_DEC_SEM;
-		ccw->bits &= ~CCW_WAIT4END;
 	} else {
 		idx = 0;
 	}
@@ -401,7 +401,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 		ccw->bits = 0;
 		ccw->bits |= CCW_IRQ;
 		ccw->bits |= CCW_DEC_SEM;
-		ccw->bits |= CCW_WAIT4END;
+		if (flags & MXS_DMA_F_WAIT4END)
+			ccw->bits |= CCW_WAIT4END;
 		ccw->bits |= CCW_HALT_ON_TERM;
 		ccw->bits |= CCW_TERM_FLUSH;
 		ccw->bits |= BF_CCW(sg_len, PIO_NUM);
@@ -432,7 +433,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 				ccw->bits &= ~CCW_CHAIN;
 				ccw->bits |= CCW_IRQ;
 				ccw->bits |= CCW_DEC_SEM;
-				ccw->bits |= CCW_WAIT4END;
+				if (flags & MXS_DMA_F_WAIT4END)
+					ccw->bits |= CCW_WAIT4END;
 			}
 		}
 	}
-- 
1.7.0.4

  parent reply	other threads:[~2012-01-19  6:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
2012-01-19  8:58   ` Wolfram Sang
2012-01-19 11:20     ` Mark Brown
2012-01-19 13:04   ` Shawn Guo
2012-01-19  6:15 ` [PATCH 02/10] MXS-DMA : change the header Huang Shijie
2012-01-19  6:16 ` [PATCH 03/10] MXS-MMC : change the DMA header file Huang Shijie
2012-01-19  6:16 ` [PATCH 04/10] MTD/GPMI " Huang Shijie
2012-01-19  6:16 ` [PATCH 05/10] ASoc " Huang Shijie
2012-01-19  6:16 ` [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA Huang Shijie
2012-01-19  9:02   ` Russell King - ARM Linux
2012-01-19  9:31     ` Huang Shijie
2012-01-19  6:16 ` Huang Shijie [this message]
2012-01-19  6:16 ` [PATCH 08/10] MXS-MMC : use the new DMA flags Huang Shijie
2012-01-19  6:16 ` [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version` Huang Shijie
2012-01-19  6:16 ` [PATCH 10/10] MTD/GPMI : change the code for new DMA interface Huang Shijie
2012-01-19  9:10 ` [PATCH 00/10] patch set about the MXS-DMA Shawn Guo
2012-01-19  9:45   ` Wolfram Sang
2012-01-20  3:29     ` Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326953767-24155-8-git-send-email-b32955@freescale.com \
    --to=b32955@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).