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
Unknown Object (File)
Fri, Dec 20, 6:22 AM
Unknown Object (File)
Fri, Dec 20, 5:12 AM
Unknown Object (File)
Fri, Dec 20, 4:05 AM
Unknown Object (File)
Thu, Dec 19, 10:37 PM
Unknown Object (File)
Tue, Dec 10, 5:18 AM
Unknown Object (File)
Tue, Nov 26, 4:00 AM
Unknown Object (File)
Oct 29 2024, 12:13 PM
Unknown Object (File)
Oct 28 2024, 1:06 AM
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
No Lint Coverage
Unit
No Test Coverage

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

Probably needs to be removed before committing.

422

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).