[PATCH 1/4] [PATCH 1/4] reset: simple: Add syscon device compatible

Philipp Zabel p.zabel at pengutronix.de
Fri Feb 14 10:03:17 PST 2025


On Fr, 2025-02-14 at 17:13 +0000, Wilson Ding wrote:
> 
> > -----Original Message-----
> > From: Philipp Zabel <p.zabel at pengutronix.de>
> > Sent: Friday, February 14, 2025 3:54 AM
> > To: Wilson Ding <dingwei at marvell.com>; linux-kernel at vger.kernel.org;
> > devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> > Cc: andrew at lunn.ch; gregory.clement at bootlin.com;
> > sebastian.hesselbarth at gmail.com; robh at kernel.org; krzk+dt at kernel.org;
> > conor+dt at kernel.org; Sanghoon Lee <salee at marvell.com>; Geethasowjanya
> > Akula <gakula at marvell.com>
> > Subject: [EXTERNAL] Re: [PATCH 1/4] [PATCH 1/4] reset: simple: Add syscon
> > device compatible
> > 
> > On Do, 2025-02-13 at 22:58 -0800, Wilson Ding wrote:
> > > Introduce the new ops for updating reset line and getting status.
> > > Thus, the reset controller can be accessed through either direct I/O
> > > or regmap interfaces.
> > 
> > Please don't add a new layer of function pointer indirection, just add a new
> > struct reset_control_ops for the regmap variant.
> > 
> 
> If just adding a new struct reset_control_ops for the regmap variant, almost
> all the functions will be duplicated for regmap variant. 
> Besides reset_simple_regmap_assert/deassert(), we also need to have the
> regmap version of reset_simple_update().

Yes. You could also duplicate/fold update() into assert/deassert().
It is trivial enough and the compiler will do that anyway.

> Since reset_simple_reset() invokes
> reset_simple_regmap_assert/deassert(), it also needs to be
> duplicated.

That one could go through the data->rcdev.ops->assert/deassert function
pointers and be reused. But I wonder if that one function is worth the
added complexity.

> In this case, there will be too many redundant codes in this file. I doubt if
> it is worth to use the reset simple code. Maybe it's better to fork a new file
> for the syscon device, such as 'reset-simple-syscon.c'. What do you say?

That sounds sensible to me.

regards
Philipp



More information about the linux-arm-kernel mailing list