From: "Csókás, Bence" <csokas.bence@prolan.hu>
To: <dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-sunxi@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: "Mesih Kilinc" <mesihkilinc@gmail.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Chen-Yu Tsai" <wens@kernel.org>,
"Csókás, Bence" <csokas.bence@prolan.hu>,
"Vinod Koul" <vkoul@kernel.org>, "Chen-Yu Tsai" <wens@csie.org>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Samuel Holland" <samuel@sholland.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>
Subject: [PATCH v6 2/5] dma-engine: sun4i: Add has_reset option to quirk
Date: Fri, 22 Nov 2024 17:11:29 +0100 [thread overview]
Message-ID: <20241122161128.2619172-3-csokas.bence@prolan.hu> (raw)
In-Reply-To: <20241122161128.2619172-1-csokas.bence@prolan.hu>
From: Mesih Kilinc <mesihkilinc@gmail.com>
Allwinner suniv F1C100s has a reset bit for DMA in CCU. Sun4i do not
has this bit but in order to support suniv we need to add it. So add
support for reset bit.
Signed-off-by: Mesih Kilinc <mesihkilinc@gmail.com>
[ csokas.bence: Rebased and addressed comments ]
Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
---
Notes:
Changes in v2:
* Call reset_control_deassert() unconditionally, as it supports optional resets
* Use dev_err_probe()
* Whitespace
Changes in v3:
* More dev_err_probe() fixes
Changes in v4:
* Use return value of dev_err_probe()
Changes in v5:
* More whitespace
Changes in v6:
* Use the new devm_reset_control_get_exclusive_deasserted()
drivers/dma/sun4i-dma.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
index b2c1e4b9f696..adb52a6df83a 100644
--- a/drivers/dma/sun4i-dma.c
+++ b/drivers/dma/sun4i-dma.c
@@ -15,6 +15,7 @@
#include <linux/of_dma.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -159,6 +160,7 @@ struct sun4i_dma_config {
u8 ddma_drq_sdram;
u8 max_burst;
+ bool has_reset;
};
struct sun4i_dma_pchan {
@@ -208,6 +210,7 @@ struct sun4i_dma_dev {
int irq;
spinlock_t lock;
const struct sun4i_dma_config *cfg;
+ struct reset_control *rst;
};
static struct sun4i_dma_dev *to_sun4i_dma_dev(struct dma_device *dev)
@@ -1215,6 +1218,13 @@ static int sun4i_dma_probe(struct platform_device *pdev)
return PTR_ERR(priv->clk);
}
+ if (priv->cfg->has_reset) {
+ priv->rst = devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL);
+ if (IS_ERR(priv->rst))
+ return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst),
+ "Failed to get reset control\n");
+ }
+
platform_set_drvdata(pdev, priv);
spin_lock_init(&priv->lock);
@@ -1355,6 +1365,7 @@ static struct sun4i_dma_config sun4i_a10_dma_cfg = {
.ddma_drq_sdram = SUN4I_DDMA_DRQ_TYPE_SDRAM,
.max_burst = SUN4I_MAX_BURST,
+ .has_reset = false,
};
static const struct of_device_id sun4i_dma_match[] = {
--
2.34.1
next prev parent reply other threads:[~2024-11-22 16:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 16:11 [PATCH v5 0/5] Add support for DMA of F1C100s Csókás, Bence
2024-11-22 16:11 ` [PATCH v6 1/5] dma-engine: sun4i: Add a quirk to support different chips Csókás, Bence
2024-11-22 16:11 ` Csókás, Bence [this message]
2024-11-22 16:11 ` [PATCH v6 3/5] dt-bindings: dmaengine: Add Allwinner suniv F1C100s DMA Csókás, Bence
2024-11-22 16:11 ` [PATCH v6 4/5] dma-engine: sun4i: Add support for Allwinner suniv F1C100s Csókás, Bence
2024-11-22 16:11 ` [PATCH v6 5/5] ARM: dts: suniv: f1c100s: Add support for DMA Csókás, Bence
2024-12-04 13:18 ` (subset) [PATCH v5 0/5] Add support for DMA of F1C100s Vinod Koul
2024-12-04 23:55 ` Csókás Bence
2024-12-05 3:22 ` Chen-Yu Tsai
2024-12-05 14:25 ` Chen-Yu Tsai
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=20241122161128.2619172-3-csokas.bence@prolan.hu \
--to=csokas.bence@prolan.hu \
--cc=dmaengine@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mesihkilinc@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=samuel@sholland.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
--cc=wens@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
all inboxes | Powered by JetHome®