How to get the GPIO number of NCA9555 IO0_0?

I have a board that uses the nca9555 chip to expand the GPIO count and links to another expand board that is fitted with a 4G modem.

Where nca9555 IO0_0 is used to enable the 4G modem of the expand board, corresponding to 4g_pwr_key.

dts as follow:

/ {
        ...
        gpio_export {
                compatible = "gpio-export";
                #size-cells = <0>;

                4g_enabled {
                        gpio-export,name = "4g-enabled";
                        gpio-export,output = <1>;
                        gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
                };

                4g_pwr_key {
                        gpio-export,name = "4g-pwr-key";
                        gpio-export,output = <1>;
                        i2c-bus = <&i2c>;
                        gpios = <&gpio_expender 0 GPIO_ACTIVE_LOW>;         // nca9555 IO0_0
                };
        };
        ...
};

&i2c {
        status = "okay";

        gpio_expender: gpio@20 {
                compatible = "nxp,pca9555";
                reg = <0x20>;

                interrupt-parent = <&gpio>;
                interrupts = <&gpio 0 GPIO_ACTIVE_LOW>;

                #gpio-cells = <2>;
                gpio-controller;
        };
};

&pcie {
        status = "okay";
};

&pcie0 {
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x0000>;
                ieee80211-freq-limit = <2400000 2500000>;
        };
};

&pcie1 {
        wifi@1,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x8000>;
                ieee80211-freq-limit = <5000000 6000000>;
        };
};

&state_default {
        gpio {
                groups = "i2c", "jtag", "wdt";
                function = "gpio";
        };
};

After compiling and installing openwrt on the board, check that the gpio extension board is 400-415:

root@OpenWrt:~# cat /sys/kernel/debug/gpio
gpiochip3: GPIOs 400-415, parent: i2c/0-0020, 0-0020, can sleep:
 gpio-400 (                    |4g-pwr-key          ) out lo ACTIVE LOW
gpiochip2: GPIOs 416-447, parent: platform/1e000600.gpio, 1e000600.gpio-bank2:

gpiochip1: GPIOs 448-479, parent: platform/1e000600.gpio, 1e000600.gpio-bank1:

gpiochip0: GPIOs 480-511, parent: platform/1e000600.gpio, 1e000600.gpio-bank0:
 gpio-480 (                    |glong:running_) out hi ACTIVE LOW

Setting up the extended version of 4g-pwr-key:

echo "0" > /sys/class/gpio/4g-pwr-key/value
# or
echo "1" > /sys/class/gpio/4g-pwr-key/value

The USB network card exists after setting. After the expected operation, the USB network card can be disabled.

I wonder if my GPIO number is wrong?

How can I know the GPIO number corresponding to nca9555 IO0_0?

NCA9555 datasheet:

This is my board issue, close it.

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