[PATCH v3 0/3] pwm: axi-pwmgen: add external clock

David Lechner posted 3 patches 6 months, 3 weeks ago
.../devicetree/bindings/pwm/adi,axi-pwmgen.yaml    | 15 +++++++++++---
drivers/pwm/pwm-axi-pwmgen.c                       | 23 +++++++++++++++++++---
2 files changed, 32 insertions(+), 6 deletions(-)
[PATCH v3 0/3] pwm: axi-pwmgen: add external clock
Posted by David Lechner 6 months, 3 weeks ago
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 v3:
- Fixed clock-names DT property restrictions (was failing dt_binding_check)
- Added Cc: stable
- Picked up trailers
- Link to v2: https://lore.kernel.org/r/20250522-pwm-axi-pwmgen-add-external-clock-v2-0-086ea9e6ecf0@baylibre.com

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    | 15 +++++++++++---
 drivers/pwm/pwm-axi-pwmgen.c                       | 23 +++++++++++++++++++---
 2 files changed, 32 insertions(+), 6 deletions(-)
---
base-commit: 484803582c77061b470ac64a634f25f89715be3f
change-id: 20250515-pwm-axi-pwmgen-add-external-clock-0364fbdf809b

Best regards,
-- 
David Lechner <dlechner@baylibre.com>
Re: [PATCH v3 0/3] pwm: axi-pwmgen: add external clock
Posted by Uwe Kleine-König 6 months, 2 weeks ago
Hello David,

On Thu, May 29, 2025 at 11:53:17AM -0500, David Lechner wrote:
> 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.

I applied path #1 for 6.17-rc1 and will send patches #2 and #3 to Linus
before 6.16.

Best regards
Uwe