[PATCH v3 0/2] gpio: Add the Siflower SF19A2890 GPIO controller

From: Joseph Telaak via B4 Relay

Date: Sun Nov 22 2026 - 20:37:54 EST


This series adds a binding and a driver for the GPIO controller of the
Siflower SoCs, starting with the SF19A2890, a MIPS SoC for home routers.
Each line has a register block of its own, and each group of 16 lines an
interrupt.

The binding is Chuanhong Guo's and the driver Qingfang Deng's, both from
Chuanhong's SF19A2890 branch [1], with my changes noted in each. The
same controller is in Siflower's SF21 RISC-V SoCs; the binding has only
the SF19A2890's compatible, the one I can test.

The SoC support itself (MACH_SIFLOWER_MIPS) goes through the MIPS tree;
until then the driver builds with COMPILE_TEST.

Tested on a GL.iNet GL-SFT1200. Earlier, on v7.4-rc1: gpio-keys sees
both buttons on both edges (the reset button on GPIO 27 as KEY_RESTART,
the mode slide switch on GPIO 1 as BTN_0, 1 and 0 per slide);
/sys/kernel/debug/gpio lists the 49 lines; the GSW150 switch comes out
of reset through GPIO 0 and the SPI NAND uses GPIO 8 as its chip select.
v3 was run again on OpenWrt's 6.18 kernel, with the driver backported
along with the gpio tree's gpio-regmap: the same four lines work, and
both buttons raise their interrupts on both edges through the driver's
IRQ domain. The board's device tree sets no debounce, so the debounce
path was not exercised.

[1] https://github.com/981213/linux/commits/siflower-7.1

---
Changes in v3:
- Move the driver to gpio-regmap on regmap-mmio, with a
reg_mask_xlate() for the 0x40 stride between the lines' registers and
the debounce in set_config() (Linus).
- Put the interrupts on an IRQ domain of the driver's own, with a
chained handler for each group of 16 lines, since gpio-regmap sets up
no gpio_irq_chip. The chained handlers are removed with devm.
- Patch 1: add Krzysztof's Reviewed-by.
- Link to v2: https://patch.msgid.link/20261109-sf19a2890-gpio-v2-0-b885fbd84c4c@xxxxxxxxxx

Changes in v2:
- Write my notes on Chuanhong's and Qingfang's patches as lists, with
Co-developed-by on the driver (Bartosz).
- Get priv with gpiochip_get_data(), drop the two else branches, and add
a blank line after the header comment (Bartosz).
- Get the reset with devm_reset_control_get_exclusive_deasserted(), as a
local, not in priv (Philipp), and drop the OF_GPIO dependency.
- Name only the SF19A2890 in the Kconfig help and the binding's commit
message, since the other SoCs need compatibles of their own (Conor).
- Drop the ngpios property, which the compatible implies: the driver
takes the number of lines from its match data, and the binding takes
exactly four interrupts (Conor).
- Order the binding's properties and its required list (Conor).
- Add a MAINTAINERS entry for the driver and its binding.
- Use GPL-2.0-or-later, not the deprecated GPL-2.0+ SPDX identifier.
- Use readl() and writel() directly, without wrapper functions (Linus).
- No comma after the match table's sentinel, as Uwe asked of the
clock driver.
- Drop the unused linux/pinctrl/consumer.h include.
- Link to v1: https://patch.msgid.link/20261104-sf19a2890-gpio-v1-0-45e463c48728@xxxxxxxxxx

---
Chuanhong Guo (1):
dt-bindings: gpio: Add Siflower SF19A2890 GPIO controller

Qingfang Deng (1):
gpio: Add Siflower GPIO controller driver

.../bindings/gpio/siflower,sf19a2890-gpio.yaml | 76 +++++
MAINTAINERS | 7 +
drivers/gpio/Kconfig | 14 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-siflower.c | 344 +++++++++++++++++++++
5 files changed, 442 insertions(+)
---
base-commit: d66b6b86d5a6278ca930112c634d03725beb7d9a
change-id: 20261102-sf19a2890-gpio-b21562e52f88

Best regards,
--
Joseph Telaak <joseph@xxxxxxxxxx>