[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2A293BCA6504D560+aR2zQzsDieMGOva5@troy-wujie14pro-arch>
Date: Wed, 19 Nov 2025 20:08:35 +0800
From: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
To: Encrow Thorne <jyc0019@...il.com>,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>,
Andi Shyti <andi.shyti@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>
Cc: Troy Mitchell <troymitchell988@...il.com>, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
spacemit@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] i2c: k1: add reset support
Hi Encrow,
On Wed, Nov 19, 2025 at 07:46:44PM +0800, Encrow Thorne wrote:
> Add reset control handling to the K1 I2C driver.
>
> Signed-off-by: Encrow Thorne <jyc0019@...il.com>
> ---
> drivers/i2c/busses/i2c-k1.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-k1.c b/drivers/i2c/busses/i2c-k1.c
> index 6b918770e612..64d817d8315d 100644
> --- a/drivers/i2c/busses/i2c-k1.c
> +++ b/drivers/i2c/busses/i2c-k1.c
> @@ -10,6 +10,7 @@
> #include <linux/module.h>
> #include <linux/of_address.h>
> #include <linux/platform_device.h>
> + #include <linux/reset.h>
>
> /* spacemit i2c registers */
> #define SPACEMIT_ICR 0x0 /* Control register */
> @@ -113,6 +114,7 @@ struct spacemit_i2c_dev {
> void __iomem *base;
> int irq;
> u32 clock_freq;
> + struct reset_control *resets;
>
> struct i2c_msg *msgs;
> u32 msg_num;
> @@ -571,6 +573,15 @@ static int spacemit_i2c_probe(struct platform_device *pdev)
> if (IS_ERR(clk))
> return dev_err_probe(dev, PTR_ERR(clk), "failed to enable bus clock");
>
> + i2c->resets = devm_reset_control_get_optional(dev, NULL);
> + if (IS_ERR(i2c->resets))
> + return dev_err_probe(dev, PTR_ERR(i2c->resets),
> + "failed to get reset\n");
Please align.
> +
> + reset_control_assert(i2c->resets);
> + udelay(2);
This seems to be a very small value. If this
has been verified multiple times?
- Troy
> + reset_control_deassert(i2c->resets);
> +
> spacemit_i2c_reset(i2c);
>
> i2c_set_adapdata(&i2c->adapt, i2c);
>
> --
> 2.25.1
>
>
Powered by blists - more mailing lists