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)
Wed, May 15, 2:42 PM
Unknown Object (File)
Fri, May 10, 1:24 PM
Unknown Object (File)
Mon, May 6, 6:26 AM
Unknown Object (File)
Mon, May 6, 6:25 AM
Unknown Object (File)
Sun, May 5, 5:31 PM
Unknown Object (File)
Sun, May 5, 5:06 PM
Unknown Object (File)
Sun, May 5, 5:05 PM
Unknown Object (File)
Sun, May 5, 5:04 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
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).