mbox series

[RFC,v2,0/3] Add reset control for mfd syscon devices

Message ID 20221209013309.407879-1-jk@codeconstruct.com.au
Headers show
Series Add reset control for mfd syscon devices | expand

Message

Jeremy Kerr Dec. 9, 2022, 1:33 a.m. UTC
This RFC series adds a facility for syscon devices to control a reset
line when probed; we have instances of simple register-only syscon
resources that need deassertion of a reset line for the register set to
be accessible.

Rather than requiring a specific driver to implement this, it'd be nice
to use the generic syscon device and the generic resets linkage to do
so.

Any comments/queries/etc are most welcome.

Cheers,


Jeremy
---
v2:
 * do reset control in the early of_syscon_register() path, rather than
   the platform device init, which isn't used.
 * consequently, add regmap infrastructure to attach a reset
   controller, in a similar way to attaching clocks

Jeremy Kerr (3):
  dt-bindings: mfd/syscon: Add resets property
  regmap: mmio: allow reset control in a MMIO regmap
  mfd: syscon: allow reset control for syscon devices

 .../devicetree/bindings/mfd/syscon.yaml       |  3 +++
 drivers/base/regmap/regmap-mmio.c             | 22 +++++++++++++++
 drivers/mfd/syscon.c                          | 27 ++++++++++++++-----
 include/linux/regmap.h                        |  3 +++
 4 files changed, 49 insertions(+), 6 deletions(-)

Comments

Jeremy Kerr Dec. 11, 2022, 2:23 a.m. UTC | #1
Hi Mark,

> > A syscon device may need to be taken out of reset before functioning
> > - this change adds a facility to attach a reset control to a mmio
> > regmap, and performs the necessary deassert/assert operations on the
> > reset controller on attach/detach.
> 
> Managment of reset feels like something that should be done at a
> higher level - typically reset also implies losing all the register
> contents which means it should be somewhere above the cache layer.

Yep, that makes sense. I'll rework to do the reset controller handling
in the syscon layer instead - unless there are any objections to that?

Cheers,


Jeremy