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 */
>;
};