gpio-mt7621 offset fix for 5.10 kernel series

Bjørn Mork bjorn at mork.no
Tue Oct 18 23:24:44 PDT 2022


Sergio Paracuellos via openwrt-devel <openwrt-devel at lists.openwrt.org>
writes:

> This is the reason we have 'gpio-line-names' property so you can set
> up names for your pins and use it together with actual user space
> tools libgpiod and gpiod. Any other gpio user space library is
> considered deprecated in these days.

Interesting.  This property doesn't seem to be used much in OpenWrt if
my grep foo is good. It should probably be added at least to every
system where we want to access GPIOs from userspace?

"git grep ucidef_add_gpio_switch" shows lots of good candidates...

For reference, there kernel docs describes 'gpio-line-names' as

    Optionally, a GPIO controller may have a "gpio-line-names"
    property. This is an array of strings defining the names of the GPIO
    lines going out of the GPIO controller. This name should be the most
    meaningful producer name for the system, such as a rail name
    indicating the usage. Package names such as pin name are
    discouraged: such lines have opaque names (since they are by
    definition generic purpose) and such names are usually not very
    helpful. For example "MMC-CD", "Red LED Vdd" and "ethernet reset"
    are reasonable line names as they describe what the line is used
    for. "GPIO0" is not a good name to give to a GPIO line. Placeholders
    are discouraged: rather use the "" (blank string) if the use of the
    GPIO line is undefined in your design. The names are assigned
    starting from line offset 0 from left to right from the passed
    array. An incomplete array (where the number of passed named are
    less than ngpios) will still be used up until the last provided
    valid line index.



Bjørn



More information about the openwrt-devel mailing list