gpio-mt7621 offset fix for 5.10 kernel series

Sergio Paracuellos sergio.paracuellos at gmail.com
Tue Oct 18 21:02:07 PDT 2022


On Wed, Oct 19, 2022 at 1:10 AM Rosen Penev <rosenp at gmail.com> wrote:
>
> On Tue, Oct 18, 2022 at 3:50 PM Peter Naulls <peter at chocky.org> wrote:
> >
> > On 10/18/22 17:10, Lukas Zeller wrote:
> > .
> > >
> > > Just not any more - the mt7621 had this too. I currently patch it back into
> > > 22.03's gpio-mt7621.c for my builds and set base in the DTS, see [3]
> > >
> > > I can follow the rationale to get rid of legacy GPIOs, but in the context
> > > of experimenting platforms, where GPIOs are a thing to work with in
> > > user space, there's just no real replacement yet (see details in [1],[2]).
> >
> > Yes, I see.
> >
> > I have a mix of C and scripted GPIO access in my setup, and certainly I can
> > move to libgpiod for that - or just just access them as files with
> > named GPIOs as setup per the DTS.
> Let's CC Sergio, who upstreamed this driver.

For kernel developers, setting base in GPIOs is a no go. You have to
let the kernel to assign its numbers so you can handle different GPIO
layouts with multiple chips.
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.

Best regards,
    Sergio Paracuellos

> >
> > I do see the GPIO shell examples in the OpenWrt wiki, but the code needs
> > more work to deal with multiple banks, and it just makes figuring out
> > the GPIO number to use more clunky without any good cause.
> >
> > Now, the numbered GPIOs really are just for debug in my system, the
> > actual code will use the named ones, but still.
> >
> > Is the long-term intent for shell scripting to instead use the libgpiod
> > tools?
> >
> > https://openwrt.org/docs/techref/hardware/port.gpio
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list