Page MenuHomeFreeBSD

Add basic support to GPIO interrupts on gpiobus and ofw_gpiobus
ClosedPublic

Authored by loos on Oct 23 2014, 5:17 PM.
Tags
None
Referenced Files
F82758923: D999.diff
Thu, May 2, 8:54 AM
Unknown Object (File)
Feb 19 2024, 11:05 AM
Unknown Object (File)
Feb 15 2024, 8:49 AM
Unknown Object (File)
Dec 25 2023, 7:51 AM
Unknown Object (File)
Dec 22 2023, 9:21 AM
Unknown Object (File)
Nov 3 2023, 4:41 AM
Unknown Object (File)
Sep 16 2023, 1:01 AM
Unknown Object (File)
Sep 11 2023, 11:35 PM
Subscribers

Details

Summary

This patch adds the necessary bus support to support GPIO interrupts at kernel.

What is missing:

  • changes to backend drivers (add the support to each GPIO controller); ATM I've the changes for bcm2835_gpio (RPi), ti_gpio (BBB, OMAP4) and AR71xx. The changes are under testing and they can be committed independently from this code.
  • Userland notification. The plan is feed the interrupt events to userland using a cdev. The readers should register their interest on the pin(s) and then each interrupt will generate an event describing the interrupt (pin level, time since the last change). As this part adds the most of complexity for this change it would be simpler and easier to review if we add it later.

What works:

  • Kernel interrupts. Any GPIO device can now request the use of one (or more) of its mapped pins to be used as an interrupt (using the generic newbus methods to setup and activate the interrupt).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

loos retitled this revision from to Add basic support to GPIO interrupts on gpiobus and ofw_gpiobus.
loos updated this object.
loos edited the test plan for this revision. (Show Details)
loos added a reviewer: ARM.

After committing the unrelated changes, we've the bare minimum to implement the interrupt support at gpiobus level.

rpaulo added a reviewer: rpaulo.
rpaulo added a subscriber: rpaulo.
rpaulo added inline comments.
sys/dev/gpio/gpiobus.c
41 ↗(On Diff #2101)

Probably needs to be removed before committing.

422 ↗(On Diff #2101)

I think it's easier to read if you remove the NEQ comparator and the parenthesis.

This revision is now accepted and ready to land.Oct 24 2014, 4:08 AM

This work will be supplanted by the work in intrng branch... so i'm now uncertain about it.

loos updated this revision to Diff 2443.

Closed by commit rS274638 (authored by @loos).