i.mx6 GPIO -> userspace IRQ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx6 GPIO -> userspace IRQ

2,284 Views
thomaswenzel
Contributor I

Hi,

I need to have a GPIO pin (in this case GPIO7 on an i.mx6 Solo) generate an interrupt that can be picked up by a process running in user space. My kernel is 3.10.17.

Is there some tutorial how to do this somewhere?

My questions are:

1. What do I need to set up in the device tree file to make this pin generate an interrupt?

2. I've heard about picking up interrupts from user space by opening a new /proc file (/proc/irq/nn/irq) where nn is the interrupt number.

Reading from this file will then block until the next interrupt occurs.

select() and poll() are also supposed to work with this file.

Will this be possible with the 3.10.17 kernel, and if yes, how do I find out the linux-side interrupt number of the interrupt generated by GPIO7?

Thanks,

Thomas

Labels (2)
0 Kudos
2 Replies

789 Views
igorpadykov
NXP Employee
NXP Employee

789 Views
gary_bisson
Senior Contributor III

Hi Thomas,

The easiest solution is to use the sysfs GPIO entries to setup your GPIO and poll the value. The kernel documentation explains it pretty well:

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

Then you can find examples online:

Gpio-int-test.c - RidgeRun Developer Connection

Regards,

Gary

0 Kudos