i.mx6 GPIO -> userspace IRQ

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.mx6 GPIO -> userspace IRQ

2,965 次查看
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

标签 (2)
0 项奖励
回复
2 回复数

1,470 次查看
igorpadykov
NXP Employee
NXP Employee

1,470 次查看
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 项奖励
回复