Skip to contentSkip to conversation

clk: tegra: Fix Tegra210 PWM parent clock

PATCH Superseded Jon Hunter 1 participant 2 messages Oct 3, 2022 – Oct 7, 2022

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 1/1 clk: tegra: Fix Tegra210 PWM parent clock

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")
---
 drivers/clk/tegra/clk-tegra210.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/tegra/clk-tegra210.c +1 -0
index 499f999e91e1..a3488aaac3f7 100644
@@ -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 },
 };
Signature · 1 line
2.7.4
author maintainer
#1 lore raw
Quoted 9 lines · 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

Quoted 7 lines

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

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

Jon

Signature · 1 line
nvpublic