Re: [PATCH v2 2/2] gpio: axiado: add SGPIO controller support

From: Linus Walleij

Date: Wed Jul 29 2026 - 16:28:59 EST


Hi Petar,

thanks for your patch!

On Wed, Jul 29, 2026 at 9:02 AM Petar Stepanovic <pstepanovic@xxxxxxxxxx> wrote:

> Add support for the Axiado SGPIO controller.
>
> Each SGPIO position provides one input GPIO and one output GPIO with
> fixed directions. The driver registers the controller as a gpio_chip,
> supports interrupts on input GPIOs, and uses regmap for register access.
>
> Signed-off-by: Petar Stepanovic <pstepanovic@xxxxxxxxxx>
(...)

> +static int ax3000_sgpio_set(struct gpio_chip *chip, unsigned int offset,
> + int value)
> +static int ax3000_sgpio_get_direction(struct gpio_chip *chip,
> + unsigned int offset)
> +{
> + if (!(offset % 2))
> + return GPIO_LINE_DIRECTION_IN;
> +
> + return GPIO_LINE_DIRECTION_OUT;
> +}

So every second GPIO is input only and every second GPIO is output
only?

How does this look *phycially* on the outside of the chip?

I'm a bit worried that the input and output would be to the same pin or
something, in which case they are the same GPIO line.

The cover letter says " Each SGPIO position provides one fixed-direction
input GPIO and one fixed-direction output GPIO." and I'm suspicious
about this.

What is an "SGPIO position"?

If a position is something like a physical line controlled by both an
input and an output driver block, it is the same GPIO line in Linux
terms, it will be used as output if a LED is connected there and
it will be used as input if a key is connected there, and we have
64 or 128 GPIOs, not 128 or 256.

> +static int ax3000_sgpio_get(struct gpio_chip *chip, unsigned int offset)
> +{
> +static int ax3000_sgpio_dir_in(struct gpio_chip *chip, unsigned int offset)
> +static int ax3000_sgpio_dir_out(struct gpio_chip *chip, unsigned int offset,

The GPIO line handling looks like:

1. some translation
2. Standard things

which is usually what we use regmap-gpio for, and we have added a few
features to it recently. Some are even in linux-next, can you check it out
and see if you could use the library?

Yours,
Linus Walleij