aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2019-02-21 00:34:41 -0500
committerVinod Koul <vkoul@kernel.org>2019-02-25 01:41:19 -0500
commitffb5be7c708ac38db7e339d31bb0eb23962ea8c7 (patch)
tree6997542064cdac2c1a196686e07414609815e93b
parentb5a4c37324049efe0e0199e975e0df9554fa8873 (diff)
dmaengine: sprd: Change channel id to slave id for DMA cell specifier
We will describe the slave id in DMA cell specifier instead of DMA channel id, thus we should save the slave id from DMA engine translation function, and remove the channel id validation. Meanwhile we do not need set default slave id in sprd_dma_alloc_chan_resources(), remove it. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/sprd-dma.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index e2f016700fcc..48431e2da987 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -580,15 +580,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id)
580 580
581static int sprd_dma_alloc_chan_resources(struct dma_chan *chan) 581static int sprd_dma_alloc_chan_resources(struct dma_chan *chan)
582{ 582{
583 struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); 583 return pm_runtime_get_sync(chan->device->dev);
584 int ret;
585
586 ret = pm_runtime_get_sync(chan->device->dev);
587 if (ret < 0)
588 return ret;
589
590 schan->dev_id = SPRD_DMA_SOFTWARE_UID;
591 return 0;
592} 584}
593 585
594static void sprd_dma_free_chan_resources(struct dma_chan *chan) 586static void sprd_dma_free_chan_resources(struct dma_chan *chan)
@@ -1021,13 +1013,10 @@ static void sprd_dma_free_desc(struct virt_dma_desc *vd)
1021static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param) 1013static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param)
1022{ 1014{
1023 struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); 1015 struct sprd_dma_chn *schan = to_sprd_dma_chan(chan);
1024 struct sprd_dma_dev *sdev = to_sprd_dma_dev(&schan->vc.chan); 1016 u32 slave_id = *(u32 *)param;
1025 u32 req = *(u32 *)param;
1026 1017
1027 if (req < sdev->total_chns) 1018 schan->dev_id = slave_id;
1028 return req == schan->chn_num + 1; 1019 return true;
1029 else
1030 return false;
1031} 1020}
1032 1021
1033static int sprd_dma_probe(struct platform_device *pdev) 1022static int sprd_dma_probe(struct platform_device *pdev)