[PATCH v2 0/3] pwm: airoha: add AN7589 support

From: John Crispin

Date: Fri Dec 04 2026 - 14:39:21 EST


The AN7589 PWM block is the EN7581 one with three differences: the
flash set-id of a channel is 4 bits wide instead of 3, the channel
enable moved into a register of its own with one bit per channel, and
it has the 16 GPIO channels only.

The PWM controller lives in the GPIO system controller next to the pin
controller. It has no resources of its own, so following Conor's
comment on the pinctrl binding [1] it gets no child node and the system
controller node itself carries #pwm-cells.

Patch 1 adds #pwm-cells to the system controller binding. Patch 2 adds
a small MFD driver that registers the PWM controller as a cell, and
patch 3 teaches the PWM driver the AN7589 layout and lets it probe as
that cell.

Based on next-20261201, which has the AN7589 pinctrl series and with it
the GPIO system controller binding.

[1] https://lore.kernel.org/r/20261117-illicitly-translate-2d16b1279df9@spud

Changes in v2:
- Patch 2: drop <linux/mod_devicetable.h> (Uwe).
- Patch 3: describe the enable bits of both SoCs with a register, the
bit of channel 0 and the distance between two channels, so the
lookup has no condition (Uwe).
- Patch 3: add EN7581_PWM_NUM_CHANNELS (Uwe).
- Patch 3: say in the commit message why the PWM chip uses the node of
its parent and what the id_table changes for the name match (Uwe).
- Patch 1 is unchanged.
- Link to v1: https://lore.kernel.org/r/20261201194434.3132187-1-john@xxxxxxxxxxx

John Crispin (3):
dt-bindings: mfd: airoha: add #pwm-cells to AN7589 gpio-sysctl
mfd: add Airoha GPIO system controller driver
pwm: airoha: add support for AN7589

.../mfd/airoha,an7589-gpio-sysctl.yaml | 6 +-
MAINTAINERS | 1 +
drivers/mfd/Kconfig | 11 ++
drivers/mfd/Makefile | 1 +
drivers/mfd/airoha-gpio-sysctl.c | 42 +++++++
drivers/pwm/pwm-airoha.c | 116 +++++++++++++++---
6 files changed, 162 insertions(+), 15 deletions(-)
create mode 100644 drivers/mfd/airoha-gpio-sysctl.c


base-commit: d138596e9f822033490b2e577ec2ea64f2aa246c
--
2.34.1