dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] dmaengine: axi-dmac: move version read in probe
@ 2020-08-19  7:16 Alexandru Ardelean
  2020-08-19  7:16 ` [PATCH 2/5] dmaengine: axi-dmac: move clock enable earlier Alexandru Ardelean
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexandru Ardelean @ 2020-08-19  7:16 UTC (permalink / raw)
  To: dmaengine, linux-kernel
  Cc: vkoul, lars, dan.j.williams, ardeleanalex, Alexandru Ardelean

The 'version' of the IP core will be needed to adapt the driver to a new
feature (i.e. reading some DMA parameters from registers).
To do that, the version will be checked, so this is being moved out of the
axi_dmac_detect_caps() function.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/dma/dma-axi-dmac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index f1d149e32839..088c79137398 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -774,12 +774,9 @@ static int axi_dmac_parse_chan_dt(struct device_node *of_chan,
 	return 0;
 }
 
-static int axi_dmac_detect_caps(struct axi_dmac *dmac)
+static int axi_dmac_detect_caps(struct axi_dmac *dmac, unsigned int version)
 {
 	struct axi_dmac_chan *chan = &dmac->chan;
-	unsigned int version;
-
-	version = axi_dmac_read(dmac, ADI_AXI_REG_VERSION);
 
 	axi_dmac_write(dmac, AXI_DMAC_REG_FLAGS, AXI_DMAC_FLAG_CYCLIC);
 	if (axi_dmac_read(dmac, AXI_DMAC_REG_FLAGS) == AXI_DMAC_FLAG_CYCLIC)
@@ -831,6 +828,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
 	struct axi_dmac *dmac;
 	struct resource *res;
 	struct regmap *regmap;
+	unsigned int version;
 	int ret;
 
 	dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL);
@@ -898,7 +896,9 @@ static int axi_dmac_probe(struct platform_device *pdev)
 	if (ret < 0)
 		return ret;
 
-	ret = axi_dmac_detect_caps(dmac);
+	version = axi_dmac_read(dmac, ADI_AXI_REG_VERSION);
+
+	ret = axi_dmac_detect_caps(dmac, version);
 	if (ret)
 		goto err_clk_disable;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-08-25 12:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  7:16 [PATCH 1/5] dmaengine: axi-dmac: move version read in probe Alexandru Ardelean
2020-08-19  7:16 ` [PATCH 2/5] dmaengine: axi-dmac: move clock enable earlier Alexandru Ardelean
2020-08-25 11:24   ` Vinod Koul
2020-08-25 12:34     ` Alexandru Ardelean
2020-08-19  7:16 ` [PATCH 3/5] dmaengine: axi-dmac: wrap entire dt parse in a function Alexandru Ardelean
2020-08-25 11:25   ` Vinod Koul
2020-08-19  7:16 ` [PATCH 4/5] dmaengine: axi-dmac: wrap channel parameter adjust into function Alexandru Ardelean
2020-08-19  7:16 ` [PATCH 5/5] dmaengine: axi-dmac: add support for reading bus attributes from registers Alexandru Ardelean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).