Linux GPIO user space Interrupts using sysfs

I would like to use interrupts with GPIO in user space using sysfs. I use the following commands:

[ root@at91 ]:gpio109 > echo 109 > export [ root@at91 ]:gpio109 > cd gpio109/ [ root@at91 ]:gpio109 > ll -rw-r--r-- 1 root 0 4096 Jan 1 00:17 direction drwxr-xr-x 2 root 0 0 Jan 1 00:17 power lrwxrwxrwx 1 root 0 0 Jan 1 00:17 subsystem -> ../../gpio -rw-r--r-- 1 root 0 4096 Jan 1 00:17 uevent -rw-r--r-- 1 root 0 4096 Jan 1 00:17 value 

gpio works well, but I cannot use interrupts. I read everywhere, I have to have a face file to poll this file. But on my system this file does not exist. I have made many attempts to find a solution, but I am unsuccessful.

My goal is the AT91SAM9263 on the Linux 2.6.30 kernel.

When loading my board, I received this message on interrupts:

 AT91: 160 gpio irqs in 5 banks 

which show that the at91_gpio_irq_setup() function performed well.

Do you have any ideas?

+4
source share
1 answer

The "edge" file exists only if this GPIO pin can be configured as an interrupt pin. See http://www.mjmwired.net/kernel/Documentation/gpio.txt#634 .

Since you do not see it, this means that the driver and possibly the hardware do not support the use of this GPIO pin for the interrupt source.

+8
source

Source: https://habr.com/ru/post/1389221/


All Articles