summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
index 5e5c7703..9fabe1f5 100644
--- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
@@ -328,9 +328,17 @@ static unsigned long gp10b_get_clk_rate(struct device *dev)
328 328
329static long gp10b_round_clk_rate(struct device *dev, unsigned long rate) 329static long gp10b_round_clk_rate(struct device *dev, unsigned long rate)
330{ 330{
331 struct gk20a_platform *platform = gk20a_get_platform(dev); 331 struct gk20a *g = get_gk20a(dev);
332 struct gk20a_scale_profile *profile = g->scale_profile;
333 unsigned long *freq_table = profile->devfreq_profile.freq_table;
334 int max_states = profile->devfreq_profile.max_state;
335 int i;
336
337 for (i = 0; i < max_states; ++i)
338 if (freq_table[i] > rate)
339 return freq_table[i];
332 340
333 return clk_round_rate(platform->clk[0], rate); 341 return freq_table[max_states - 1];
334} 342}
335 343
336static int gp10b_set_clk_rate(struct device *dev, unsigned long rate) 344static int gp10b_set_clk_rate(struct device *dev, unsigned long rate)