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>
This commit is contained in:
Terje Bergstrom
2017-11-10 10:53:51 -08:00
committed by mobile promotions
parent 5944f49f55
commit 744d5a5212
6 changed files with 25 additions and 7 deletions

View File

@@ -106,9 +106,21 @@ static int nvgpu_linux_predict_mv_at_hz_cur_tfloor(struct clk_gk20a *clk,
clk_get_parent(clk->tegra_clk), rate);
}
static unsigned long nvgpu_linux_get_maxrate(struct clk_gk20a *clk)
static unsigned long nvgpu_linux_get_maxrate(struct gk20a *g, u32 api_domain)
{
return tegra_dvfs_get_maxrate(clk_get_parent(clk->tegra_clk));
int ret;
switch (api_domain) {
case CTRL_CLK_DOMAIN_GPCCLK:
ret = tegra_dvfs_get_maxrate(clk_get_parent(g->clk.tegra_clk));
break;
default:
nvgpu_err(g, "unknown clock: %u", api_domain);
ret = 0;
break;
}
return ret;
}
static int nvgpu_linux_prepare_enable(struct clk_gk20a *clk)