Re: [PATCH v2 2/2] gpio: axiado: add SGPIO controller support
Linus Walleij <[email protected]> Wed, 29 Jul 2026 22:28:11 +0200
| Newsgroups | org.kernel.vger.linux-gpio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAD++jLnf5g-ZWKNO=zE6Pv6e=v-zTEDWWpWUq+xayjh6Vrzq7Q@mail.gmail.com> |
Hi Petar, thanks for your patch! On Wed, Jul 29, 2026 at 9:02 AM Petar Stepanovic <[email protected]> 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 <[email protected]> (...) > +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