Description
Some GPIO controllers only support edge triggered operation. This requires that board code implements a polling loop when multiple peripherals share the same interrupt pin.
The polling could be moved into GPIO controller driver and or potentially the shared GPIO API code.
The GPIO controller simply needs to keep dispatching gpio_manage_callback() as long as the GPIO pin level matches the interrupt asserted configuration.
ITE GPIO controller current rejects level sensitive interrupts here:
zephyr/drivers/gpio/gpio_ite_it8xxx2_v2.c
Line 354 in f9c4ae6
The idea for gpio is that in the device tree we would say that we want a level based interrupt, and the ITE gpio driver would emulate that by catching the edge interrupt, and then reading the gpio, and then calling the callbacks repeatedly until they read false.
The code to re-check the GPIO level might fit here:
zephyr/drivers/gpio/gpio_ite_it8xxx2_v2.c
Line 302 in f9c4ae6
nxp_pca95xx and nordic,npm1300 appear to emulate level triggering with a work queue. <- This seems like the right approach to copy.