From: Yixun Lan <dlan@gentoo.org>
To: Guodong Xu <guodong@riscstar.com>
Cc: "Vinod Koul" <vkoul@kernel.org>, "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Duje Mihanović" <duje.mihanovic@skole.hr>,
"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>,
"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
Subject: Re: [PATCH v3 2/8] dmaengine: mmp_pdma: Add optional clock support
Date: Thu, 24 Jul 2025 20:31:28 +0800 [thread overview]
Message-ID: <20250724123128-GYB748228@gentoo> (raw)
In-Reply-To: <20250714-working_dma_0701_v2-v3-2-8b0f5cd71595@riscstar.com>
Hi Guodong,
I personally find the word 'optional' introducing some confusions..
I can understand from driver perspective, it's kind of optional,
but from SpacemiT K1 perspective, it's mandatory for this driver
(the 'clocks' property of DT is in 'required' section)
feel free to improve the commit message, maybe add some motivation
hehind this
On 17:39 Mon 14 Jul , Guodong Xu wrote:
> Add support for retrieving and enabling an optional clock during
> mmp_pdma_probe().
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> v3: No change.
> v2: No change.
> ---
> drivers/dma/mmp_pdma.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
> index a95d31103d3063a1d11177a1a37b89ac2fd213e9..4a6dbf55823722d26cc69379d22aaa88fbe19313 100644
> --- a/drivers/dma/mmp_pdma.c
> +++ b/drivers/dma/mmp_pdma.c
> @@ -15,6 +15,7 @@
> #include <linux/device.h>
> #include <linux/platform_data/mmp_dma.h>
> #include <linux/dmapool.h>
> +#include <linux/clk.h>
> #include <linux/of_dma.h>
> #include <linux/of.h>
>
> @@ -1019,6 +1020,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;
> int i, ret, irq = 0;
> int dma_channels = 0, irq_num = 0;
> const enum dma_slave_buswidth widths =
> @@ -1037,6 +1039,10 @@ static int mmp_pdma_probe(struct platform_device *op)
> if (IS_ERR(pdev->base))
> return PTR_ERR(pdev->base);
>
> + clk = devm_clk_get_optional_enabled(pdev->dev, NULL);
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
> +
> 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
>
--
Yixun Lan (dlan)
next prev parent reply other threads:[~2025-07-24 12:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 9:39 [PATCH v3 0/8] dmaengine: mmp_pdma: Add SpacemiT K1 SoC support with 64-bit addressing Guodong Xu
2025-07-14 9:39 ` [PATCH v3 1/8] dt-bindings: dma: Add SpacemiT K1 PDMA controller Guodong Xu
2025-07-15 3:45 ` Rob Herring (Arm)
2025-08-15 0:27 ` Guodong Xu
2025-07-14 9:39 ` [PATCH v3 2/8] dmaengine: mmp_pdma: Add optional clock support Guodong Xu
2025-07-24 12:31 ` Yixun Lan [this message]
2025-08-15 0:16 ` Guodong Xu
2025-07-14 9:39 ` [PATCH v3 3/8] dmaengine: mmp_pdma: Add optional reset controller support Guodong Xu
2025-07-14 9:39 ` [PATCH v3 4/8] dmaengine: mmp_pdma: Add operations structure for controller abstraction Guodong Xu
2025-08-12 9:23 ` Guodong Xu
2025-07-14 9:39 ` [PATCH v3 5/8] dmaengine: mmp_pdma: Add SpacemiT K1 PDMA support with 64-bit addressing Guodong Xu
2025-07-14 9:39 ` [PATCH v3 6/8] riscv: dts: spacemit: Add PDMA0 node for K1 SoC Guodong Xu
2025-07-24 12:19 ` Yixun Lan
2025-08-15 0:26 ` Guodong Xu
2025-07-14 9:39 ` [PATCH v3 7/8] riscv: dts: spacemit: Enable PDMA0 on Banana Pi F3 and Milkv Jupiter Guodong Xu
2025-07-14 9:39 ` [PATCH v3 8/8] riscv: defconfig: Enable MMP_PDMA support for SpacemiT K1 SoC Guodong Xu
2025-08-13 8:26 ` [PATCH v3 0/8] dmaengine: mmp_pdma: Add SpacemiT K1 SoC support with 64-bit addressing Troy Mitchell
2025-08-15 0:28 ` 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=20250724123128-GYB748228@gentoo \
--to=dlan@gentoo.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=duje.mihanovic@skole.hr \
--cc=elder@riscstar.com \
--cc=guodong@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=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;
as well as URLs for NNTP newsgroup(s).