linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Introduce Allwinner H616 PWM controller
@ 2025-12-05 10:02 Richard Genoud
  2025-12-05 10:02 ` [PATCH 1/4] dt-bindings: pwm: sunxi: add PWM controller for Allwinner H616 Richard Genoud
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Richard Genoud @ 2025-12-05 10:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Philipp Zabel
  Cc: Thomas Petazzoni, linux-pwm, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel, Richard Genoud

Allwinner H616 PWM controller is quite different from the A10 one.

It can drive 6 PWM channels, and like for the A10, each channel has a
bypass that permits to output a clock, bypassing the PWM logic, when
enabled.

But, the channels are paired 2 by 2, sharing a first set of
MUX/prescaler/gate.
Then, for each channel, there's another prescaler (that will be bypassed
if the bypass is enabled for this channel).

It looks like that:
            _____      ______      ________
OSC24M --->|     |    |      |    |        |
APB1 ----->| Mux |--->| Gate |--->| /div_m |-----> PWM_clock_src_xy
           |_____|    |______|    |________|
                          ________
                         |        |
                      +->| /div_k |---> PWM_clock_x
                      |  |________|
                      |    ______
                      |   |      |
                      +-->| Gate |----> PWM_bypass_clock_x
                      |   |______|
PWM_clock_src_xy -----+   ________
                      |  |        |
                      +->| /div_k |---> PWM_clock_y
                      |  |________|
                      |    ______
                      |   |      |
                      +-->| Gate |----> PWM_bypass_clock_y
                          |______|

Where xy can be 0/1, 2/3, 4/5

PWM_clock_x/y serve for the PWM purpose.
PWM_bypass_clock_x/y serve for the clock-provider purpose.
The common clock framework has been used to manage those clocks.

This PWM driver serves as a clock-provider for PWM_bypass_clocks.
This is needed for example by the embedded AC300 PHY which clock comes
from PMW5 pin (PB12).

This series is based onto next-20251205

Richard Genoud (4):
  dt-bindings: pwm: sunxi: add PWM controller for Allwinner H616
  pwm: sun50i: Add H616 PWM support
  arm64: dts: allwinner: h616: add PWM controller
  MAINTAINERS: Add entry on Allwinner H616 PWM driver

 .../pwm/allwinner,sun50i-h616-pwm.yaml        |  67 ++
 MAINTAINERS                                   |   6 +
 .../arm64/boot/dts/allwinner/sun50i-h616.dtsi |  47 +
 drivers/pwm/Kconfig                           |  12 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-sun50i-h616.c                 | 874 ++++++++++++++++++
 6 files changed, 1007 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/allwinner,sun50i-h616-pwm.yaml
 create mode 100644 drivers/pwm/pwm-sun50i-h616.c


base-commit: 6987d58a9cbc5bd57c983baa514474a86c945d56
-- 
2.47.3



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

end of thread, other threads:[~2025-12-12  8:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 10:02 [PATCH 0/4] Introduce Allwinner H616 PWM controller Richard Genoud
2025-12-05 10:02 ` [PATCH 1/4] dt-bindings: pwm: sunxi: add PWM controller for Allwinner H616 Richard Genoud
2025-12-08  6:52   ` Krzysztof Kozlowski
2025-12-12  7:50     ` Richard GENOUD
2025-12-12  8:25       ` Krzysztof Kozlowski
2025-12-12  8:52         ` Richard GENOUD
2025-12-05 10:02 ` [PATCH 2/4] pwm: sun50i: Add H616 PWM support Richard Genoud
2025-12-06  4:22   ` kernel test robot
2025-12-06  4:32   ` kernel test robot
2025-12-06 14:24   ` kernel test robot
2025-12-08  6:09   ` Krzysztof Kozlowski
2025-12-05 10:02 ` [PATCH 3/4] arm64: dts: allwinner: h616: add PWM controller Richard Genoud
2025-12-05 10:02 ` [PATCH 4/4] MAINTAINERS: Add entry on Allwinner H616 PWM driver Richard Genoud

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).