From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>, linux-clk@vger.kernel.org
Cc: p.zabel@pengutronix.de, mturquette@baylibre.com,
sboyd@kernel.org, lorenzo.bianconi83@gmail.com, conor@kernel.org,
linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, nbd@nbd.name, john@phrozen.org,
dd@embedd.com, catalin.marinas@arm.com, will@kernel.org,
upstream@airoha.com
Subject: Re: [PATCH 4/5] clk: en7523: Add reset-controller support for EN7581 SoC
Date: Thu, 16 May 2024 11:50:37 +0200 [thread overview]
Message-ID: <97b1fbfc-e059-46c7-9bb1-75cdaa2d2159@collabora.com> (raw)
In-Reply-To: <0f7b04c2101db1a974dc45017bee285ffb25d80f.1715777643.git.lorenzo@kernel.org>
Il 15/05/24 14:58, Lorenzo Bianconi ha scritto:
> Introduce reset API support to EN7581 clock driver.
>
> Tested-by: Zhengping Zhang <zhengping.zhang@airoha.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Heh, that's exactly the usual MediaTek reset controller :-D
> ---
> drivers/clk/clk-en7523.c | 96 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 94 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index 381605be333f..18798b692b68 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c
> @@ -6,6 +6,7 @@
> #include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> #include <dt-bindings/clock/en7523-clk.h>
>
> #define REG_PCI_CONTROL 0x88
> @@ -65,8 +66,18 @@ struct en_clk_gate {
> struct clk_hw hw;
> };
>
> +#define RST_NR_PER_BANK 32
Please move this definition at the beginning of this file, grouping that with
the others.
..snip...
> @@ -456,12 +542,14 @@ static int en7523_clk_probe(struct platform_device *pdev)
> en7523_register_clocks(&pdev->dev, clk_data, base, np_base);
>
> r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> - if (r)
> + if (r) {
> dev_err(&pdev->dev,
> "could not register clock provider: %s: %d\n",
> pdev->name, r);
> + return r;
> + }
>
> - return r;
> + return en7523_reset_register(&pdev->dev, np_base, soc_data);
If en7523_reset_register fails, you want to call of_clk_del_provider(), so
you can't just return like this...
Cheers,
Angelo
> }
>
> static const struct en_clk_soc_data en7523_data = {
> @@ -480,6 +568,10 @@ static const struct en_clk_soc_data en7581_data = {
> .unprepare = en7581_pci_unprepare,
> .disable = en7581_pci_disable,
> },
> + .reset_data = {
> + .base_addr = REG_RESET_CONTROL2,
> + .n_banks = 2,
> + },
> .hw_init = en7581_clk_hw_init,
> };
>
WARNING: multiple messages have this Message-ID (diff)
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>, linux-clk@vger.kernel.org
Cc: p.zabel@pengutronix.de, mturquette@baylibre.com,
sboyd@kernel.org, lorenzo.bianconi83@gmail.com, conor@kernel.org,
linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, nbd@nbd.name, john@phrozen.org,
dd@embedd.com, catalin.marinas@arm.com, will@kernel.org,
upstream@airoha.com
Subject: Re: [PATCH 4/5] clk: en7523: Add reset-controller support for EN7581 SoC
Date: Thu, 16 May 2024 11:50:37 +0200 [thread overview]
Message-ID: <97b1fbfc-e059-46c7-9bb1-75cdaa2d2159@collabora.com> (raw)
In-Reply-To: <0f7b04c2101db1a974dc45017bee285ffb25d80f.1715777643.git.lorenzo@kernel.org>
Il 15/05/24 14:58, Lorenzo Bianconi ha scritto:
> Introduce reset API support to EN7581 clock driver.
>
> Tested-by: Zhengping Zhang <zhengping.zhang@airoha.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Heh, that's exactly the usual MediaTek reset controller :-D
> ---
> drivers/clk/clk-en7523.c | 96 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 94 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index 381605be333f..18798b692b68 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c
> @@ -6,6 +6,7 @@
> #include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> #include <dt-bindings/clock/en7523-clk.h>
>
> #define REG_PCI_CONTROL 0x88
> @@ -65,8 +66,18 @@ struct en_clk_gate {
> struct clk_hw hw;
> };
>
> +#define RST_NR_PER_BANK 32
Please move this definition at the beginning of this file, grouping that with
the others.
..snip...
> @@ -456,12 +542,14 @@ static int en7523_clk_probe(struct platform_device *pdev)
> en7523_register_clocks(&pdev->dev, clk_data, base, np_base);
>
> r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data);
> - if (r)
> + if (r) {
> dev_err(&pdev->dev,
> "could not register clock provider: %s: %d\n",
> pdev->name, r);
> + return r;
> + }
>
> - return r;
> + return en7523_reset_register(&pdev->dev, np_base, soc_data);
If en7523_reset_register fails, you want to call of_clk_del_provider(), so
you can't just return like this...
Cheers,
Angelo
> }
>
> static const struct en_clk_soc_data en7523_data = {
> @@ -480,6 +568,10 @@ static const struct en_clk_soc_data en7581_data = {
> .unprepare = en7581_pci_unprepare,
> .disable = en7581_pci_disable,
> },
> + .reset_data = {
> + .base_addr = REG_RESET_CONTROL2,
> + .n_banks = 2,
> + },
> .hw_init = en7581_clk_hw_init,
> };
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-05-16 9:50 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 12:58 [PATCH 0/5] Add reset support to EN7581 clk driver Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-15 12:58 ` [PATCH 1/5] dt-bindings: clock: airoha: Add reset support to EN7581 clock binding Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-15 16:23 ` Conor Dooley
2024-05-15 16:23 ` Conor Dooley
2024-05-15 12:58 ` [PATCH 2/5] dt-bindings: reset: Add reset definitions for EN7581 SoC Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-15 16:27 ` Conor Dooley
2024-05-15 16:27 ` Conor Dooley
2024-05-16 7:34 ` Lorenzo Bianconi
2024-05-16 7:34 ` Lorenzo Bianconi
2024-05-16 9:46 ` AngeloGioacchino Del Regno
2024-05-16 9:46 ` AngeloGioacchino Del Regno
2024-05-16 11:14 ` Lorenzo Bianconi
2024-05-16 11:14 ` Lorenzo Bianconi
2024-05-16 11:38 ` AngeloGioacchino Del Regno
2024-05-16 11:38 ` AngeloGioacchino Del Regno
2024-05-16 15:59 ` Lorenzo Bianconi
2024-05-16 15:59 ` Lorenzo Bianconi
2024-05-15 12:58 ` [PATCH 3/5] arm64: dts: airoha: Add reset-controller support to EN7581 clock node Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-15 12:58 ` [PATCH 4/5] clk: en7523: Add reset-controller support for EN7581 SoC Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-16 9:50 ` AngeloGioacchino Del Regno [this message]
2024-05-16 9:50 ` AngeloGioacchino Del Regno
2024-05-16 11:22 ` Lorenzo Bianconi
2024-05-16 11:22 ` Lorenzo Bianconi
2024-05-15 12:58 ` [PATCH 5/5] clk: en7523: Remove pcie prepare/unpreare callbacks " Lorenzo Bianconi
2024-05-15 12:58 ` Lorenzo Bianconi
2024-05-16 9:51 ` AngeloGioacchino Del Regno
2024-05-16 9:51 ` AngeloGioacchino Del Regno
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=97b1fbfc-e059-46c7-9bb1-75cdaa2d2159@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=dd@embedd.com \
--cc=devicetree@vger.kernel.org \
--cc=john@phrozen.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=lorenzo@kernel.org \
--cc=mturquette@baylibre.com \
--cc=nbd@nbd.name \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=upstream@airoha.com \
--cc=will@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.