gpio fiddling from userspace [Was: Re: gpio-mt7621 offset fix for 5.10 kernel series]

Petr Štetiar ynezz at true.cz
Tue Oct 18 23:55:36 PDT 2022


Lukas Zeller <luz at plan44.ch> [2022-10-18 23:10:48]:

Hi,

> I did investigate this in June on this list [1] and in the openwrt forum [2]
> and tried to ask some questions about the right way to handle this, but
> apparently it did not echo for some reason back then.

IMO there should be `ugpiod` daemon available over ubus, probably written in
ucode using libgpiod bindings. It should provide ubus events for GPIO inputs
and should be able to control GPIO outputs using ubus calls.

Bjørn Mork <bjorn at mork.no> [2022-10-19 08:24:44]:

> 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?

Yes, that is my[1] understanding as well.

1. https://github.com/openwrt/openwrt/pull/1366#issuecomment-444177376

-- ynezz



More information about the openwrt-devel mailing list