From: Krzysztof Kozlowski <krzk@kernel.org>
To: dongxuyang@eswincomputing.com, p.zabel@pengutronix.de,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: ningyu@eswincomputing.com, linmin@eswincomputing.com,
huangyifeng@eswincomputing.com
Subject: Re: [PATCH 2/2] reset: eswin: Add eic7700 reset driver
Date: Fri, 16 May 2025 15:25:58 +0200 [thread overview]
Message-ID: <f6fbc6f6-aaba-4303-9c2f-fc985a2a3c83@kernel.org> (raw)
In-Reply-To: <20250514003209.531-1-dongxuyang@eswincomputing.com>
On 14/05/2025 02:32, dongxuyang@eswincomputing.com wrote:
> From: Xuyang Dong <dongxuyang@eswincomputing.com>
>
> Add support for reset controller in eic7700 series chips.
> Provide functionality for asserting and deasserting resets
> on the chip.
>
> Signed-off-by: Yifeng Huang <huangyifeng@eswincomputing.com>
> Signed-off-by: Xuyang Dong <dongxuyang@eswincomputing.com>
> ---
> drivers/reset/Kconfig | 9 ++
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-eic7700.c | 249 ++++++++++++++++++++++++++++++++++
> 3 files changed, 259 insertions(+)
> create mode 100644 drivers/reset/reset-eic7700.c
>
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 99f6f9784e68..d6eef5358e13 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -350,6 +350,15 @@ config RESET_ZYNQMP
> help
> This enables the reset controller driver for Xilinx ZynqMP SoCs.
>
> +config RESET_EIC7700
E is not after Z. Don't add your entries to the end. This applies to all
your patches.
> + bool "Reset controller driver for Eswin SoCs"
> + default ARCH_ESWIN
> + help
> + This enables the reset controller driver for Eswin SoCs. This driver is
> + specific to Eswin SoCs and should only be enabled if using such hardware.
> + The driver supports eic7700 series chips and provides functionality for
> + asserting and deasserting resets on the chip.
> +
> source "drivers/reset/amlogic/Kconfig"
> source "drivers/reset/starfive/Kconfig"
> source "drivers/reset/sti/Kconfig"
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index 31f9904d13f9..2210c4e55834 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -44,3 +44,4 @@ obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
> obj-$(CONFIG_RESET_UNIPHIER_GLUE) += reset-uniphier-glue.o
> obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o
> obj-$(CONFIG_RESET_ZYNQMP) += reset-zynqmp.o
> +obj-$(CONFIG_RESET_EIC7700) += reset-eic7700.o
E is not after Z.
> +static int eswin_reset_probe(struct platform_device *pdev)
> +{
> + struct eswin_reset_data *data;
> + struct device *parent;
> +
> + parent = pdev->dev.parent;
> + if (!parent) {
> + dev_err(&pdev->dev, "no parent\n");
Not possible. Fix your DTS otherwise.
> + return -ENODEV;
> + }
> +
> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + data->regmap = syscon_node_to_regmap(parent->of_node);
> + if (IS_ERR(data->regmap)) {
> + dev_err(&pdev->dev, "failed to get parent regmap\n");
> + return PTR_ERR(data->regmap);
Syntax is always: return dev_err_probe. You already got such comment.
All your patches repeat the same issues.
> + }
> +
> + platform_set_drvdata(pdev, data);
> +
> + data->rcdev.owner = THIS_MODULE;
> + data->rcdev.ops = &eswin_reset_ops;
> + data->rcdev.of_node = pdev->dev.of_node;
> + data->rcdev.of_reset_n_cells = 2;
> + data->rcdev.of_xlate = eswin_reset_of_xlate;
> + data->rcdev.dev = &pdev->dev;
> + data->dev = &pdev->dev;
> + idr_init(&data->idr);
> +
> + /*clear boot flag so u84 and scpu could be reseted by software*/
> + regmap_set_bits(data->regmap, SYSCRG_CLEAR_BOOT_INFO_OFFSET,
> + CLEAR_BOOT_FLAG_BIT);
> + msleep(50);
> + platform_set_drvdata(pdev, data);
Drop, no need to do it twice.
> +
> + return devm_reset_controller_register(&pdev->dev, &data->rcdev);
> +}
> +
> +static void eswin_reset_remove(struct platform_device *pdev)
> +{
> + struct eswin_reset_data *data = platform_get_drvdata(pdev);
> +
> + idr_destroy(&data->idr);
> +}
> +
> +static struct platform_driver eswin_reset_driver = {
> + .probe = eswin_reset_probe,
> + .remove = eswin_reset_remove,
> + .driver = {
> + .name = "eswin-reset",
> + .of_match_table = eswin_reset_dt_ids,
> + },
> +};
> +
> +static int __init eswin_reset_init(void)
> +{
> + return platform_driver_register(&eswin_reset_driver);
> +}
> +arch_initcall(eswin_reset_init);
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-05-16 13:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 0:29 [PATCH 0/2] Add driver support for ESWIN eic7700 SoC reset controller dongxuyang
2025-05-14 0:31 ` [PATCH 1/2] dt-bindings: reset: eswin: Documentation for eic7700 SoC dongxuyang
2025-05-14 1:35 ` Rob Herring (Arm)
2025-05-14 13:30 ` Rob Herring
2025-05-16 13:27 ` Krzysztof Kozlowski
2025-05-14 0:32 ` [PATCH 2/2] reset: eswin: Add eic7700 reset driver dongxuyang
2025-05-16 13:25 ` Krzysztof Kozlowski [this message]
2025-05-16 15:48 ` Christophe JAILLET
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=f6fbc6f6-aaba-4303-9c2f-fc985a2a3c83@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dongxuyang@eswincomputing.com \
--cc=huangyifeng@eswincomputing.com \
--cc=krzk+dt@kernel.org \
--cc=linmin@eswincomputing.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ningyu@eswincomputing.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@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®