mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Damon Ding <damon.ding@rock-chips.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>
Cc: Heiko Stuebner <heiko@sntech.de>, Lee Jones <lee@kernel.org>,
	William Breathitt Gray <wbg@kernel.org>,
	kernel@collabora.com, Jonas Karlman <jonas@kwiboo.se>,
	Alexey Charkov <alchark@gmail.com>,
	linux-rockchip@lists.infradead.org, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	Conor Dooley <conor.dooley@microchip.com>,
	"chaoyi.chen" <chaoyi.chen@rock-chips.com>,
	Sandy Huang <hjc@rock-chips.com>
Subject: Re: [PATCH v5 1/6] dt-bindings: pwm: Add a new binding for rockchip,rk3576-pwm
Date: Wed, 25 Nov 2026 11:55:34 +0800	[thread overview]
Message-ID: <68d54499-044c-45af-abbb-9aa7bc212db5@rock-chips.com> (raw)
In-Reply-To: <alCvmLX1ke0qjh99@monoceros>

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@microchip.com>
>> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
>> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
>> ---
>>   .../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


  reply	other threads:[~2026-11-25  3:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 13:52 [PATCH v5 0/6] Add Rockchip RK3576 PWM Support Through MFPWM Nicolas Frattaroli
2026-04-20 13:52 ` [PATCH v5 1/6] dt-bindings: pwm: Add a new binding for rockchip,rk3576-pwm Nicolas Frattaroli
2026-07-10 10:31   ` Uwe Kleine-König
2026-11-25  3:55     ` Damon Ding [this message]
2026-04-20 13:52 ` [PATCH v5 2/6] mfd: Add Rockchip mfpwm driver Nicolas Frattaroli
2026-05-14 11:41   ` Lee Jones
2026-05-20 15:38     ` Nicolas Frattaroli
2026-04-20 13:52 ` [PATCH v5 3/6] pwm: Add rockchip PWMv4 driver Nicolas Frattaroli
2026-04-26  9:44   ` Damon Ding
2026-04-26 13:06     ` Uwe Kleine-König
2026-04-27  1:20       ` Damon Ding
2026-04-26 10:09   ` Damon Ding
2026-07-10 11:02   ` Uwe Kleine-König
2026-07-17  2:38     ` Damon Ding
2026-10-29  9:22   ` Bas Vermeulen
2026-10-29  9:25   ` Bas Vermeulen
2026-04-20 13:52 ` [PATCH v5 4/6] counter: Add rockchip-pwm-capture driver Nicolas Frattaroli
2026-04-26 10:55   ` Damon Ding
2026-04-27 17:35     ` Nicolas Frattaroli
2026-05-03 11:06       ` William Breathitt Gray
2026-05-03 10:46   ` William Breathitt Gray
2026-05-04  8:25     ` Nicolas Frattaroli
2026-04-20 13:52 ` [PATCH v5 5/6] arm64: dts: rockchip: add PWM nodes to RK3576 SoC dtsi Nicolas Frattaroli
2026-04-26  7:30   ` Damon Ding
2026-04-20 13:52 ` [PATCH v5 6/6] arm64: dts: rockchip: Add cooling fan to ROCK 4D Nicolas Frattaroli
2026-04-26  7:23   ` Damon Ding
2026-04-27 17:17     ` Nicolas Frattaroli
2026-04-21 15:56 ` [PATCH v5 0/6] Add Rockchip RK3576 PWM Support Through MFPWM Jonathan Cameron
2026-04-22 11:31   ` Nicolas Frattaroli
2026-04-24 10:43     ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68d54499-044c-45af-abbb-9aa7bc212db5@rock-chips.com \
    --to=damon.ding@rock-chips.com \
    --cc=alchark@gmail.com \
    --cc=chaoyi.chen@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=ukleinek@kernel.org \
    --cc=wbg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®