Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97dbd6ea authored by Eric Long's avatar Eric Long Committed by Vinod Koul
Browse files

dmaengine: sprd: Support DMA link-list cyclic callback



The Spreadtrum DMA link-list mode is always one cyclic transfer,
so we should clear the SPRD_DMA_LLIST_END flag for the link-list
configuration. Moreover add cyclic callback support for the cyclic
transfer.

Signed-off-by: default avatarEric Long <eric.long@spreadtrum.com>
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 0e5d7b1e
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)
	struct sprd_dma_desc *sdesc;
	enum sprd_dma_req_mode req_type;
	enum sprd_dma_int_type int_type;
	bool trans_done = false;
	bool trans_done = false, cyclic = false;
	u32 i;

	while (irq_status) {
@@ -478,6 +478,11 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)

		sdesc = schan->cur_desc;

		/* cyclic mode schedule callback */
		cyclic = schan->linklist.phy_addr ? true : false;
		if (cyclic == true) {
			vchan_cyclic_callback(&sdesc->vd);
		} else {
			/* Check if the dma request descriptor is done. */
			trans_done = sprd_dma_check_trans_done(sdesc, int_type,
							       req_type);
@@ -486,6 +491,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)
				schan->cur_desc = NULL;
				sprd_dma_start(schan);
			}
		}
		spin_unlock(&schan->vc.lock);
	}

@@ -692,9 +698,6 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,

	/* link-list configuration */
	if (schan->linklist.phy_addr) {
		if (sg_index == sglen - 1)
			hw->frg_len |= SPRD_DMA_LLIST_END;

		hw->cfg |= SPRD_DMA_LINKLIST_EN;

		/* link-list index */