aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@labri.fr>2013-08-11 22:48:49 -0400
committerBen Skeggs <bskeggs@redhat.com>2013-09-04 13:46:35 +1000
commit4cc00ad1373674cdd1bce387bd1d4e3f5c42a99c (patch)
treeffd20eee9bc526cfca7e4c392435027b7fa86561 /drivers/gpu/drm/nouveau/core/subdev/therm/base.c
parentdrm/nouveau/therm: Set the correct pwm_mode upon resume (diff)
downloadlinux-dev-4cc00ad1373674cdd1bce387bd1d4e3f5c42a99c.tar.xz
linux-dev-4cc00ad1373674cdd1bce387bd1d4e3f5c42a99c.zip
drm/nouveau/fan: restore pwm value on resume when in manual/auto mode
If the fan was in manual or auto mode, we should restore the fan speed that was previously set when resuming. The initial pwm value is saved when loading the module. Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Tested-by: Dash Four <mr.dash.four@googlemail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/therm/base.c')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/therm/base.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
index 3e9d941de553..2ada3d71312f 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
@@ -267,8 +267,13 @@ _nouveau_therm_init(struct nouveau_object *object)
if (ret)
return ret;
- if (priv->suspend >= 0)
+ if (priv->suspend >= 0) {
+ /* restore the pwm value only when on manual or auto mode */
+ if (priv->suspend > 0)
+ nouveau_therm_fan_set(therm, true, priv->fan->percent);
+
nouveau_therm_fan_mode(therm, priv->suspend);
+ }
priv->sensor.program_alarms(therm);
return 0;
}