Hello,
I am developing a gpio driver. But some gpio calls dont work.
Here is my dts entry;
my_nvidia_gpio {
compatible = “my,nvidia-gpio”;
status = “okay”;
in_gpiod = <&tegra_aon_gpio TEGRA194_AON_GPIO(CC, 3) 0>;
out_gpiod = <&tegra_main_gpio TEGRA194_MAIN_GPIO(N, 1) 0>;;
};
First of all when I used gpiod_get to get the descriptor of the pin, it returns NULL. Then I used gpiod_get_optional successfully, but this time if I call gpiod_to_irq, -EINVAL error is returned. Pins are not set as wakeable on my pinmux and they are just standart GPIOs.
I tried to set the pin on terminal as the output shown below:
root@jetson-agx-xavier-industrial:~# echo PCC.03 > /sys/class/gpio/export
root@jetson-agx-xavier-industrial:~# [ 1311.875255] irq: IRQ283: trimming hierarchy from :pmc@c360000
After I set the direction and the edge, the folloiwng line is shown when cat /proc/interrupts is called
283: 0 0 0 0 gpio 15 Edge gpiolib
Which seems everything is ok for the pin.
You can find my complete test code in the attachments.
Can you please help me to understand the problem? Why gpiod_get or gpiod_to_irq doesn’t work?
Best Regards nvidia_my_gpio.txt (3.7 KB)
Hi DaveYY,
Yes if I export, set direction and edge via terminal, it works. But on my code it doesn’t work. I really didn’t understand what is wrong with my code. If you can comment on my code, I’ll appreciate.
Thanx, Regards