Gpio names for using

I need to use 4 gpios for interrupt pin. But I am confusing about the name when i am trying to enable it in my driver code. Software version is R32.3.1

From Hardware design, GPIO07,GPIO11,GPIO12,GPIo13 are in use.
checking into NV_Jetson_Nano_Module_Pinmux_Config_Template.xlsm, these four gpios have below new names.
GPIO07 - GPIO3_PV.00
GPIO12 - GPIO3_PY.02
GPIO11 - GPIO3_PZ.00
GPIO13 - GPIO3_PE.06
I don’t know the means of GPIO3_PV.00/GPIO3_PY.02/GPIO3_PZ.00/GPIO3_PE.06.

So questions from software side:

  1. how to define these gpio in dts file. Are the blows right?

vi tegra210-porg-p3448-common.dtsi
spi@7000d400 {
spi@0 {

interrupts = <&gpio TEGRA_GPIO(V, 0) 1>;

}
spi@1 {
interrupts = <&gpio TEGRA_GPIO(Y, 2) 1>;
}
}

spi@7000d600 {
spi@0 {
interrupts = <&gpio TEGRA_GPIO(Z, 0) 1>;
}
spi@1 {
interrupts = <&gpio TEGRA_GPIO(E, 6) 1>;
}

  1. Refer to the output of /sys/kernel/debug/tegra_gpio, what’re the name/bank/port of these 4 gpio?

root@yisp-desktop:~# cat /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
A: 0:0 64 40 40 04 00 00 000000
B: 0:1 00 00 00 00 00 00 000000
C: 0:2 00 00 00 00 00 00 000000
D: 0:3 00 00 00 00 00 00 000000
E: 1:0 00 00 00 00 00 00 000000
F: 1:1 00 00 00 00 00 00 000000
G: 1:2 00 00 00 00 00 00 000000
H: 1:3 fd 99 00 60 00 00 000000
I: 2:0 07 05 00 02 00 00 000000
J: 2:1 00 00 00 00 00 00 000000
K: 2:2 00 00 00 00 00 00 000000
L: 2:3 00 00 00 00 00 00 000000
M: 3:0 00 00 00 00 00 00 000000
N: 3:1 00 00 00 00 00 00 000000
O: 3:2 00 00 00 00 00 00 000000
P: 3:3 00 00 00 00 00 00 000000
Q: 4:0 00 00 00 00 00 00 000000
R: 4:1 00 00 00 00 00 00 000000
S: 4:2 80 80 00 00 00 00 000000
T: 4:3 01 01 00 00 00 00 000000
U: 5:0 00 00 00 00 00 00 000000
V: 5:1 02 00 00 02 00 00 000000
W: 5:2 00 00 00 00 00 00 000000
X: 5:3 78 08 08 70 00 60 606000
Y: 6:0 02 00 00 02 00 00 000000
Z: 6:1 0e 08 08 04 00 06 020600
AA: 6:2 00 00 00 00 00 00 000000
BB: 6:3 00 00 00 00 00 00 000000
CC: 7:0 12 00 00 12 00 12 121200
DD: 7:1 00 00 00 00 00 00 000000
EE: 7:2 00 00 00 00 00 00 000000
FF: 7:3 00 00 00 00 00 00 000000

3.And the info in /sys/kernel/debug/gpio made me more confused.
cat /sys/kernel/debug/gpio
gpio-7 ( )
gpio-11 ( )
gpio-12 (SPI1_MOSI )
gpio-13 (SPI1_MISO )
gpio-38 (GPIO13 )
gpio-168 (GPIO07 )
gpio-194 (GPIO12 )
gpio-200 (GPIO11 )

Hello ysp123ysp,

Yes, you are defining correctly the GPIOS in the device tree.

This is an example:

interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(H, 7) IRQ_TYPE_LEVEL_HIGH>;

Open file hardware/nvidia/soc/tegra/kernel-include/dt-bindings/gpio/tegra-gpio.h and use use this file to compute the GPIO number based on the groupname and pin:

GPIO3_PH.07: (7 x 8 + 7) = 63

Now you should see the the interrupt in this GPIO number

sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
. . 
 gpio-63  (                    |my_camera_int        ) in  lo IRQ

Hi, Leiva
Thanks a lot for your comments. But I still have some doubts.

Refer your example:

interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(H, 7) IRQ_TYPE_LEVEL_HIGH>;

sudo cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
. .
gpio-63 ( |my_camera_int ) in lo IRQ

The gpio index for kernel driver is 63. right?
And which pin you are using for TEGRA_GPIO(H, 7)? Does it on 40-pin_expansion_header?

Another question:
In hardware design, GPIO07_LS is use as GPIO interrupt input.

So Can I use 7 as gpio index directly in driver code? like below.

            glGpio=7;glGpio_name="gpio007"
	gpio_request(glGpio,glGpio_name);
	gpio_direction_input(glGpio);
	irq = gpio_to_irq(glGpio);
	irq_set_irq_type(irq, IRQF_TRIGGER_FALLING);
	ret = request_irq(irq, gpio_test_ist,
			   IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "gpio_test", NULL);

I try it. See below error.
[54079.870028] tegra210-pinctrl 700008d4.pinmux: pin 7 is not registered so it cannot be requested
[54079.878844] tegra210-pinctrl 700008d4.pinmux: pin-7 (tegra-gpio:7) status -22
[54079.886054] tegra210-pinctrl 700008d4.pinmux: Pingroup not found for pin 7
[54079.893119] tegra-gpio 6000d000.gpio: Failed to set pinctrl input direction of GPIO 7: -22

Hi, ManuelLeiva
ISSUE is solved. thanks a lot.

@ysp123ysp what was the solution? Posting it would be very helpful.