[PATCH v9 6/7] pinctrl: s32cc: implement GPIO functionality

Linus Walleij linusw at kernel.org
Mon Jun 8 15:33:43 PDT 2026


Hi Khristine,

On Tue, Jun 2, 2026 at 10:05 AM Khristine Andreea Barbulescu
<khristineandreea.barbulescu at oss.nxp.com> wrote:

> The new version (v10) has been updated to use gpio-regmap, with a virtual
> regmap bridge dispatching GPIO accesses to the underlying SIUL2 register
> blocks.
>
> I am not fully convinced this is the cleanest model, though.
> SIUL2 does not expose GPIO as one regular register space: direction is in
> MSCR, input values are read from PGPDI, and output values are written through
> PGPDO. These are backed by separate regmaps in the driver, while gpio-regmap
> expects a single regmap.

OK I did miss that detail earlier, I definitely thought it was using a single
regmap.

> So the current path becomes:
>   gpio-regmap -> virtual regmap -> MSCR/PGPDI/PGPDO regmap
>
> The version was updated this way so we can review the approach on top of the
> current code. If this is still the preferred direction, it can be polished
> further. Otherwise, I think direct gpio_chip callbacks using the existing regmap
> helpers might be a simpler fit for this hardware.
>
> What do you think would be the preferred direction for the next revision?

I'm pretty much happy with either version.

I see your point as to why you don't want to use gpio-regmap.

I also think the virtual regmap thing looks pretty OK, it's complex
but the driver is complex anyway.

What could make the gpio-regmap approach is that it will probably
get extended with get/set_multiple() at some point and then you
will get that improvement for free.

But I think you are the best person to choose what to use here,
if you don't think the virtual regmap looks good, then trust your
intuition and go back to the old design.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list