Commit 64e740bb authored by Ben Skeggs's avatar Ben Skeggs

drm/nva3/pm: use crystal freq where appropriate

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f2cbe46f
...@@ -42,11 +42,12 @@ read_vco(struct drm_device *dev, int clk) ...@@ -42,11 +42,12 @@ read_vco(struct drm_device *dev, int clk)
static u32 static u32
read_clk(struct drm_device *dev, int clk, bool ignore_en) read_clk(struct drm_device *dev, int clk, bool ignore_en)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private;
u32 sctl, sdiv, sclk; u32 sctl, sdiv, sclk;
/* refclk for the 0xe8xx plls always 27KHz */ /* refclk for the 0xe8xx plls is a fixed frequency */
if (clk >= 0x40) if (clk >= 0x40)
return 27000; return dev_priv->crystal;
sctl = nv_rd32(dev, 0x4120 + (clk * 4)); sctl = nv_rd32(dev, 0x4120 + (clk * 4));
if (!ignore_en && !(sctl & 0x00000100)) if (!ignore_en && !(sctl & 0x00000100))
...@@ -54,7 +55,7 @@ read_clk(struct drm_device *dev, int clk, bool ignore_en) ...@@ -54,7 +55,7 @@ read_clk(struct drm_device *dev, int clk, bool ignore_en)
switch (sctl & 0x00003000) { switch (sctl & 0x00003000) {
case 0x00000000: case 0x00000000:
return 27000; return dev_priv->crystal;
case 0x00002000: case 0x00002000:
if (sctl & 0x00000040) if (sctl & 0x00000040)
return 108000; return 108000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment