From: Alexandru Ardelean <alexandru.ardelean@analog.com>
To: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <vkoul@kernel.org>, <lars@metafoo.de>, <dan.j.williams@intel.com>,
<ardeleanalex@gmail.com>,
Alexandru Ardelean <alexandru.ardelean@analog.com>
Subject: [PATCH v2 1/6] dmaengine: axi-dmac: move version read in probe
Date: Tue, 25 Aug 2020 15:48:28 +0300 [thread overview]
Message-ID: <20200825124840.43664-2-alexandru.ardelean@analog.com> (raw)
In-Reply-To: <20200825124840.43664-1-alexandru.ardelean@analog.com>
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
next prev parent reply other threads:[~2020-08-25 12:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 12:48 [PATCH v2 0/6] dmaengine: axi-dmac: add support for reading bus attributes from register Alexandru Ardelean
2020-08-25 12:48 ` Alexandru Ardelean [this message]
2020-08-25 12:48 ` [PATCH v2 2/6] dmaengine: axi-dmac: move active_descs list init after device-tree init Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 3/6] dmaengine: axi-dmac: move clock enable earlier Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 4/6] dmaengine: axi-dmac: wrap entire dt parse in a function Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 5/6] dmaengine: axi-dmac: wrap channel parameter adjust into function Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 6/6] dmaengine: axi-dmac: add support for reading bus attributes from registers Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 0/6] dmaengine: axi-dmac: add support for reading bus attributes from register Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 1/6] dmaengine: axi-dmac: move version read in probe Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 2/6] dmaengine: axi-dmac: move active_descs list init after device-tree init Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 3/6] dmaengine: axi-dmac: move clock enable earlier Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 4/6] dmaengine: axi-dmac: wrap entire dt parse in a function Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 5/6] dmaengine: axi-dmac: wrap channel parameter adjust into function Alexandru Ardelean
2020-08-25 12:48 ` [PATCH v2 6/6] dmaengine: axi-dmac: add support for reading bus attributes from registers Alexandru Ardelean
2020-08-25 14:46 ` [PATCH v2 0/6] dmaengine: axi-dmac: add support for reading bus attributes from register Vinod Koul
2020-08-25 15:14 ` Alexandru Ardelean
2020-08-25 15:20 ` Alexandru Ardelean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200825124840.43664-2-alexandru.ardelean@analog.com \
--to=alexandru.ardelean@analog.com \
--cc=ardeleanalex@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).