INTR_POLARITY_BOTH_EDGES?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

INTR_POLARITY_BOTH_EDGES?

Andriy Gapon

What do you think about adding this to intr_polarity ?
I think that it's useful for two reasons:
- support for GPIO interrupts of that kind (GPIO_INTR_EDGE_BOTH)
- symmetry with ACPI's ACPI_ACTIVE_BOTH (which probably exists for GPIO as well)
This new polarity is to be valid only with INTR_TRIGGER_EDGE as the name (and
sanity) implies.

By the way, the name is a open for bikeshedding.
--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: INTR_POLARITY_BOTH_EDGES?

Gary Jennejohn-6
On Tue, 30 Jun 2020 11:22:42 +0300
Andriy Gapon <[hidden email]> wrote:

> What do you think about adding this to intr_polarity ?
> I think that it's useful for two reasons:
> - support for GPIO interrupts of that kind (GPIO_INTR_EDGE_BOTH)
> - symmetry with ACPI's ACPI_ACTIVE_BOTH (which probably exists for GPIO as well)
> This new polarity is to be valid only with INTR_TRIGGER_EDGE as the name (and
> sanity) implies.
>
> By the way, the name is a open for bikeshedding.
>

Seems reasonable, but to my embedded-software developer's ear INTR_ACTIVE_BOTH_EDGES
makes more sense.  I mean, a signal may have a polarity, but an interrupt does not.

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: INTR_POLARITY_BOTH_EDGES?

Andriy Gapon
On 30/06/2020 17:46, Gary Jennejohn wrote:

> On Tue, 30 Jun 2020 11:22:42 +0300
> Andriy Gapon <[hidden email]> wrote:
>
>> What do you think about adding this to intr_polarity ?
>> I think that it's useful for two reasons:
>> - support for GPIO interrupts of that kind (GPIO_INTR_EDGE_BOTH)
>> - symmetry with ACPI's ACPI_ACTIVE_BOTH (which probably exists for GPIO as well)
>> This new polarity is to be valid only with INTR_TRIGGER_EDGE as the name (and
>> sanity) implies.
>>
>> By the way, the name is a open for bikeshedding.
>>
>
> Seems reasonable, but to my embedded-software developer's ear INTR_ACTIVE_BOTH_EDGES
> makes more sense.  I mean, a signal may have a polarity, but an interrupt does not.
>

Well, the enumeration is named intr_polarity and all its existing members are
prefixed with INTR_POLARITY_.  This is probably not the best naming convention
-- in retrospect.  It sounds natural for level interrupts, but somewhat weird
for edge interrupts.  But I'll leave changing it for another day (if ever).

--
Andriy Gapon
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: INTR_POLARITY_BOTH_EDGES?

Gary Jennejohn-6
On Tue, 30 Jun 2020 23:07:22 +0300
Andriy Gapon <[hidden email]> wrote:

> On 30/06/2020 17:46, Gary Jennejohn wrote:
> > On Tue, 30 Jun 2020 11:22:42 +0300
> > Andriy Gapon <[hidden email]> wrote:
> >  
> >> What do you think about adding this to intr_polarity ?
> >> I think that it's useful for two reasons:
> >> - support for GPIO interrupts of that kind (GPIO_INTR_EDGE_BOTH)
> >> - symmetry with ACPI's ACPI_ACTIVE_BOTH (which probably exists for GPIO as well)
> >> This new polarity is to be valid only with INTR_TRIGGER_EDGE as the name (and
> >> sanity) implies.
> >>
> >> By the way, the name is a open for bikeshedding.
> >>  
> >
> > Seems reasonable, but to my embedded-software developer's ear INTR_ACTIVE_BOTH_EDGES
> > makes more sense.  I mean, a signal may have a polarity, but an interrupt does not.
> >  
>
> Well, the enumeration is named intr_polarity and all its existing members are
> prefixed with INTR_POLARITY_.  This is probably not the best naming convention
> -- in retrospect.  It sounds natural for level interrupts, but somewhat weird
> for edge interrupts.  But I'll leave changing it for another day (if ever).
>

OK.  Seems like weird terminology.  But consistency is important

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: INTR_POLARITY_BOTH_EDGES?

John Baldwin
In reply to this post by Andriy Gapon
On 6/30/20 1:22 AM, Andriy Gapon wrote:
>
> What do you think about adding this to intr_polarity ?
> I think that it's useful for two reasons:
> - support for GPIO interrupts of that kind (GPIO_INTR_EDGE_BOTH)
> - symmetry with ACPI's ACPI_ACTIVE_BOTH (which probably exists for GPIO as well)
> This new polarity is to be valid only with INTR_TRIGGER_EDGE as the name (and
> sanity) implies.
>
> By the way, the name is a open for bikeshedding.

Sounds ok to me.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"