Commit 749d0d4b authored by Abhishek Sahu's avatar Abhishek Sahu Committed by Vinod Koul

dmaengine: qcom: bam_dma: add command descriptor flag

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: default avatarAbhishek Sahu <absahu@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent dfebb055
...@@ -65,6 +65,7 @@ struct bam_desc_hw { ...@@ -65,6 +65,7 @@ struct bam_desc_hw {
#define DESC_FLAG_EOT BIT(14) #define DESC_FLAG_EOT BIT(14)
#define DESC_FLAG_EOB BIT(13) #define DESC_FLAG_EOB BIT(13)
#define DESC_FLAG_NWD BIT(12) #define DESC_FLAG_NWD BIT(12)
#define DESC_FLAG_CMD BIT(11)
struct bam_async_desc { struct bam_async_desc {
struct virt_dma_desc vd; struct virt_dma_desc vd;
...@@ -645,6 +646,9 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, ...@@ -645,6 +646,9 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
unsigned int curr_offset = 0; unsigned int curr_offset = 0;
do { do {
if (flags & DMA_PREP_CMD)
desc->flags |= cpu_to_le16(DESC_FLAG_CMD);
desc->addr = cpu_to_le32(sg_dma_address(sg) + desc->addr = cpu_to_le32(sg_dma_address(sg) +
curr_offset); curr_offset);
...@@ -960,7 +964,7 @@ static void bam_start_dma(struct bam_chan *bchan) ...@@ -960,7 +964,7 @@ static void bam_start_dma(struct bam_chan *bchan)
/* set any special flags on the last descriptor */ /* set any special flags on the last descriptor */
if (async_desc->num_desc == async_desc->xfer_len) 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); cpu_to_le16(async_desc->flags);
else else
desc[async_desc->xfer_len - 1].flags |= desc[async_desc->xfer_len - 1].flags |=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment