From: Ben Skeggs Date: Thu, 21 Jul 2011 05:52:52 +0000 (+1000) Subject: drm/nva3/pm: use crystal freq where appropriate X-Git-Tag: MMI-PSA29.97-13-9~18200^2~58^2~36 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=64e740bb3d43a3abcd0b51cda3ba46b35bff30b2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/nva3/pm: use crystal freq where appropriate Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c index 16d574dbe369..ec684f56dfc6 100644 --- a/drivers/gpu/drm/nouveau/nva3_pm.c +++ b/drivers/gpu/drm/nouveau/nva3_pm.c @@ -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;