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

Commit 4998f1a3 authored by Sascha Hauer's avatar Sascha Hauer
Browse files

mxc: mx1/mx2 DMA: add a possibility to create an endless DMA transfer



This is useful for audio where we do not want to setup a new scatterlist
after playing 4GB of audio data. This would cause skips in the playback.

Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 74b2a70e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ static inline int imx_dma_sg_next(int channel, struct scatterlist *sg)
	}

	now = min(imxdma->resbytes, sg->length);
	if (imxdma->resbytes != IMX_DMA_LENGTH_LOOP)
		imxdma->resbytes -= now;

	if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
+8 −0
Original line number Diff line number Diff line
@@ -58,6 +58,14 @@ imx_dma_setup_single(int channel, dma_addr_t dma_address,
		unsigned int dma_length, unsigned int dev_addr,
		unsigned int dmamode);


/*
 * Use this flag as the dma_length argument to imx_dma_setup_sg()
 * to create an endless running dma loop. The end of the scatterlist
 * must be linked to the beginning for this to work.
 */
#define IMX_DMA_LENGTH_LOOP	((unsigned int)-1)

int
imx_dma_setup_sg(int channel, struct scatterlist *sg,
		unsigned int sgcount, unsigned int dma_length,