aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/therm/base.c7
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/therm/fan.c3
2 files changed, 9 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)
267 if (ret) 267 if (ret)
268 return ret; 268 return ret;
269 269
270 if (priv->suspend >= 0) 270 if (priv->suspend >= 0) {
271 /* restore the pwm value only when on manual or auto mode */
272 if (priv->suspend > 0)
273 nouveau_therm_fan_set(therm, true, priv->fan->percent);
274
271 nouveau_therm_fan_mode(therm, priv->suspend); 275 nouveau_therm_fan_mode(therm, priv->suspend);
276 }
272 priv->sensor.program_alarms(therm); 277 priv->sensor.program_alarms(therm);
273 return 0; 278 return 0;
274} 279}
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
index c728380d3d62..4d8450fcf0a0 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/fan.c
@@ -234,6 +234,9 @@ nouveau_therm_fan_ctor(struct nouveau_therm *therm)
234 234
235 nv_info(therm, "FAN control: %s\n", priv->fan->type); 235 nv_info(therm, "FAN control: %s\n", priv->fan->type);
236 236
237 /* read the current speed, it is useful when resuming */
238 priv->fan->percent = nouveau_therm_fan_get(therm);
239
237 /* attempt to detect a tachometer connection */ 240 /* attempt to detect a tachometer connection */
238 ret = gpio->find(gpio, 0, DCB_GPIO_FAN_SENSE, 0xff, &priv->fan->tach); 241 ret = gpio->find(gpio, 0, DCB_GPIO_FAN_SENSE, 0xff, &priv->fan->tach);
239 if (ret) 242 if (ret)