Skip to content

ITE Gpio driver should support level based interrupts by emulating them #66401

@jeremybettis

Description

@jeremybettis

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:

if (mode == GPIO_INT_MODE_LEVEL) {

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:

return gpio_manage_callback(&data->callbacks, callback, set);

nxp_pca95xx and nordic,npm1300 appear to emulate level triggering with a work queue. <- This seems like the right approach to copy.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions