Hi,
in the following link you will find the code for a .ko module which handles a GPIO interrupt and the device tree configuration required for this.
Issue with configuring GPIO as an interrupt - i.MX6Q
For the shell command you can just use a system call E.g. sytem("command");
Regards,
Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------