Skip to content

Commit c461c67

Browse files
jonhunterbebarino
authored andcommitted
clk: tegra: Fix Tegra PWM parent clock
Commit 8c193f4 ("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 support on various Tegra platforms. For example, on the Tegra210 Jetson Nano platform this is breaking the PWM fan support 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 PWM support on Tegra20, Tegra30, Tegra114, Tegra124 and Tegra210 by updating the parent clock for the PWM to be the PLL_P. Fixes: 8c193f4 ("pwm: tegra: Optimize period calculation") Signed-off-by: Jon Hunter <[email protected]> Tested-by: Robert Eckelmann <[email protected]> # TF101 T20 Tested-by: Antoni Aloy Torrens <[email protected]> # TF101 T20 Tested-by: Svyatoslav Ryhel <[email protected]> # TF201 T30 Tested-by: Andreas Westman Dorcsak <[email protected]> # TF700T T3 Link: https://lore.kernel.org/r/[email protected] Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 57d8496 commit c461c67

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

drivers/clk/tegra/clk-tegra114.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
11661166
{ TEGRA114_CLK_I2S3_SYNC, TEGRA114_CLK_CLK_MAX, 24000000, 0 },
11671167
{ TEGRA114_CLK_I2S4_SYNC, TEGRA114_CLK_CLK_MAX, 24000000, 0 },
11681168
{ TEGRA114_CLK_VIMCLK_SYNC, TEGRA114_CLK_CLK_MAX, 24000000, 0 },
1169+
{ TEGRA114_CLK_PWM, TEGRA114_CLK_PLL_P, 408000000, 0 },
11691170
/* must be the last entry */
11701171
{ TEGRA114_CLK_CLK_MAX, TEGRA114_CLK_CLK_MAX, 0, 0 },
11711172
};

drivers/clk/tegra/clk-tegra124.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ static struct tegra_clk_init_table common_init_table[] __initdata = {
13301330
{ TEGRA124_CLK_I2S3_SYNC, TEGRA124_CLK_CLK_MAX, 24576000, 0 },
13311331
{ TEGRA124_CLK_I2S4_SYNC, TEGRA124_CLK_CLK_MAX, 24576000, 0 },
13321332
{ TEGRA124_CLK_VIMCLK_SYNC, TEGRA124_CLK_CLK_MAX, 24576000, 0 },
1333+
{ TEGRA124_CLK_PWM, TEGRA124_CLK_PLL_P, 408000000, 0 },
13331334
/* must be the last entry */
13341335
{ TEGRA124_CLK_CLK_MAX, TEGRA124_CLK_CLK_MAX, 0, 0 },
13351336
};

drivers/clk/tegra/clk-tegra20.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ static struct tegra_clk_init_table init_table[] = {
10441044
{ TEGRA20_CLK_GR2D, TEGRA20_CLK_PLL_C, 300000000, 0 },
10451045
{ TEGRA20_CLK_GR3D, TEGRA20_CLK_PLL_C, 300000000, 0 },
10461046
{ TEGRA20_CLK_VDE, TEGRA20_CLK_PLL_C, 300000000, 0 },
1047+
{ TEGRA20_CLK_PWM, TEGRA20_CLK_PLL_P, 48000000, 0 },
10471048
/* must be the last entry */
10481049
{ TEGRA20_CLK_CLK_MAX, TEGRA20_CLK_CLK_MAX, 0, 0 },
10491050
};

drivers/clk/tegra/clk-tegra210.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3597,6 +3597,7 @@ static struct tegra_clk_init_table init_table[] __initdata = {
35973597
{ TEGRA210_CLK_VIMCLK_SYNC, TEGRA210_CLK_CLK_MAX, 24576000, 0 },
35983598
{ TEGRA210_CLK_HDA, TEGRA210_CLK_PLL_P, 51000000, 0 },
35993599
{ TEGRA210_CLK_HDA2CODEC_2X, TEGRA210_CLK_PLL_P, 48000000, 0 },
3600+
{ TEGRA210_CLK_PWM, TEGRA210_CLK_PLL_P, 48000000, 0 },
36003601
/* This MUST be the last entry. */
36013602
{ TEGRA210_CLK_CLK_MAX, TEGRA210_CLK_CLK_MAX, 0, 0 },
36023603
};

drivers/clk/tegra/clk-tegra30.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ static struct tegra_clk_init_table init_table[] = {
12371237
{ TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
12381238
{ TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 },
12391239
{ TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 },
1240+
{ TEGRA30_CLK_PWM, TEGRA30_CLK_PLL_P, 48000000, 0 },
12401241
/* must be the last entry */
12411242
{ TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
12421243
};

0 commit comments

Comments
 (0)