[PATCH 0/2] gpio: dwapb: add native hardware both-edge support
From: Guohao Zhang
Date: Fri Oct 23 2026 - 05:42:54 EST
Some DW APB GPIO IP instances are synthesized with the GPIO_INT_BOTH_EDGE
feature, which adds the GPIO_INT_BOTHEDGE register to latch both signal
edges of a line in hardware.
This series adds support for it to the driver:
patch 1 adds the device tree property "snps,native-both-edge" that marks
a controller whose IP instance provides the register.
patch 2 makes the driver use the hardware register for IRQ_TYPE_EDGE_BOTH
when the property is present, and keeps the existing software
polarity toggle otherwise.
The capability is per-IP-instance rather than per-SoC, so it is described in
the device tree instead of being selected by a build-time option, which in a
multiplatform kernel could not express a per-controller difference.
Register 0x68 is only accessed when the property is present; for controllers
without it the driver behaviour is unchanged and no access to 0x68 is emitted.
The change was measured on a Horizon Robotics J6P board. In a high-rate edge
test the software polarity-toggle implementation lost about 2% of the
interrupts, while the native both-edge mode lost none. With the flag off, the
built object contains no access to offset 0x68 and the software path is
unchanged.
Guohao Zhang (2):
dt-bindings: gpio: dwapb: add snps,native-both-edge
gpio: dwapb: support native hardware both-edge detection
.../bindings/gpio/snps,dw-apb-gpio.yaml | 10 ++++
drivers/gpio/gpio-dwapb.c | 49 +++++++++++++++++--
2 files changed, 56 insertions(+), 3 deletions(-)
--
2.34.1