# How to get gpiochip1 gpiod\_to\_irq controls?

**URL:** https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368
**Category:** Jetson AGX Orin
**Tags:** gpio
**Created:** [November 6, 2025, 2:48am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368 "2025-11-06T02:48:43Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 6, 2025, 2:48am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/1 "2025-11-06T02:48:43Z")

</div>

hello,  
SDK version: Jetson\_Linux\_R36.4.3\_aarch64.tbz2  
kernel: 5.15.148

```auto
orin@orin:~$ cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.7, GCID: 42132812, BOARD: generic, EABI: aarch64, DATE: Thu Sep 18 22:54:44 UTC 2025
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
orin@orin:~$ sudo gpioinfo gpiochip1
gpiochip1 - 32 lines:
        line 0: "PAA.00" unused input active-high 
        line 1: "PAA.01" unused input active-high 
        line 2: "PAA.02" unused input active-high 
        line 3: "PAA.03" unused input active-high 
        line 4: "PAA.04" unused input active-high 
        line 5: "PAA.05" unused input active-high 
        line 6: "PAA.06" unused input active-high 
        line 7: "PAA.07" unused input active-high 
        line 8: "PBB.00" unused input active-high 
        line 9: "PBB.01" unused input active-high 
        line 10: "PBB.02" unused input active-high 
        line 11: "PBB.03" unused output active-high 

```

platform-drivers: func\_probe():

```auto
    /* 从设备树获取GPIO中断描述符 */
    data->irq_gpio = devm_gpiod_get_optional(dev, "interrupt", GPIOD_IN);
    if (IS_ERR(data->irq_gpio)) {
        ret = PTR_ERR(data->irq_gpio);
        dev_err(dev, "Failed to get interrupt GPIO: %d\n", ret);
        return ret;
    }
    /* 将GPIO转换为中断号 */
    data->irq = gpiod_to_irq(data->irq_gpio);
    if (data->irq < 0) {
        dev_err(dev, "Failed to get IRQ from GPIO: %d\n", data->irq);
        return data->irq;
    }

```

dts property:

```auto
i2c@3180000 {
		tca9546@70 {
			status = "okay";
			compatible = "nxp,pca9546";
			...
			
			i2c@1{
				reg = <1>;
				i2c-mux,deselect-on-exit;
				
				zzz_irq_device: zzz_irq_device@5A {
					compatible = "nvidia,tegra234-zzz-irq";
					reg = <0x5A>;
					interrupt-parent = <&gpio_aon>;
					interrupts = <TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_RISING>;
					status = "okay";
				};
			};
		};
	};

```

but insmod the driver, the console shows:  
Failed to get IRQ from GPIO: -22  
From the GPIO chapter of the Developer Guide, I learned that GPIO Interrupt Mapping configuration is required. Do I need to modify this configuration for GPIOBB.00?  
can you help me to get the gpiochip1(PBB.00) control?

---

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 6, 2025, 5:11am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/5 "2025-11-06T05:11:41Z")

</div>

Add pinmux.dts:

```auto
gpio_aon_default: default {
			gpio-input = <
				TEGRA234_AON_GPIO(EE, 4)
				TEGRA234_AON_GPIO(CC, 0)
				TEGRA234_AON_GPIO(CC, 1)
				TEGRA234_AON_GPIO(CC, 2)
				TEGRA234_AON_GPIO(CC, 3)
				TEGRA234_AON_GPIO(AA, 4)
				TEGRA234_AON_GPIO(AA, 7)
				TEGRA234_AON_GPIO(BB, 0)
				TEGRA234_AON_GPIO(BB, 1)
				TEGRA234_AON_GPIO(BB, 2)
				>;
};
...
can1_stb_pbb0 {
				nvidia,pins = "can1_stb_pbb0";
				nvidia,function = "rsvd0";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

```

---

<div class="post-metadata">

### Author: ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)
#### Post date: [November 6, 2025, 6:39am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/6 "2025-11-06T06:39:42Z")

</div>

Hi nathanzhangbq,

Are you using the devkit or custom board for AGX Orin?

> [@nathanzhangbq](#):
>
> Failed to get IRQ from GPIO: -22

Could you share the full device tree as file here for further check?

> [@nathanzhangbq](#):
>
> Do I need to modify this configuration for GPIOBB.00?

Please also refer to the following document to check if it helps for your case.  
[GPIO Interrupt Mapping Configuration — NVIDIA Jetson Linux Developer Guide](https://docs.nvidia.com/jetson/archives/r36.4.4/DeveloperGuide/SD/Bootloader/GpioInterruptMapConfig.html#gpio-interrupt-mapping-configuration)

---

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 6, 2025, 8:48am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/7 "2025-11-06T08:48:21Z")

</div>

Hi,  
AGX Orin DevKit, model P3730, Jetson\_Linux\_R36.4.3\_aarch64.tbz2

```auto
cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan 8 01:49:37 UTC 2025
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

```

[tegra234-p3737-camera-8ch-ar0234-overlay.dts.log](https://forums.developer.nvidia.com/uploads/short-url/j5oDWVeWCBYyUswsvO6R2sTrtnN.log) (28.2 KB)

---

<div class="post-metadata">

### Author: ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)
#### Post date: [November 7, 2025, 6:14am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/8 "2025-11-07T06:14:39Z")

</div>

Could you try configure them as following instead?

```auto
							zzz_irq_device: zzz_irq_device@5A {
								compatible = "nvidia,tegra234-zzz-irq";
								reg = <0x5A>;
- interrupt-parent = <&gpio_aon>;
- interrupts = <TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_RISING>;
+ interrupts = <&gpio_aon TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_RISING >;
								status = "okay";
							};

```

> [@nathanzhangbq](#):
>
> [tegra234-p3737-camera-8ch-ar0234-overlay.dts.log](https://forums.developer.nvidia.com/uploads/short-url/j5oDWVeWCBYyUswsvO6R2sTrtnN.log)

Please share the full device tree rather than just the overlay.  
You can simply run the following command on your board and share `extracted_proc.dts` for further check.

```auto
$ sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

```

---

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 7, 2025, 7:05am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/9 "2025-11-07T07:05:18Z")

</div>

Hi Kevin,  
Here is the console log with panic info and dts.  
[session-agx-pbb00-panic.log](https://forums.developer.nvidia.com/uploads/short-url/f5Ut7XkNf0B5LcmrPU9wViRds3h.log) (95.9 KB)  
[extracted\_proc.dts.log](https://forums.developer.nvidia.com/uploads/short-url/4oiDc94nYLMqql1f8zV1QooZxTg.log) (419.8 KB)

---

<div class="post-metadata">

### Author: ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)
#### Post date: [November 10, 2025, 3:24am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/10 "2025-11-10T03:24:46Z")

</div>

Sorry that you may need to revert it back to original configuration as the cell of interrupts property is 2.

```auto
							zzz_irq_device: zzz_irq_device@5A {
								compatible = "nvidia,tegra234-zzz-irq";
								reg = <0x5A>;
								interrupt-parent = <&gpio_aon>;
								interrupts = <TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_RISING>;
								status = "okay";
							};

```

Please also run the following command to check if this GPIO(i.e. PBB.00) is used by other driver.

```auto
$ sudo cat /sys/kernel/debug/gpio|grep PBB.00

```

---

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 11, 2025, 1:53am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/11 "2025-11-11T01:53:55Z")

</div>

Hi Kevin,  
here is the dmesg and dts info. Following your command :

```auto
$ sudo cat /sys/kernel/debug/gpio|grep PBB.00
 gpio-324 (PBB.00 )
$ sudo cat /sys/kernel/debug/gpio|grep PEE.04
 gpio-343 (PEE.04 |Power ) in hi IRQ ACTIVE LOW

```

and the dmesg info should be noted:

```auto
[14.794772] irq: IRQ308: trimming hierarchy from :bus@0:interrupt-controller@f400000-1
[14.795560] hwmon hwmon8: temp1_input not attached to any thermal zone
[14.813708] IRQ286: set affinity failed(-22).
[14.813745] IRQ299: set affinity failed(-22).
[14.814874] psci: CPU10 killed (polled 0 ms)
[14.828539] usb 1-4: new high-speed USB device number 3 using tegra-xusb
[14.873823] IRQ286: set affinity failed(-22).
[14.873916] IRQ299: set affinity failed(-22).

```

and the kernel ./arch/arm64/deconfig ignore the macro “CONFIG\_GPIOLIB”, but the ./.config set the macro “CONFIG\_GPIOLIB=y”, Is this discrepancy normal? Should we configure this macro?  
[dmesg.txt.log](https://forums.developer.nvidia.com/uploads/short-url/nbwCytWznZoqQnW3iS8tuvvPhcp.log) (83.0 KB)  
[extracted\_proc.dts.log](https://forums.developer.nvidia.com/uploads/short-url/3eHQvkCWIZx2QjgEgPmdwuWEmAC.log) (419.8 KB)

---

<div class="post-metadata">

### Author: ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)
#### Post date: [November 12, 2025, 3:49am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/12 "2025-11-12T03:49:18Z")

</div>

> [@nathanzhangbq](#):
>
> ./.config set the macro “CONFIG\_GPIOLIB=y”

It should be fine if CONFIG\_GPIOLIB is enabled in .config.  
You can also run the following command on your board to check its configuration.

```auto
$ zcat /proc/config.gz |grep CONFIG_GPIOLIB

```

> [@nathanzhangbq](#):
>
> ```auto
> /* 从设备树获取GPIO中断描述符 */
> data->irq_gpio = devm_gpiod_get_optional(dev, "interrupt", GPIOD_IN);
> if (IS_ERR(data->irq_gpio)) {
> ret = PTR_ERR(data->irq_gpio);
> dev_err(dev, "Failed to get interrupt GPIO: %d\n", ret);
> return ret;
> }
> /* 将GPIO转换为中断号 */
> data->irq = gpiod_to_irq(data->irq_gpio);
> if (data->irq < 0) {
> dev_err(dev, "Failed to get IRQ from GPIO: %d\n", data->irq);
> return data->irq;
> }
> 
> ```

Could you try using `platform_get_irq()` as following instead?

```auto
data->irq = platform_get_irq(pdev, 0); 
if (data->irq < 0) {
    dev_err(dev, "Failed to get IRQ from DTS: %d\n", data->irq);
    return data->irq;
}

```

---

<div class="post-metadata">

### Author: ![nathanzhangbq](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nathanzhangbq](https://forums.developer.nvidia.com/u/nathanzhangbq)
#### Post date: [November 13, 2025, 1:19am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/13 "2025-11-13T01:19:57Z")

</div>

Hi Kevin,  
modify dts property:

```auto
/ {
	fragment@0 {
		__overlay__ {
			zzz_irq_device: zzz_irq_device {
					compatible = "nvidia,tegra234-zzz-irq";
					interrupt-parent = <&gpio_aon>;
					interrupts = <TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_RISING>;
					status = "okay";
			};
			...
		}
	}
}

```

and the platform driver probe completed, but the platform\_get\_irq(pdev, 0) function return value(253), so 253 is the PBB.00-irq value? and the interrupt handler is not work as expected.  
Here is console info:

```auto
[8.622810] tegra234-zzz-irq zzz_irq_device: Virtual I2C device probed, IRQ: 253
gaxorin@gaxorin-desktop:/sys/firmware/devicetree/base/zzz_irq_device$ cat interrupts
gaxorin@gaxorin-desktop:/sys/firmware/devicetree/base/zzz_irq_device$ cat interrupt-parent 

gaxorin@gaxorin-desktop:/sys/firmware/devicetree/base/zzz_irq_device$ sudo cat /sys/kernel/debug/gpio|grep PBB.00
 gpio-324 (PBB.00 )
gaxorin@gaxorin-desktop:/sys/firmware/devicetree/base/zzz_irq_device$

```

---

<div class="post-metadata">

### Author: ![KevinFFF](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kevinfff/32/15508_2.png) [@KevinFFF](https://forums.developer.nvidia.com/u/KevinFFF)
#### Post date: [November 13, 2025, 7:56am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/14 "2025-11-13T07:56:53Z")

</div>

> [@nathanzhangbq](#):
>
> `[8.622810] tegra234-zzz-irq zzz_irq_device: Virtual I2C device probed, IRQ: 253`

Yes, it seems you can probe the driver correctly.  
Please simply run the following command to check the IRQ.

```auto
$ cat /proc/interrupts |grep 253

```

> [@nathanzhangbq](#):
>
> and the interrupt handler is not work as expected.

Do you mean that there’s no interrupt count when the IRQ is triggered?  
Or your handler is not working when there’s the interrupt?

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)
#### Post date: [December 2, 2025, 7:39am UTC](https://forums.developer.nvidia.com/t/how-to-get-gpiochip1-gpiod-to-irq-controls/350368/16 "2025-12-02T07:39:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
