GPIO numbering and ucidef_add_gpio_switch in kernel 6.6

Andrey Jr. Melnikov temnota.am at gmail.com
Tue Apr 16 03:23:31 PDT 2024


Robert Marko <robimarko at gmail.com> wrote:
> On Mon, 18 Mar 2024 at 06:31, Mathew McBride <matt at traverse.com.au> wrote:
> >
> > Hi all,
> >
> > A change in kernel 6.2 ("gpio: Get rid of ARCH_NR_GPIOS (v2)") [1] resulted in the GPIO chip base numbers changing on some architectures (x86, arm and arm64 were directly modified in that series).
> >
> > This may cause issues with /etc/board.d/03_gpio_switches scripts as the GPIO numbers will change when moving to the 6.6 kernel.

> Hi Matthew,
> This has been an issue for a while as GPIO numbers are not stable and
> have never been guaranteed so.

I think we need some helper to find gpioswitch base number by bus-address or
name in /sys/class/gpio/gpiochip*/{label,device/name}




More information about the openwrt-devel mailing list