aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_pm.c
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@ensi-bourges.fr>2011-10-07 01:33:12 +0200
committerBen Skeggs <bskeggs@redhat.com>2012-03-13 17:06:07 +1000
commitbc6389e4fa1a6535021ffc4d3b37d48f9a0542e2 (patch)
tree80a19a1d341b0d790244856b8fe3f4fd6a5dffcc /drivers/gpu/drm/nouveau/nouveau_pm.c
parentddb2005516949dc50d117cb8381d7a3f8f0614b0 (diff)
drm/nouveau/pm: restore fan speed after suspend
Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_pm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 1770f1569c90..0c79f060f7f1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -89,7 +89,10 @@ nouveau_pwmfan_set(struct drm_device *dev, int percent)
if (dev_priv->card_type <= NV_40 || (gpio.log[0] & 1))
duty = divs - duty;
- return pm->pwm_set(dev, gpio.line, divs, duty);
+ ret = pm->pwm_set(dev, gpio.line, divs, duty);
+ if (!ret)
+ pm->fan.percent = percent;
+ return ret;
}
return -ENODEV;
@@ -800,6 +803,9 @@ nouveau_pm_init(struct drm_device *dev)
}
}
+ /* determine the current fan speed */
+ pm->fan.percent = nouveau_pwmfan_get(dev);
+
nouveau_sysfs_init(dev);
nouveau_hwmon_init(dev);
#if defined(CONFIG_ACPI) && defined(CONFIG_POWER_SUPPLY)
@@ -844,4 +850,5 @@ nouveau_pm_resume(struct drm_device *dev)
perflvl = pm->cur;
pm->cur = &pm->boot;
nouveau_pm_perflvl_set(dev, perflvl);
+ nouveau_pwmfan_set(dev, pm->fan.percent);
}