Hi, All,
I am working on sabresd board with imx7. I want to make user button 1 as interruptible gpio. I have followed the following steps:
as in schematics, user button 1 is connected to SD2_WP pad. From trm, we see that alt 5 functionality for the same pad is gpio 5(ALT5_GPIO5_IO10).
In imx7d-sdb.dts file doing the pad control changes:
pinctrl_gpio: gpiogrp {
fsl,pins = <
MX7D_PAD_SD2_WP__GPIO5_IO10 0x14
>;
};
Now, have written a small module which does the following:
(1)set 10th bit of 0x3024000C(setting 10th bit of GPIO5_EDGE_SEL). I also tried setting 20-21st bit of GPIO5_ICR1 to 10 or 11, but didnot work
(2)set 10th bit of GPIO5_IMR
(3)reset 10th bit of GPIO5_GDIR
(4)set request_irq to 172 as returned value from, gpio_to_irq(138)=172
Q1)I am not seeing any interrupt generated on pressing of user button 1 key. Wonder where I am going wrong.
Q2)I saw somewhere in datasheet the irq for gpio5 is 72, why gpio_to_irq returns 172?
Q3) Is there any better way to do? maybe just by changes in dts file? I am not sure if /proc/interrupts entry can get generated by just change in dts file.
Thanks for the help.