Re: [RFC v2 2/5] pinctrl: add generic functions + pins mapper

Linus Walleij
2025-12-26T09:29:42Z

Hi Conor,

sorry for being slow in reviews!

On Thu, Nov 27, 2025 at 11:58 AM Conor Dooley <conor@kernel.org> wrote:

> +config GENERIC_PINCTRL_BELLS_AND_WHISTLES

Interesting name :D

A bit like GENERIC_PINCTRL_LOCK_STOCK_AND_BARREL.

Have you considered simply GENERIC_PINCTRL?

> +obj-$(CONFIG_GENERIC_PINCTRL_BELLS_AND_WHISTLES) += pinctrl-generic.o

especially since the file is named like so...

> +/*
> + * For platforms that do not define groups or functions in the driver, but
> + * instead use the devicetree to describe them. This function will, unlike
> + * pinconf_generic_dt_node_to_map() etc which rely on driver defined groups
> + * and functions, create them in addition to parsing pinconf properties and
> + * adding mappings.
> + */
> +int pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev,
> + struct device_node *np,
> + struct pinctrl_map **maps,
> + unsigned int *num_maps)

All code looks fine.

There is just the philosophical question whether groups and functions should
really be in the device tree, as they can obviously be statically defined and
associated with the compatible.

I got so much pressure to do it this way because so many driver authors really
wanted to keep this in the device tree (usually because it saves memory in the
kernel) that I eventually caved in, and I have also been criticized for being to
lenient on this because the compatible should suffice.

For me this is all fine, and with you submitting this I suppose even the DT
maintainers think this is fine to keep groups and functions in the device
tree, so there it is.

I can merge this when it's out of RFC.

Yours,
Linus Walleij