Re: userspace gpio interrupts / input-output control
Sulev-Madis Silber <[email protected]>
| Newsgroups | gmane.os.freebsd.current |
|---|---|
| Message-ID | <[email protected]> |
oh, target would be armv7 / arm64 i forgot that x86 with gpio also exists. and embedded x86 is a thing and riscv and what else too but idea was to make basic gpio interrupt watching available without writing a c on platforms that have this seems like i might finally get it working again after 12 years but this time i want to put it somewhere in base where it stays in sync with kernel right now i grepped the whole tree multiple times and only place where it's used is in tests so i wish something in gpioctl or devd for things with reset buttons, etc. possibly with debounce. and references in manpages. and several examples for people wanting more unsure how to make them all myself tho it would have been a lot better if i would have found something under /usr/share/examples/gpio/*.c On August 16, 2026 8:13:35 PM GMT+03:00, Ruslan Zalata <[email protected]> wrote: >Hello Sulev-Madis, > >What's your target platform ? > >I recently discovered that GPIO interrupts are not supported in "GPIO Bus" driver on x86 platforms because of lack of INTRNG support (simply not implemented). I found a 6-year old diff D26407 from avg@ to add this functionally which stuck on review because of some unsolved issues. I renewed avg's patch so it could be applied to -current and posted for review (D57968) again, but it did get much traction too. So, if you are interested in getting GPIO interrupts on x86/amd64 - no luck till gpiobus driver is "fixed". No ideas about arm and others. > >--- >Regards, >Ruslan > >On 2026-08-16 04:09, Sulev-Madis Silber wrote: >> i thought i saw message somewhere here but i lost it >> >> google isn't helping much either >> >> >> <https://github.com/cyclaero/shutdd> >> >> <https://reviews.freebsd.org/D52102> >> >> >> but what's current state of gpio interrupts? >> >> i need simple interface, like a util that i can run which then starts >> printing events on stdout which i can then pipe into shell or perl >> that starts doing actions on this >> >> could even devd? >> >> currently there's nothing in base nor ports. everyone needing this >> function would need to read manpages, googling and so on. and then >> come up with c code >> >> i once did that too >> >> but i don't want to forge hammer each time i want to bang a nail into >> wall! i just want to grab hammer, and bang, nail is in >> >> that needs to be solved somehow >> >> io output control is bit problematic too >> >> but i was able to take old gonzoua wrappers for python/ruby/perl. take >> perl part of it. it still works. it seems like bad test code from 2013 >> >> for output, it would also be good to run something that accepts things >> from stdin >> >> so it would be like "gpio-input | program | gpio-output" >> >> or it would fork those as children inside >> >> anything that could make my life easier >> >> people in linux have probably understood how hard is to write code so >> they exposed all of this as virtual "files" or devices >> >> unsure what could be done here >> >> this is 12 year old issue actually >> >> i probably, with a ton of cursing, can come up with something and then >> publish it so noone else would ask it again >> >> however there must be many much better c coders here? >> >> possibly i would want it in base but port will do. considering >> maintaining it too. but i find c so hard >> >> seems like speed is not really an issue here, considering i did >> >> <http://ketas.si.pri.ee/misc/ws2812/ws2812.html> >> >> which does realtime animations with perl/ssh/spi util (which i >> patched) piped together >> >> it took massive effort from me >> >> so i'm looking ways to minimize this effort for people who want to script on hw >