Device Tree Configuration for PCA9535 Interrupt on IMX8M Plus

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Device Tree Configuration for PCA9535 Interrupt on IMX8M Plus

595 次查看
sem
Contributor I

I am working on a custom board based on the i.MX8M Plus processor, and I am using a PCA9535 GPIO expander connected via I2C. The PCA9535 is connected to the I2C bus, and its INT pin is wired to the GPIO5_IO04 pin.

The GPIO expander is correctly detected over I2C, and the relevant driver (gpio-pca953x) is enabled in the kernel. However, I am facing issues with correctly defining the interrupt and pad control configuration in the device tree. I would like the expander to trigger interrupts when input state changes occur, but I am not sure if I have defined the interrupts and interrupt-parent properties correctly.

Additionally, I need guidance on how to properly configure the pad control settings to ensure the pin is set up correctly.

pca953x_0:gpio@21 {
            compatible = "nxp,pca9535";
            gpio-controller;
            #gpio-cell = <2>;
            reg = <0x21>;
            interrupt-controller;
            #interrupt-cells = <2>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_expanderio>;
            interrupt-parent = <&gpio5>;
            interrupts = <4 IRQ_TYPE_LEVEL_LOW>; /* gpio5_4 */
}



....

pinctrl_expanderio: expanderiogrp {
        fsl,pins = <
            MX8MP_IOMUXC_SPDIF_RX__GPIO5_IO04       0x41  /* GPIO10 */
        >;
    };
0 项奖励
回复
1 回复

558 次查看
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

According to documentation it is correctly configured:

linux-imx/Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml at 37d02f4dcbbe6677dc9f5fc17f386c...

Since interrupt pin has an open-drain configuration, please configure it in the next way as is in our EVK (is not the same I2C port expander but also has an open-drain configuration).

linux-imx/arch/arm64/boot/dts/freescale/imx8mp-evk.dts at lf-6.6.y · nxp-imx/linux-imx

pinctrl_expanderio: expanderiogrp {
        fsl,pins = <
                MX8MP_IOMUXC_SPDIF_RX__GPIO5_IO04       0x146  /* GPIO10 - Input pull-up */
        >;
};

Best regards.

 

0 项奖励
回复