[PATCH 05/20] i3c: dw: switch to array-based exclusive reset control

Philipp Zabel p.zabel at pengutronix.de
Mon Oct 19 05:55:21 PDT 2026


On Di, 2026-09-29 at 14:14 +0800, Jisheng Zhang wrote:
> 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.

Note that this does not guarantee any particular order. Are you sure
that this is good enough for all implementations of the DW I3C core?

Otherwise it may be wise to at least specify the names in binding, to
be able to switch to the bulk API or individual control later, if
needed.

> Signed-off-by: Jisheng Zhang <jszhang at kernel.org>
> ---
>  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;

This looks like we are missing
devm_reset_control_array_get_optional_exclusive_deasserted().

regards
Philipp



More information about the linux-i3c mailing list