From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Csókás, Bence" <csokas.bence@prolan.hu>,
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>,
Chen-Yu Tsai <wens@kernel.org>, 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: Re: [PATCH v4 02/10] dma-engine: sun4i: Add has_reset option to quirk
Date: Thu, 31 Oct 2024 16:47:09 +0100 [thread overview]
Message-ID: <0712919e-300f-4eef-aa3f-ad5533743296@kernel.org> (raw)
In-Reply-To: <20241031123538.2582675-2-csokas.bence@prolan.hu>
On 31/10/2024 13:35, Csókás, Bence wrote:
> 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 v3:
> * Use return value of dev_err_probe()
>
> drivers/dma/sun4i-dma.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
> index d472f57a39ea..4626cc8ad114 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,15 @@ 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(&pdev->dev,
> + NULL);
Unnecessary wrapping.
> + if (IS_ERR(priv->rst)) {
Drop {}.
> + return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst),
> + "Failed to get reset control\n");
And this should be aligned with opening (. Run checkpatch --strict.
> + }
> + }
> +
> platform_set_drvdata(pdev, priv);
> spin_lock_init(&priv->lock);
>
> @@ -1287,6 +1299,14 @@ static int sun4i_dma_probe(struct platform_device *pdev)
> return ret;
> }
>
> + /* Deassert the reset control */
> + ret = reset_control_deassert(priv->rst);
> + if (ret) {
> + dev_err_probe(&pdev->dev, ret,
> + "Failed to deassert the reset control\n");
Missing alignment.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-10-31 15:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 12:35 [PATCH v4 01/10] dma-engine: sun4i: Add a quirk to support different chips Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 02/10] dma-engine: sun4i: Add has_reset option to quirk Csókás, Bence
2024-10-31 15:47 ` Krzysztof Kozlowski [this message]
2024-10-31 12:35 ` [PATCH v4 03/10] dt-bindings: dmaengine: Add Allwinner suniv F1C100s DMA Csókás, Bence
2024-10-31 18:17 ` Rob Herring
2024-11-02 8:57 ` Csókás Bence
2024-10-31 12:35 ` [PATCH v4 04/10] dma-engine: sun4i: Add support for Allwinner suniv F1C100s Csókás, Bence
2024-10-31 19:05 ` Amit Singh Tomar
2024-11-02 9:06 ` Csókás Bence
2024-10-31 12:35 ` [PATCH v4 05/10] ARM: dts: suniv: f1c100s: Add support for DMA Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 06/10] ASoC: sun4i-codec: Add DMA Max Burst field Csókás, Bence
2024-10-31 14:27 ` Mark Brown
2024-10-31 12:35 ` [PATCH v4 07/10] dt-bindings: sound: Add Allwinner suniv F1C100s Audio Codec Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 08/10] ASoC: sun4i-codec: Add support for Allwinner suniv F1C100s Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 09/10] ARM: dts: suniv: f1c100s: Add support for Audio Codec Csókás, Bence
2024-10-31 12:35 ` [PATCH v4 10/10] ARM: dts: suniv: f1c100s: Activate Audio Codec for Lichee Pi Nano Csókás, Bence
2024-10-31 18:15 ` [PATCH v4 01/10] dma-engine: sun4i: Add a quirk to support different chips Amit Singh Tomar
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=0712919e-300f-4eef-aa3f-ad5533743296@kernel.org \
--to=krzk@kernel.org \
--cc=csokas.bence@prolan.hu \
--cc=dmaengine@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.