devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] pwm: axi-pwmgen: add external clock
@ 2025-05-22 14:49 David Lechner
  2025-05-22 14:49 ` [PATCH v2 1/3] dt-bindings: pwm: adi,axi-pwmgen: update documentation link David Lechner
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Lechner @ 2025-05-22 14:49 UTC (permalink / raw)
  To: Michael Hennerich, Nuno Sá, Trevor Gamblin,
	Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, David Lechner
  Cc: linux-pwm, devicetree, linux-kernel

When we created the driver for the AXI PWMGEN IP block, we overlooked
the fact that it can optionally be configured to use an external clock
in addition to the AXI bus clock. This is easy to miss in testing
because the bus clock is always on because it is driving other
peripherals as well.

Up to now, users were specifying the external clock if there was one and
the AXI bus clock otherwise. But the proper way to do this is to would
be to always specify the bus clock and only specify the external clock
if the IP block has been configured to use it.

To fix this, we add clock-names to the devicetree bindings and change
clocks to allow 1 or 2 clocks.

---
Changes in v2:
- Consider this a fix rather than a new feature.
- Make clock-names required.
- Simplify the logic in the pwm driver to avoid needing to test if
  clock-names is present in old dtbs that used the broken binding.
- Link to v1: https://lore.kernel.org/r/20250520-pwm-axi-pwmgen-add-external-clock-v1-0-6cd63cc001c8@baylibre.com

---
David Lechner (3):
      dt-bindings: pwm: adi,axi-pwmgen: update documentation link
      dt-bindings: pwm: adi,axi-pwmgen: fix clocks
      pwm: axi-pwmgen: fix missing separate external clock

 .../devicetree/bindings/pwm/adi,axi-pwmgen.yaml    | 16 ++++++++++++---
 drivers/pwm/pwm-axi-pwmgen.c                       | 23 +++++++++++++++++++---
 2 files changed, 33 insertions(+), 6 deletions(-)
---
base-commit: 484803582c77061b470ac64a634f25f89715be3f
change-id: 20250515-pwm-axi-pwmgen-add-external-clock-0364fbdf809b

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


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

end of thread, other threads:[~2025-05-23 17:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 14:49 [PATCH v2 0/3] pwm: axi-pwmgen: add external clock David Lechner
2025-05-22 14:49 ` [PATCH v2 1/3] dt-bindings: pwm: adi,axi-pwmgen: update documentation link David Lechner
2025-05-22 14:49 ` [PATCH v2 2/3] dt-bindings: pwm: adi,axi-pwmgen: fix clocks David Lechner
2025-05-22 15:00   ` Krzysztof Kozlowski
2025-05-22 15:17     ` David Lechner
2025-05-22 15:19       ` Krzysztof Kozlowski
2025-05-22 16:28   ` Rob Herring (Arm)
2025-05-22 14:49 ` [PATCH v2 3/3] pwm: axi-pwmgen: fix missing separate external clock David Lechner
2025-05-23  9:09   ` Nuno Sá
2025-05-23 17:33   ` Trevor Gamblin

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).