Hi,
I’m working with the LX2160ARDB-rev2 and using LLDP Linux Distribution RevL6.1.22_2.0.0, but 5.15-rt Linux kernel. I need to register my GPIO interrupt handler in the LLDP Linux Distribution. I’m looking for guidance on how to properly register and manage a GPIO interrupt handler.
I’ve found that I can use `request_irq()` to register my own interrupt handler. However, I've also known that the IRQ number passed to `request_irq()` is a logical number managed by the kernel, and it is different from the GIC’s Interrupt ID (hwirq). I don't know how to get IRQ number from one specific GPIO pin.
According to the LX2160A Reference Manual, the Interrupt ID(hwirq) of GPIO module on the GIC is 68 for GPIO1 & GPIO2 ORed, and 69 for GPIO3 & GPIO4 ORed. It looks like the gpio-mpc8xxx.c file calls `devm_request_irq()` to register the mpc8xxx_gpio_irq_cascade handler, which in turn calls `generic_handle_domain_irq()` to handle individual GPIO pin interrupts. So, I would like to know how to register an interrupt handler for a single GPIO pin.
I want to use one GPIO pin in input mode to receive periodic interrupts from an external device and register a handler to process these interrupts. Based on the GPIO section in the LLDPUG_RevL6.1.22_2.0.0 documentation (section 7.5.23), it seems like I can use J29 on the LX2160ARDB board.
In conclusion, I have a few questions:
Best regards,
1. No need to add content in the dts file.
2. No need to modify gpio-mpc8xxx.c.
Then, what Pin number I should use for linux GPIO APIs(e.g. gpio_request(), gpio_to_irq() etc..)?