Re: intr notification when a gpio changes?

Sulev-Madis Silber <[email protected]> Mon, 15 Jun 2026 02:05:49 +0300
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>

On June 15, 2026 1:53:11 AM GMT+03:00, Ahmad Khalifa <ahmadkhalifa570@gmai=
l=2Ecom> wrote:
>On Mon Jun 15, 2026 at 12:28 AM +0300, Bjoern A=2E Zeeb wrote:
>> Hi,
>>
>> sorry for asking here but I figured most knowledgeable people will be h=
ere=2E
>>
>> I need to be able from a kernel driver to get a notification if a gpio
>> pin changes=2E
>>
>> I believe to understand that from userspace GPIOSETCONFIG can do the jo=
b,
>> but what's in-kernel API I am looking for?
>
>You can call gpio_alloc_intr_resource to get an interrupt resource, then
>use bus_setup_intr like normal to setup an interrupt=2E
>
>Note that this only works on INTRNG platforms currently=2E There are no
>GPIO interrupts on amd64=2E
>
>sys/dev/gpio/gpioaei=2Ec is a good example of setting up GPIO interrupts=
=2E
>
>>
>> /bz
>


let me hop on this wagon=2E what is the userland option to watch gpios? i'=
m talking about something that could run shell scripts=2E ot be opened as s=
ome device that outputs events

from 10 years ago i modified someone's c example for that

could be nice addon to gpioctl=2E of course if i'm blind and it's there, p=
oint me to it