drm/nouveau/therm: display the availability of the internal sensor
authorMartin Peres <martin.peres@labri.fr>
Fri, 15 Mar 2013 00:47:16 +0000 (01:47 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 18 Mar 2013 01:15:27 +0000 (11:15 +1000)
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/base.c
drivers/gpu/drm/nouveau/core/subdev/therm/priv.h
drivers/gpu/drm/nouveau/core/subdev/therm/temp.c

index d6a05589c9418b08cc01e401fe1a80a7a1257e66..a00a5a76e2d62b82d5717923e98e85541bb7597c 100644 (file)
@@ -323,6 +323,7 @@ nouveau_therm_preinit(struct nouveau_therm *therm)
        nouveau_therm_fan_ctor(therm);
 
        nouveau_therm_fan_mode(therm, NOUVEAU_THERM_CTRL_NONE);
+       nouveau_therm_sensor_preinit(therm);
        return 0;
 }
 
index d8483dd5e0f90d823fecbe547c6b5a8f13f58117..438d9824b7741c5733bf2aa0f8ec306784569efe 100644 (file)
@@ -122,6 +122,7 @@ int nouveau_therm_fan_sense(struct nouveau_therm *therm);
 
 int nouveau_therm_preinit(struct nouveau_therm *);
 
+void nouveau_therm_sensor_preinit(struct nouveau_therm *);
 void nouveau_therm_sensor_set_threshold_state(struct nouveau_therm *therm,
                                             enum nouveau_therm_thrs thrs,
                                             enum nouveau_therm_thrs_state st);
index 2a02c9f1d7ff1cb31642647b4ae00d9fca558eb1..470f6a47b6565bfe4d3ad257fa5d7f038ca25755 100644 (file)
@@ -216,6 +216,17 @@ nouveau_therm_program_alarms_polling(struct nouveau_therm *therm)
        alarm_timer_callback(&priv->sensor.therm_poll_alarm);
 }
 
+void
+nouveau_therm_sensor_preinit(struct nouveau_therm *therm)
+{
+       const char *sensor_avail = "yes";
+
+       if (therm->temp_get(therm) < 0)
+               sensor_avail = "no";
+
+       nv_info(therm, "internal sensor: %s\n", sensor_avail);
+}
+
 int
 nouveau_therm_sensor_ctor(struct nouveau_therm *therm)
 {