diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-11-10 13:53:51 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-14 18:46:58 -0500 |
commit | 744d5a5212936fd453bacc46be52e6aeef076a69 (patch) | |
tree | 50f99f03f549241c6cf47702075449feb8d70ec5 /drivers/gpu/nvgpu/common | |
parent | 5944f49f558370966d1ab943b2ec91afcdfd782d (diff) |
gpu: nvgpu: vgpu: Implement clk.get_maxfreq
Modify HAL clk->get_maxfreq() signature to match the one in
clk->set_rate() and clk->get_rate(). It allows support of multiple
clocks.
Implement clk.get_maxfreq operation for vgpu and use it to
fill max_freq field in GPU characteristics query.
JIRA NVGPU-388
Change-Id: I93bfc2aa76e38b8a5e0ac55d87c4e26df6fea77f
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1597329
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/clk.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk.c b/drivers/gpu/nvgpu/common/linux/clk.c index a9888590..ea5b023d 100644 --- a/drivers/gpu/nvgpu/common/linux/clk.c +++ b/drivers/gpu/nvgpu/common/linux/clk.c | |||
@@ -106,9 +106,21 @@ static int nvgpu_linux_predict_mv_at_hz_cur_tfloor(struct clk_gk20a *clk, | |||
106 | clk_get_parent(clk->tegra_clk), rate); | 106 | clk_get_parent(clk->tegra_clk), rate); |
107 | } | 107 | } |
108 | 108 | ||
109 | static unsigned long nvgpu_linux_get_maxrate(struct clk_gk20a *clk) | 109 | static unsigned long nvgpu_linux_get_maxrate(struct gk20a *g, u32 api_domain) |
110 | { | 110 | { |
111 | return tegra_dvfs_get_maxrate(clk_get_parent(clk->tegra_clk)); | 111 | int ret; |
112 | |||
113 | switch (api_domain) { | ||
114 | case CTRL_CLK_DOMAIN_GPCCLK: | ||
115 | ret = tegra_dvfs_get_maxrate(clk_get_parent(g->clk.tegra_clk)); | ||
116 | break; | ||
117 | default: | ||
118 | nvgpu_err(g, "unknown clock: %u", api_domain); | ||
119 | ret = 0; | ||
120 | break; | ||
121 | } | ||
122 | |||
123 | return ret; | ||
112 | } | 124 | } |
113 | 125 | ||
114 | static int nvgpu_linux_prepare_enable(struct clk_gk20a *clk) | 126 | static int nvgpu_linux_prepare_enable(struct clk_gk20a *clk) |