Re: GPIO subsystem and interrupts -- no way to do rising & falling edge on same pin?

Jason Thorpe <[email protected]> Tue, 15 May 2018 07:17:30 -0400
Newsgroups gmane.os.netbsd.devel.embedded
Message-ID <[email protected]>

> On May 15, 2018, at 7:14 AM, Manuel Bouyer <[email protected]> =
wrote:
>=20
> On Wed, May 02, 2018 at 07:28:21PM -0700, Jason Thorpe wrote:
>> I?m working on integrating the changes in kern/51676, but I seem to =
have stumbled into a glaring deficiency into how the GPIO subsystem =
supports interrupts.
>>=20
>> Specifically, it does not seem like there is a way to trigger an =
interrupt on both the rising and falling edge of an event.  This is =
something that, for example, the Raspberry Pi?s SoC can do (and =
something I have use for in my application).  But alas, it seems as if =
the presence of GPIO_PIN_FALLING indicates falling, and the lack of it =
indicates rising.
>>=20
>> Unfortunately, we?re nearly out of bits ? there?s just one left, and =
so I?m hesitant to burn it to indicate both, especially since there are =
other capabilities that would be nice to expose (such as the Broadcom =
SoC?s non-sampled mode, although I don?t really need it immediately, =
myself).
>=20
> So it looks like we'll run out of bits soon anyway. What about =
expanding the
> interface and add the needed compat code (COMPAT_80) ?

I=E2=80=99ve done this =E2=80=94 I=E2=80=99m going to be posting some =
more on this as soon as I=E2=80=99ve tested it (and had Brad Spencer =
verify that the PPS driver he submitted still works correctly with the =
new way).

>=20
> --=20
> Manuel Bouyer <[email protected]>
>     NetBSD: 26 ans d'experience feront toujours la difference
> --

-- thorpej