]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
drm/nouveau/therm: don't attempt fan control where PMU is already managing it
[linux.git] / drivers / gpu / drm / nouveau / nvkm / subdev / therm / base.c
index 07914e36939e3d80b557ee1267ab3f9f0f648ca2..4a4d1e224126464fd1881a062cbddcc1b34ad8b4 100644 (file)
  *
  * Authors: Martin Peres
  */
-#include <nvkm/core/option.h>
 #include "priv.h"
 
+#include <core/option.h>
+#include <subdev/pmu.h>
+
 int
 nvkm_therm_temp_get(struct nvkm_therm *therm)
 {
@@ -192,8 +194,7 @@ nvkm_therm_fan_mode(struct nvkm_therm *therm, int mode)
 
        /* The default PPWR ucode on fermi interferes with fan management */
        if ((mode >= ARRAY_SIZE(name)) ||
-           (mode != NVKM_THERM_CTRL_NONE && device->card_type >= NV_C0 &&
-            !device->pmu))
+           (mode != NVKM_THERM_CTRL_NONE && nvkm_pmu_fan_controlled(device)))
                return -EINVAL;
 
        /* do not allow automatic fan management if the thermal sensor is