Re: [PATCH 06/11] gpio: Add NVIDIA LSTP GPIO driver

From: Linus Walleij

Date: Fri Oct 16 2026 - 17:18:34 EST


On Fri, Oct 16, 2026 at 10:19 AM Adrian Ambrozewicz
<aambrozewicz@xxxxxxxxxx> wrote:

> > It seems some pins are only input and some are only output.
> >
> > Have you considered using serialized register access over
> > regmap and use regmap-gpio with fixed direction bitmaps?
>
> Yes, the device configuration fixes each pin's direction. I looked at
> gpio-regmap: a regmap bus with one register per pin would cover get,
> set and the fixed directions. Two parts don't fit well, though.
> gpio-regmap has no get_multiple/set_multiple, while the device takes
> several pins in one request,

So just add it (get/set_multiple) to gpio-regmap.c?

There is a nice generic implementation of get/set_multiple in
drivers/gpio/gpio-mmio.c to draw on for inspiration.

It will certainly make everyone happier.

> What I would take from it is reading the directions once at probe into
> bitmaps, instead of asking the device on every call. Would that be
> acceptable, or would you still prefer gpio-regmap despite the lost
> batching?

I don't quite get it, but I prefer gpio-regmap with an extended
gpio-regmap.

I guess it could be challenging, but I'm here to challenge
people. ;) If it looks very tricky ask for help.

Yours,
Linus Walleij