Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] pwm: airoha: add AN7589 support
@ 2026-12-04 19:38 John Crispin
  2026-12-04 19:38 ` [PATCH v2 1/3] dt-bindings: mfd: airoha: add #pwm-cells to AN7589 gpio-sysctl John Crispin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Crispin @ 2026-12-04 19:38 UTC (permalink / raw)
  To: Lorenzo Bianconi, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Uwe Kleine-König
  Cc: Christian Marangi, devicetree, lei.dong, Linqi.zhang,
	linux-kernel, linux-mediatek, linux-pwm, mfd, Rajeev.kumar,
	upstream, Weifeng.xu, zhengping.zhang

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@phrozen.org

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-04 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 19:38 [PATCH v2 0/3] pwm: airoha: add AN7589 support John Crispin
2026-12-04 19:38 ` [PATCH v2 1/3] dt-bindings: mfd: airoha: add #pwm-cells to AN7589 gpio-sysctl John Crispin
2026-12-04 19:38 ` [PATCH v2 2/3] mfd: add Airoha GPIO system controller driver John Crispin
2026-12-04 19:38 ` [PATCH v2 3/3] pwm: airoha: add support for AN7589 John Crispin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox