diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index fbdf9368..16f88d62 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c | |||
@@ -302,10 +302,11 @@ static void clk_config_dvfs_ndiv(int mv, u32 n_eff, struct na_dvfs *d) | |||
302 | u32 rem, rem_range; | 302 | u32 rem, rem_range; |
303 | struct pll_parms *p = &gpc_pll_params; | 303 | struct pll_parms *p = &gpc_pll_params; |
304 | 304 | ||
305 | det_delta = (mv * 1000 - d->uv_cal); | 305 | det_delta = DIV_ROUND_CLOSEST(mv * 1000 - p->uvdet_offs, |
306 | det_delta = min(det_delta, d->dfs_det_max * p->uvdet_slope); | 306 | p->uvdet_slope); |
307 | det_delta -= d->dfs_ext_cal; | ||
308 | det_delta = min(det_delta, d->dfs_det_max); | ||
307 | det_delta = det_delta * d->dfs_coeff; | 309 | det_delta = det_delta * d->dfs_coeff; |
308 | det_delta = DIV_ROUND_CLOSEST(det_delta, p->uvdet_slope); | ||
309 | 310 | ||
310 | n = (int)(n_eff << DFS_DET_RANGE) - det_delta; | 311 | n = (int)(n_eff << DFS_DET_RANGE) - det_delta; |
311 | BUG_ON((n < 0) || (n > (p->max_N << DFS_DET_RANGE))); | 312 | BUG_ON((n < 0) || (n > (p->max_N << DFS_DET_RANGE))); |