Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notify gpio interrupt to user space from a kernel module [closed]

I have a code which detects GPIO interrupt in a kernel module. Now,I am looking for a mechanism to notify user space upon detecting gpio interrupt from kernel module. Any example / code snippet with certain advantages/disadvantages over different options? I would appreciate your response.

like image 402
user1867459 Avatar asked Oct 21 '22 21:10

user1867459


1 Answers

Take a look at the GPIO keyboard driver (drivers/input/keyboard/gpio_keys.c). It is a good starting point for your problem.

In the userspace you then listen (some blocking read for example, or just tail to test) to /dev/input/yourevent for events.

like image 191
Ortwin Angermeier Avatar answered Oct 24 '22 00:10

Ortwin Angermeier