Hello NXP Community,
I am currently working on integrating a Goodix touchscreen (GT9xx series) with the i.MX93 platform. The touchscreen uses I2C address 0x5D, and both the interrupt (INT) and reset (RST) lines are routed through an I/O expander PCAL6524HEAZ (U725), which is located at I2C address 0x22.
According to the hardware schematic:
CTP_INT (Interrupt) is connected to P0_7 on U725.
CTP_RST (Reset) is connected to P2_1 on U725.
These pins are exposed via the 22-pin MIPI DSI FPC connector as:
When I inspect the GPIO base via /sys/kernel/debug/gpio, I get:
gpiochip4: GPIOs 640-663, parent: i2c/1-0022, 1-0022, can sleep:
This confirms that the base GPIO number for PCAL6524 is 640.
Based on this, I mapped the pins as:
I hardcoded these values in my Goodix driver as:
#define GTP_INT_PORT 647 #define GTP_RST_PORT 657
The driver loads and probes the I2C address correctly. However, when it attempts to request an IRQ, I get the following error:
[ 2385.431060] goodix-custom 2-005d: INT num -22, trigger type:0
[ 2385.431080] goodix-custom 2-005d: Failed to request irq -22
This indicates that gpio_to_irq() is returning an invalid IRQ number (-22 = EINVAL).
My questions are:
Are GPIOs 647 and 657 the correct numbers for P0_7 and P2_1 of the PCAL6524 expander on i.MX93?
Do I need to configure anything specific in the device tree, pinctrl, or elsewhere to properly export these expander GPIOs for interrupt usage?
Is there a recommended method by NXP to use GPIO interrupts from PCAL6524 in custom drivers such as this touchscreen driver?
Any clarification or examples on using PCAL6524 GPIOs as interrupt lines on the i.MX93 platform would be very helpful.
Thank you in advance for your support.