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

Commit 502c2ef2 authored by Maxime Ripard's avatar Maxime Ripard Committed by Vinod Koul
Browse files

dmaengine: imx: Split device_control



Split the device_control callback of the Freescale IMX DMA driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.

Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent d80f381f
Loading
Loading
Loading
Loading
+51 −52
Original line number Original line Diff line number Diff line
@@ -669,17 +669,12 @@ static void imxdma_tasklet(unsigned long data)


}
}


static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
static int imxdma_terminate_all(struct dma_chan *chan)
		unsigned long arg)
{
{
	struct imxdma_channel *imxdmac = to_imxdma_chan(chan);
	struct imxdma_channel *imxdmac = to_imxdma_chan(chan);
	struct dma_slave_config *dmaengine_cfg = (void *)arg;
	struct imxdma_engine *imxdma = imxdmac->imxdma;
	struct imxdma_engine *imxdma = imxdmac->imxdma;
	unsigned long flags;
	unsigned long flags;
	unsigned int mode = 0;


	switch (cmd) {
	case DMA_TERMINATE_ALL:
	imxdma_disable_hw(imxdmac);
	imxdma_disable_hw(imxdmac);


	spin_lock_irqsave(&imxdma->lock, flags);
	spin_lock_irqsave(&imxdma->lock, flags);
@@ -687,7 +682,15 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
	list_splice_tail_init(&imxdmac->ld_queue, &imxdmac->ld_free);
	list_splice_tail_init(&imxdmac->ld_queue, &imxdmac->ld_free);
	spin_unlock_irqrestore(&imxdma->lock, flags);
	spin_unlock_irqrestore(&imxdma->lock, flags);
	return 0;
	return 0;
	case DMA_SLAVE_CONFIG:
}

static int imxdma_config(struct dma_chan *chan,
			 struct dma_slave_config *dmaengine_cfg)
{
	struct imxdma_channel *imxdmac = to_imxdma_chan(chan);
	struct imxdma_engine *imxdma = imxdmac->imxdma;
	unsigned int mode = 0;

	if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) {
	if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) {
		imxdmac->per_address = dmaengine_cfg->src_addr;
		imxdmac->per_address = dmaengine_cfg->src_addr;
		imxdmac->watermark_level = dmaengine_cfg->src_maxburst;
		imxdmac->watermark_level = dmaengine_cfg->src_maxburst;
@@ -727,11 +730,6 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
			 imxdmac->word_size, DMA_BLR(imxdmac->channel));
			 imxdmac->word_size, DMA_BLR(imxdmac->channel));


	return 0;
	return 0;
	default:
		return -ENOSYS;
	}

	return -EINVAL;
}
}


static enum dma_status imxdma_tx_status(struct dma_chan *chan,
static enum dma_status imxdma_tx_status(struct dma_chan *chan,
@@ -1184,7 +1182,8 @@ static int __init imxdma_probe(struct platform_device *pdev)
	imxdma->dma_device.device_prep_dma_cyclic = imxdma_prep_dma_cyclic;
	imxdma->dma_device.device_prep_dma_cyclic = imxdma_prep_dma_cyclic;
	imxdma->dma_device.device_prep_dma_memcpy = imxdma_prep_dma_memcpy;
	imxdma->dma_device.device_prep_dma_memcpy = imxdma_prep_dma_memcpy;
	imxdma->dma_device.device_prep_interleaved_dma = imxdma_prep_dma_interleaved;
	imxdma->dma_device.device_prep_interleaved_dma = imxdma_prep_dma_interleaved;
	imxdma->dma_device.device_control = imxdma_control;
	imxdma->dma_device.device_config = imxdma_config;
	imxdma->dma_device.device_terminate_all = imxdma_terminate_all;
	imxdma->dma_device.device_issue_pending = imxdma_issue_pending;
	imxdma->dma_device.device_issue_pending = imxdma_issue_pending;


	platform_set_drvdata(pdev, imxdma);
	platform_set_drvdata(pdev, imxdma);