From: Jisheng Zhang <jszhang@kernel.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Frank Li <Frank.Li@nxp.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-i3c@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] i3c: dw: switch to array-based exclusive reset control
Date: Mon, 5 Oct 2026 23:24:24 +0800 [thread overview]
Message-ID: <20261005152425.25319-3-jszhang@kernel.org> (raw)
In-Reply-To: <20261005152425.25319-1-jszhang@kernel.org>
The Synopsys DesignWare I3C master controller can have multiple reset
lines, such as a core reset and APB reset.
Refactor the driver to use devm_reset_control_array_get_exclusive()
instead of a single named reset handle. This automatically manages all
resets allocated to the device node sequentially.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
drivers/i3c/master/dw-i3c-master.c | 24 ++++++++++++++++++------
drivers/i3c/master/dw-i3c-master.h | 2 +-
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 4563d8761ba0..1c6c870f5bb3 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1657,6 +1657,11 @@ static const struct dw_i3c_platform_ops dw_i3c_platform_ops_default = {
.set_dat_ibi = dw_i3c_platform_set_dat_ibi_nop,
};
+static void dw_i3c_resets_assert(void *data)
+{
+ reset_control_assert(data);
+}
+
int dw_i3c_common_probe(struct dw_i3c_master *master,
struct platform_device *pdev)
{
@@ -1696,10 +1701,17 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->pclk))
return PTR_ERR(master->pclk);
- master->core_rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
- NULL);
- if (IS_ERR(master->core_rst))
- return PTR_ERR(master->core_rst);
+ master->resets = devm_reset_control_array_get_optional_exclusive(&pdev->dev);
+ if (IS_ERR(master->resets))
+ return PTR_ERR(master->resets);
+
+ ret = reset_control_deassert(master->resets);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(&pdev->dev, dw_i3c_resets_assert, master->resets);
+ if (ret)
+ return ret;
spin_lock_init(&master->xferqueue.lock);
INIT_LIST_HEAD(&master->xferqueue.list);
@@ -1873,7 +1885,7 @@ static int __maybe_unused dw_i3c_master_runtime_suspend(struct device *dev)
dw_i3c_master_disable(master);
- reset_control_assert(master->core_rst);
+ reset_control_assert(master->resets);
dw_i3c_master_disable_clks(master);
pinctrl_pm_select_sleep_state(dev);
return 0;
@@ -1885,7 +1897,7 @@ static int __maybe_unused dw_i3c_master_runtime_resume(struct device *dev)
pinctrl_pm_select_default_state(dev);
dw_i3c_master_enable_clks(master);
- reset_control_deassert(master->core_rst);
+ reset_control_deassert(master->resets);
dw_i3c_master_set_intr_regs(master);
dw_i3c_master_restore_timing_regs(master);
diff --git a/drivers/i3c/master/dw-i3c-master.h b/drivers/i3c/master/dw-i3c-master.h
index 17ad817d1f8e..f5b4491b247a 100644
--- a/drivers/i3c/master/dw-i3c-master.h
+++ b/drivers/i3c/master/dw-i3c-master.h
@@ -36,7 +36,7 @@ struct dw_i3c_master {
} xferqueue;
struct dw_i3c_master_caps caps;
void __iomem *regs;
- struct reset_control *core_rst;
+ struct reset_control *resets;
struct clk *core_clk;
struct clk *pclk;
char version[5];
--
2.53.0
next prev parent reply other threads:[~2026-10-05 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 15:24 [PATCH v2 0/3] i3c: dw: Support Synaptics sl2610 i3c Jisheng Zhang
2026-10-05 15:24 ` [PATCH v2 1/3] dt-bindings: i3c: dw: support up to two reset lines Jisheng Zhang
2026-10-05 15:24 ` Jisheng Zhang [this message]
2026-10-05 15:24 ` [PATCH v2 3/3] dt-bindings: i3c: Add Synaptics sl2610 i3c Jisheng Zhang
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=20261005152425.25319-3-jszhang@kernel.org \
--to=jszhang@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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®