From: Guodong Xu <guodong@riscstar.com>
To: Vinod Koul <vkoul@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@gentoo.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
duje@dujemihanovic.xyz
Cc: Alex Elder <elder@riscstar.com>,
Vivian Wang <wangruikang@iscas.ac.cn>,
dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev, Guodong Xu <guodong@riscstar.com>,
Troy Mitchell <troy.mitchell@linux.spacemit.com>
Subject: [PATCH v4 3/8] dmaengine: mmp_pdma: Add reset controller support
Date: Fri, 15 Aug 2025 13:16:25 +0800 [thread overview]
Message-ID: <20250815-working_dma_0701_v2-v4-3-62145ab6ea30@riscstar.com> (raw)
In-Reply-To: <20250815-working_dma_0701_v2-v4-0-62145ab6ea30@riscstar.com>
Add support to acquire and deassert an optional hardware reset controller
during mmp_pdma_probe(). It is optional because in Marvell devices
such as "marvell,pdma-1.0" the resets property is not a required
property. But in SpacemiT K1 PDMA, "spacemit,k1-pdma" as the dt
binding schema file stated, resets is required.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
v4: Updated the commit message, no source code change.
v3: No change.
v2: No change.
---
drivers/dma/mmp_pdma.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 4a6dbf55823722d26cc69379d22aaa88fbe19313..fe627efeaff07436647f86ab5ec5333144a3c92d 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -16,6 +16,7 @@
#include <linux/platform_data/mmp_dma.h>
#include <linux/dmapool.h>
#include <linux/clk.h>
+#include <linux/reset.h>
#include <linux/of_dma.h>
#include <linux/of.h>
@@ -1021,6 +1022,7 @@ static int mmp_pdma_probe(struct platform_device *op)
struct mmp_pdma_device *pdev;
struct mmp_dma_platdata *pdata = dev_get_platdata(&op->dev);
struct clk *clk;
+ struct reset_control *rst;
int i, ret, irq = 0;
int dma_channels = 0, irq_num = 0;
const enum dma_slave_buswidth widths =
@@ -1043,6 +1045,11 @@ static int mmp_pdma_probe(struct platform_device *op)
if (IS_ERR(clk))
return PTR_ERR(clk);
+ rst = devm_reset_control_get_optional_exclusive_deasserted(pdev->dev,
+ NULL);
+ if (IS_ERR(rst))
+ return PTR_ERR(rst);
+
if (pdev->dev->of_node) {
/* Parse new and deprecated dma-channels properties */
if (of_property_read_u32(pdev->dev->of_node, "dma-channels",
--
2.43.0
next prev parent reply other threads:[~2025-08-15 5:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 5:16 [PATCH v4 0/8] dmaengine: mmp_pdma: Add SpacemiT K1 SoC support with 64-bit addressing Guodong Xu
2025-08-15 5:16 ` [PATCH v4 1/8] dt-bindings: dma: Add SpacemiT K1 PDMA controller Guodong Xu
2025-08-15 5:16 ` [PATCH v4 2/8] dmaengine: mmp_pdma: Add clock support Guodong Xu
2025-08-15 5:16 ` Guodong Xu [this message]
2025-08-15 5:16 ` [PATCH v4 4/8] dmaengine: mmp_pdma: Add operations structure for controller abstraction Guodong Xu
2025-08-18 7:17 ` Dan Carpenter
2025-08-18 12:27 ` Guodong Xu
2025-08-15 5:16 ` [PATCH v4 5/8] dmaengine: mmp_pdma: Add SpacemiT K1 PDMA support with 64-bit addressing Guodong Xu
2025-08-15 5:16 ` [PATCH v4 6/8] riscv: dts: spacemit: Add PDMA node for K1 SoC Guodong Xu
2025-08-15 6:01 ` Troy Mitchell
2025-08-18 12:28 ` Guodong Xu
2025-08-15 5:16 ` [PATCH v4 7/8] riscv: dts: spacemit: Enable PDMA on Banana Pi F3 and Milkv Jupiter Guodong Xu
2025-08-15 5:16 ` [PATCH v4 8/8] riscv: defconfig: Enable MMP_PDMA support for SpacemiT K1 SoC Guodong Xu
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=20250815-working_dma_0701_v2-v4-3-62145ab6ea30@riscstar.com \
--to=guodong@riscstar.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=dmaengine@vger.kernel.org \
--cc=duje@dujemihanovic.xyz \
--cc=elder@riscstar.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=troy.mitchell@linux.spacemit.com \
--cc=vkoul@kernel.org \
--cc=wangruikang@iscas.ac.cn \
/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®