提交 3c0d5d6e 编写于 作者: A Alexandre Courbot 提交者: Ben Skeggs

drm/nouveau/clk/gk20a: only restore divider to 1:1 if needed

Only restore the 1:1 divider if it is not set already. Also use the
proper masks for this operation and add a second write as done in the
Android code.
Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 a08c8bae
...@@ -429,9 +429,16 @@ _gk20a_pllg_program_mnp(struct gk20a_clk *clk, bool allow_slide) ...@@ -429,9 +429,16 @@ _gk20a_pllg_program_mnp(struct gk20a_clk *clk, bool allow_slide)
/* restore out divider 1:1 */ /* restore out divider 1:1 */
val = nvkm_rd32(device, GPC2CLK_OUT); val = nvkm_rd32(device, GPC2CLK_OUT);
if ((val & GPC2CLK_OUT_VCODIV_MASK) !=
(GPC2CLK_OUT_VCODIV1 << GPC2CLK_OUT_VCODIV_SHIFT)) {
val &= ~GPC2CLK_OUT_VCODIV_MASK; val &= ~GPC2CLK_OUT_VCODIV_MASK;
val |= GPC2CLK_OUT_VCODIV1 << GPC2CLK_OUT_VCODIV_SHIFT;
udelay(2); udelay(2);
nvkm_wr32(device, GPC2CLK_OUT, val); nvkm_wr32(device, GPC2CLK_OUT, val);
/* Intentional 2nd write to assure linear divider operation */
nvkm_wr32(device, GPC2CLK_OUT, val);
nvkm_rd32(device, GPC2CLK_OUT);
}
/* slide up to new NDIV */ /* slide up to new NDIV */
return allow_slide ? gk20a_pllg_slide(clk, clk->n) : 0; return allow_slide ? gk20a_pllg_slide(clk, clk->n) : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册