updated copyright to 2013
[psensor.git] / src / lib / nvidia.c
index cface2f..baef0b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 jeanfi@gmail.com
+ * Copyright (C) 2010-2013 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -60,15 +60,19 @@ static struct psensor *create_sensor(int id, int values_len)
        char name[200];
        char *sid;
        struct psensor *s;
+       int t;
 
        sprintf(name, "GPU%d", id);
 
        sid = malloc(strlen("nvidia") + 1 + strlen(name) + 1);
        sprintf(sid, "nvidia %s", name);
 
+       t = SENSOR_TYPE_NVCTRL | SENSOR_TYPE_GPU | SENSOR_TYPE_TEMP;
+
        s = psensor_create(sid,
                           strdup(name),
-                          SENSOR_TYPE_NVIDIA_TEMP,
+                          strdup("Nvidia GPU"),
+                          t,
                           values_len);
 
        s->nvidia_id = id;
@@ -110,7 +114,7 @@ void nvidia_psensor_list_update(struct psensor **sensors)
        while (*ss) {
                s = *ss;
 
-               if (s->type == SENSOR_TYPE_NVIDIA_TEMP)
+               if (s->type & SENSOR_TYPE_NVCTRL)
                        psensor_set_current_value(s, get_temp(s));
 
                ss++;