All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhishek Sahu <absahu@codeaurora.org>
To: andy.gross@linaro.org, david.brown@linaro.org,
	vinod.koul@intel.com, dan.j.williams@intel.com
Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Abhishek Sahu <absahu@codeaurora.org>
Subject: [PATCH v2 3/3] dmaengine: qcom: bam_dma: add command descriptor flag
Date: Mon, 26 Jun 2017 18:19:29 +0530	[thread overview]
Message-ID: <1498481369-29497-4-git-send-email-absahu@codeaurora.org> (raw)
In-Reply-To: <1498481369-29497-1-git-send-email-absahu@codeaurora.org>

If DMA_PREP_CMD flag is passed in prep_slave_sg then peripheral
driver has passed the data is in BAM command descriptor format
and BAM driver should set CMD bit for each of the HW descriptors.

Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
---
 drivers/dma/qcom/bam_dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 03c4eb3..6d89fb6 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -65,6 +65,7 @@ struct bam_desc_hw {
 #define DESC_FLAG_EOT BIT(14)
 #define DESC_FLAG_EOB BIT(13)
 #define DESC_FLAG_NWD BIT(12)
+#define DESC_FLAG_CMD BIT(11)
 
 struct bam_async_desc {
 	struct virt_dma_desc vd;
@@ -645,6 +646,9 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
 		unsigned int curr_offset = 0;
 
 		do {
+			if (flags & DMA_PREP_CMD)
+				desc->flags |= cpu_to_le16(DESC_FLAG_CMD);
+
 			desc->addr = cpu_to_le32(sg_dma_address(sg) +
 						 curr_offset);
 
@@ -960,7 +964,7 @@ static void bam_start_dma(struct bam_chan *bchan)
 
 	/* set any special flags on the last descriptor */
 	if (async_desc->num_desc == async_desc->xfer_len)
-		desc[async_desc->xfer_len - 1].flags =
+		desc[async_desc->xfer_len - 1].flags |=
 					cpu_to_le16(async_desc->flags);
 	else
 		desc[async_desc->xfer_len - 1].flags |=
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

      parent reply	other threads:[~2017-06-26 12:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 12:49 [PATCH v2 0/3] Support for QCOM BAM DMA command descriptor Abhishek Sahu
2017-06-26 12:49 ` [PATCH v2 1/3] dmaengine: add DMA_PREP_CMD for non-Data descriptors Abhishek Sahu
2017-07-17  9:24   ` Abhishek Sahu
2017-07-19 10:11     ` Vinod Koul
2017-07-19 12:26       ` Abhishek Sahu
2017-07-19 10:07   ` Vinod Koul
2017-07-19 12:18     ` Abhishek Sahu
2017-07-28 16:08       ` Abhishek Sahu
2017-07-31 12:34         ` Vinod Koul
2017-07-31 13:01           ` Abhishek Sahu
2017-07-31 16:35           ` Dave Jiang
2017-08-02  4:53             ` Vinod Koul
2017-06-26 12:49 ` [PATCH v2 2/3] dmaengine: qcom: bam_dma: wrapper functions for command descriptor Abhishek Sahu
2017-07-19 10:09   ` Vinod Koul
2017-07-19 11:31     ` Abhishek Sahu
2017-06-26 12:49 ` Abhishek Sahu [this message]

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=1498481369-29497-4-git-send-email-absahu@codeaurora.org \
    --to=absahu@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=david.brown@linaro.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    /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 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.