GPIO value does not change

Hi,

I am trying to connect the TX2 to another device via the GPIO. From another thread I was able to figure out that the GPIO numbers on the J21 are as follows:-

Pin 37 (GPIO8_ALS_PROX_INT) is GPIO 388
Pin 33 (GPIO11_AP_WAKE_BT) is GPIO 389

I used Pin 33 for this experiment and used the following commands on Linux to export the GPIO to user space

echo 389 > export
echo in > gpio389/direction
cat gpio389/value

I see that the value is set to 1 right now. I am now toggling the GPIO from the other device which I also verified on the oscilloscope. But the value always remains 1 and does not change.

Is there anything I am missing?

Hi skulldemon

Could you help to verify programing as output pin is working or not?

The Platform Adaptation & Bring Up Guide states the following:-

$ dmesg | grep gpiochip_add_data
[ 1.247404] gpiochip_add_data: registered GPIOs 320 to 511 on device: tegra-gpio
[ 1.262595] gpiochip_add_data: registered GPIOs 256 to 319 on device: tegra-gpio-aon

However on my setup I was seeing the following:-

[ 0.281055] gpiochip_add_data: registered GPIOs 448 to 511 on device: tegra-gpio-aon
[ 0.330214] gpiochip_add_data: registered GPIOs 256 to 447 on device: tegra-gpio
[ 0.363112] gpiochip_add_data: registered GPIOs 240 to 255 on device: tca9539
[ 0.365059] gpiochip_add_data: registered GPIOs 224 to 239 on device: tca9539
[ 0.386226] gpiochip_add_data: registered GPIOs 216 to 223 on device: max77620-gpio

There were some changes to enable the SPIDev which were done. But I dont think those changes could have impacted the GPIO driver. So I guess need to use GPIO 324, 325 instead of GPIO 388, 389.

Do you know which GPIO can be used with interrupts? Is there any limitation there?

I believe there’s no any limitation. Any of them can be used with interrupts.