drm/nva3/pm: use crystal freq where appropriate
authorBen Skeggs <bskeggs@redhat.com>
Thu, 21 Jul 2011 05:52:52 +0000 (15:52 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 20 Sep 2011 06:08:44 +0000 (16:08 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nva3_pm.c

index 16d574dbe3697164a9635f8b894830d244c7bac4..ec684f56dfc6f7bba3d20f44593991b0dffcf320 100644 (file)
@@ -42,11 +42,12 @@ read_vco(struct drm_device *dev, int clk)
 static u32
 read_clk(struct drm_device *dev, int clk, bool ignore_en)
 {
+       struct drm_nouveau_private *dev_priv = dev->dev_private;
        u32 sctl, sdiv, sclk;
 
-       /* refclk for the 0xe8xx plls always 27KHz */
+       /* refclk for the 0xe8xx plls is a fixed frequency */
        if (clk >= 0x40)
-               return 27000;
+               return dev_priv->crystal;
 
        sctl = nv_rd32(dev, 0x4120 + (clk * 4));
        if (!ignore_en && !(sctl & 0x00000100))
@@ -54,7 +55,7 @@ read_clk(struct drm_device *dev, int clk, bool ignore_en)
 
        switch (sctl & 0x00003000) {
        case 0x00000000:
-               return 27000;
+               return dev_priv->crystal;
        case 0x00002000:
                if (sctl & 0x00000040)
                        return 108000;