Re: [PATCH v5 1/6] dt-bindings: pwm: Add a new binding for rockchip,rk3576-pwm

From: Damon Ding

Date: Tue Nov 24 2026 - 22:55:55 EST


Hello all,

On 7/10/2026 6:31 PM, Uwe Kleine-König wrote:
Hello,

On Mon, Apr 20, 2026 at 03:52:38PM +0200, Nicolas Frattaroli wrote:
The Rockchip RK3576 SoC has a newer PWM controller IP revision than
previous Rockchip SoCs. This IP, called "PWMv4" by Rockchip, introduces
several new features, and consequently differs in its bindings.

Instead of expanding the ever-growing rockchip-pwm binding that already
has an if-condition, add an entirely new binding to handle this.

There are two additional clocks, "osc" and "rc". These are available for
every PWM instance, and the PWM hardware can switch between the "pwm",
"osc" and "rc" clock at runtime.

The PWM controller also comes with an interrupt now. This interrupt is
used to signal various conditions.

Reviewed-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
Reviewed-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@xxxxxxxxxxxxx>
---
.../bindings/pwm/rockchip,rk3576-pwm.yaml | 77 ++++++++++++++++++++++
MAINTAINERS | 7 ++
2 files changed, 84 insertions(+)


With Nicolas' agreement, I'm planning to take over the RK3576 PWM v4
support work and to restructure the driver to a certain extent.

The RK3576 PWM v4 revision actually provides a large number of
features, such as counter, frequency meter, biphasic (AB) counter, IR
transmitter and IR receiver. All of these features share the same
physical address range. Features that appear unrelated to "PWM" have
been folded into a single PWM block (due to some unavoidable
constraints). In a future v5 revision these features will be split
into separate blocks, each with its own physical address range. This
is the main reason I would like to restructure the driver layout now:
an MFD based v4 driver would have to be reworked into a non-MFD one
for v5 anyway, which would leave us with two drivers duplicating the
same logic.

Nicolas' MFD version is an excellent implementation for runtime
feature switching, but by design intent we prefer the function to be
fixed at hardware design time, i.e. a static selection instead. I have
found two similar existing implementations:

1. TI's eCAP module switches between functions by overriding the
compatible:

drivers/counter/ti-ecap-capture.c
drivers/pwm/pwm-tiecap.c
Documentation/devicetree/bindings/counter/ti,am62-ecap-capture.yaml
Documentation/devicetree/bindings/pwm/pwm-tiecap.yaml

2. Samsung's USI module, which Sascha pointed me to, uses a top-level
node matching the USI driver with one child node per function
(disabled by default). The board dts then only has to enable the
child node it wants to use:

drivers/soc/samsung/exynos-usi.c
Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml

I would very much appreciate your feedback on this, as your opinion is
key to making sure this restructure does not head in the wrong
direction.

For reference, the planned work is:

1. Settle on a static DTS method to select the PWM v4 features.
2. Merge the PWM v4 support into the existing pwm-rockchip.c driver,
based on [v5,3/6] pwm: Add rockchip PWMv4 driver. For v4 the
waveform API already adapted by Nicolas will be used (older
revisions will be migrated to the waveform API in the future).
3. Add a separate counter driver for the PWM capture function, based
on [v5,4/6] counter: Add rockchip-pwm-capture driver.

---- (second stage) ----

4. Add a rockchip-cfd.c driver based on the Generic Counter framework,
supporting the frequency meter and the counter.
5. Add a rockchip-pcd.c driver based on the Generic Counter framework,
supporting the biphasic (AB) counter.
6. Add a rockchip-ir-tx.c driver based on the RC framework, supporting
IR TX.
7. Add a rockchip-ir-rx.c driver based on the RC framework, supporting
IR RX.

Best regards,
Damon