linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: tegra: Fix Tegra210 PWM parent clock
@ 2022-10-03 10:15 Jon Hunter
  2022-10-07  8:46 ` Jon Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Hunter @ 2022-10-03 10:15 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Thierry Reding
  Cc: Uwe Kleine-König, linux-clk, linux-tegra, Jon Hunter

Commit 8c193f4714df ("pwm: tegra: Optimize period calculation") updated
the period calculation in the Tegra PWM driver and now returns an error
if the period requested is less than minimum period supported. This is
breaking PWM fan support on the Tegra210 Jetson Nano platform and
probing the PWM fan driver now fails ...

 pwm-fan pwm-fan: Failed to configure PWM: -22
 pwm-fan: probe of pwm-fan failed with error -22

The problem is that the default parent clock for the PWM on Tegra210 is
a 32kHz clock and is unable to support the requested PWM period. Fix
this by updating the parent clock for the PWM to be the PLL_P which
operates at 48MHz.

Fixes: 8c193f4714df ("pwm: tegra: Optimize period calculation")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/clk/tegra/clk-tegra210.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c
index 499f999e91e1..a3488aaac3f7 100644
--- a/drivers/clk/tegra/clk-tegra210.c
+++ b/drivers/clk/tegra/clk-tegra210.c
@@ -3597,6 +3597,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
 	{ TEGRA210_CLK_VIMCLK_SYNC, TEGRA210_CLK_CLK_MAX, 24576000, 0 },
 	{ TEGRA210_CLK_HDA, TEGRA210_CLK_PLL_P, 51000000, 0 },
 	{ TEGRA210_CLK_HDA2CODEC_2X, TEGRA210_CLK_PLL_P, 48000000, 0 },
+	{ TEGRA210_CLK_PWM, TEGRA210_CLK_PLL_P, 48000000, 0 },
 	/* This MUST be the last entry. */
 	{ TEGRA210_CLK_CLK_MAX, TEGRA210_CLK_CLK_MAX, 0, 0 },
 };
-- 
2.7.4


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

* Re: [PATCH] clk: tegra: Fix Tegra210 PWM parent clock
  2022-10-03 10:15 [PATCH] clk: tegra: Fix Tegra210 PWM parent clock Jon Hunter
@ 2022-10-07  8:46 ` Jon Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2022-10-07  8:46 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Thierry Reding
  Cc: Uwe Kleine-König, linux-clk, linux-tegra

On 03/10/2022 11:15, Jon Hunter wrote:
> Commit 8c193f4714df ("pwm: tegra: Optimize period calculation") updated
> the period calculation in the Tegra PWM driver and now returns an error
> if the period requested is less than minimum period supported. This is
> breaking PWM fan support on the Tegra210 Jetson Nano platform and
> probing the PWM fan driver now fails ...
> 
>   pwm-fan pwm-fan: Failed to configure PWM: -22
>   pwm-fan: probe of pwm-fan failed with error -22
> 
> The problem is that the default parent clock for the PWM on Tegra210 is
> a 32kHz clock and is unable to support the requested PWM period. Fix
> this by updating the parent clock for the PWM to be the PLL_P which
> operates at 48MHz.
> 
> Fixes: 8c193f4714df ("pwm: tegra: Optimize period calculation")
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>


I have sent a V2 on this to fix the PWM support for some other Tegra 
devices.

Jon

-- 
nvpublic

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

end of thread, other threads:[~2022-10-07  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03 10:15 [PATCH] clk: tegra: Fix Tegra210 PWM parent clock Jon Hunter
2022-10-07  8:46 ` Jon Hunter

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