From: Aaron Kling <webgeek1234@gmail.com>
Some devices like the Jetson Nano report a cpu speedo value that scales
past the thermal limits of the device. This allows limiting the maximum
scaling to a lower value within the table.
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
---
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
index 0251618b82c8321724ba0aec7a5bd90b2c2ffaf2..0c84f7e85baaa96fee005a1c9a5dd6afbd1875fa 100644
--- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
+++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c
@@ -556,6 +556,7 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev)
struct tegra_dfll_soc_data *soc;
const struct dfll_fcpu_data *fcpu_data;
struct rail_alignment align;
+ u32 max_freq;
fcpu_data = of_device_get_match_data(&pdev->dev);
if (!fcpu_data)
@@ -589,7 +590,12 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev)
return err;
}
- soc->max_freq = fcpu_data->cpu_max_freq_table[speedo_id];
+ if (!of_property_read_u32(pdev->dev.of_node,
+ "nvidia,dfll-max-freq",
+ &max_freq))
+ soc->max_freq = max_freq;
+ else
+ soc->max_freq = fcpu_data->cpu_max_freq_table[speedo_id];
soc->cvb = tegra_cvb_add_opp_table(soc->dev, fcpu_data->cpu_cvb_tables,
fcpu_data->cpu_cvb_tables_size,
--
2.50.1