Getting GPIO expander to show up in /sys/class/gpio

Hello, I cannot figure out how to get the GPIO of an expander (NXP PCA9535) to show up in the /sys/class/gpio for control.

The module is a TX2 NX on a custom board. The expander is at address 0x24 on I2C0. I can control the expander with i2ctransfer just fine.

I have this in the device tree:

        gen1_i2c {
                status = "okay";

                gpio_i2c_0_24: gpio@24 {
                        compatible = "nxp,pca9535";
                        reg = <0x24>;

                        interrupt-parent = <&tegra_main_gpio>;
                        interrupts = <TEGRA_MAIN_GPIO(C, 2) IRQ_TYPE_LEVEL_LOW>;

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

                        status = "okay";

                };
        };

What am I missing? I would expect something like “gpiochip512” to show up in /sys/class/gpio (to follow the 192-pin gpiochip320).

I remember that there are some sample inside /hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-camera-e3322-a00.dtsi.

And you can directly check the driver code “gpio-pca953x.c”. Add some debug print and see why there is no gpio chip set up.

Thank you for the suggestions, WayneWWW. I’m trying to follow the examples in tegra186-quill-camera-e3322-a00.dtsi.

Interestingly, I added a printk to every initialization/probe/setup function in the driver; apparently, none of those are getting called.

[Edit]

I was able to get the initialization calling, so I’m debugging now. If I hit on a solution in the DT, I’ll post it for others.

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