[PATCH 2/2] clk: en7523: add a reset operation

Philipp Zabel p.zabel at pengutronix.de
Wed Nov 11 01:49:06 PST 2026


On Mi, 2026-11-11 at 09:56 +0100, John Crispin wrote:
> The reset controller implements assert, deassert and status but not
> reset, so device_reset() fails with -ENOTSUPP. The i2c-mt7621 driver
> calls it at probe and after a transfer timeout.

Is the i2c-mt7621 driver actually used with any reset controller that
implements .reset but not .assert/.deassert?

If not, it would be better to let i2c-mt7621 use
reset_control_assert/deassert() instead of adding .reset ops to all
reset controller drivers it is used with.

The .reset op is for (compatibility with) self-deasserting resets.

> Every I2C bus that
> references an SCU reset, as on the EN7581 and the AN7589, therefore
> logs "I2C reset failed!" and is never reset.
> 
> Add a reset operation that asserts and then deasserts the line, as the
> MT7621 reset controller does for the same I2C block.
> 
> Signed-off-by: John Crispin <john at phrozen.org>
> ---
>  drivers/clk/clk-en7523.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
> index 8f63482cbb7b..eb893259d470 100644
> --- a/drivers/clk/clk-en7523.c
> +++ b/drivers/clk/clk-en7523.c
> @@ -818,6 +818,18 @@ static int en7523_reset_deassert(struct reset_controller_dev *rcdev,
>  	return en7523_reset_update(rcdev, id, false);
>  }
>  
> +static int en7523_reset_reset(struct reset_controller_dev *rcdev,
> +			      unsigned long id)
> +{
> +	int ret;
> +
> +	ret = en7523_reset_assert(rcdev, id);
> +	if (ret)
> +		return ret;

Is having no delay here valid for all possible reset consumers or are
we implicitly assuming that this will only ever be used for specific
i2c resets?

regards
Philipp



More information about the Linux-mediatek mailing list