[RFC v1 0/4] generic pinmux dt_node_to_map implementation

From: Conor Dooley

Date: Wed May 06 2026 - 06:08:56 EST


From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

Hey Linus,

Whipped this up last week, at to a first glance it appears to work,
although the spacemit platform I've used to implement this has very
limited in-tree use of pinctrl so it is hard to be sure.

What I don't love though is how similar the functions
pinctrl_generic_pins_function_dt_node_to_map() and
pinctrl_generic_pinmux_dt_node_to_map() are - essentially identical
other than which function they in turn call.

Basically, I wanna know if you think that that is acceptable, or if
you'd rather see something that's totally generic between the two
and figures out which foo_dt_subnode_to_map() function to call*,
or convert pinctrl_generic_pins_function_dt_node_to_map() and
pinctrl_generic_pinmux_dt_node_to_map() to wrappers that pass a function
pointer of the appropriate foo_dt_subnode_to_map() to a shared node
parsing function, or some third option that I have not considered.

If you try to apply this, it's on top of Frank's mux series. It's also
here if any of the spacemit-ters want to look at what I did to their
driver:
https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/log/?h=spacemit-pinctrl

None of the patches have real commit messages due to this being RFC :)

Cheers,
Conor.

* pinmux/pins + functions/groups + functions I think are the only
really valid combinations here, so it wouldn't be too difficult to
arrange that logic.

CC: Linus Walleij <linusw@xxxxxxxxxx>
CC: Yixun Lan <dlan@xxxxxxxxxx>
CC: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
CC: Troy Mitchell <troy.mitchell@xxxxxxxxxxxxxxxxxx>
CC: linux-gpio@xxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
CC: linux-riscv@xxxxxxxxxxxxxxxxxxx
CC: spacemit@xxxxxxxxxxxxxxx

Conor Dooley (4):
pinctrl: generic: change signature of pinctrl_generic_to_map() to pass
void data
pinctrl: add new generic groups/function creation function for pinmux
pinctrl: spacemit: delete check_power()
pinctrl: spacemit: move over to generic pinmux dt_node_to_map
implementation

drivers/pinctrl/pinconf.h | 20 +++-
drivers/pinctrl/pinctrl-generic.c | 139 +++++++++++++++++++++++++-
drivers/pinctrl/spacemit/pinctrl-k1.c | 70 +++----------
3 files changed, 164 insertions(+), 65 deletions(-)

--
2.53.0