]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pwm: axi-pwmgen: fix missing separate external clock
authorDavid Lechner <dlechner@baylibre.com>
Thu, 29 May 2025 16:53:20 +0000 (11:53 -0500)
committerUwe Kleine-König <ukleinek@kernel.org>
Mon, 2 Jun 2025 16:23:33 +0000 (18:23 +0200)
commita8841dc3dfbf127a19c3612204bd336ee559b9a1
tree7e6e8efb3541186886c852914066aed07aab5ad5
parente683131e64f71e957ca77743cb3d313646157329
pwm: axi-pwmgen: fix missing separate external clock

Add proper support for external clock to the AXI PWM generator driver.

In most cases, the HDL for this IP block is compiled with the default
ASYNC_CLK_EN=1. With this option, there is a separate external clock
that drives the PWM output separate from the peripheral clock. So the
driver should be enabling the "axi" clock to power the peripheral and
the "ext" clock to drive the PWM output.

When ASYNC_CLK_EN=0, the "axi" clock is also used to drive the PWM
output and there is no "ext" clock.

Previously, if there was a separate external clock, users had to specify
only the external clock and (incorrectly) omit the AXI clock in order
to get the correct operating frequency for the PWM output.

The devicetree bindings are updated to fix this shortcoming and this
patch changes the driver to match the new bindings. To preserve
compatibility with any existing dtbs that specify only one clock, we
don't require the clock name on the first clock.

Fixes: 41814fe5c782 ("pwm: Add driver for AXI PWM generator")
Cc: stable@vger.kernel.org
Acked-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20250529-pwm-axi-pwmgen-add-external-clock-v3-3-5d8809a7da91@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-axi-pwmgen.c