Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Shuffle thermal sensor numbering so temp0 is alw...



details:   https://anonhg.NetBSD.org/src/rev/200b1d04a5c6
branches:  trunk
changeset: 584223:200b1d04a5c6
user:      macallan <macallan%NetBSD.org@localhost>
date:      Sun Sep 11 20:26:15 2005 +0000

description:
Shuffle thermal sensor numbering so temp0 is always the on-chip sensor and temp1
is always CPU temperature.

diffstat:

 sys/dev/i2c/adm1030.c |  12 ++++++------
 sys/dev/i2c/adt7467.c |  12 +++++++-----
 2 files changed, 13 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r 9808d8f81aed -r 200b1d04a5c6 sys/dev/i2c/adm1030.c
--- a/sys/dev/i2c/adm1030.c     Sun Sep 11 20:19:31 2005 +0000
+++ b/sys/dev/i2c/adm1030.c     Sun Sep 11 20:26:15 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adm1030.c,v 1.1 2005/08/10 14:18:28 macallan Exp $     */
+/*     $NetBSD: adm1030.c,v 1.2 2005/09/11 20:26:15 macallan Exp $     */
 
 /*-
  * Copyright (C) 2005 Michael Lorenz.
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adm1030.c,v 1.1 2005/08/10 14:18:28 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1030.c,v 1.2 2005/09/11 20:26:15 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -211,10 +211,10 @@
        cur_r = &adm1030c_ranges[0];
        cur_i = &adm1030c_info[0];
        cur_t = &datap->adm1030c_info[0];
-       strcpy(cur_i->desc, "CPU temperature");
+       strcpy(cur_i->desc, "case temperature");
        cur_i->units = ENVSYS_STEMP;
        cur_i->sensor = 0;
-       sc->regs[0] = 0x0b;     /* remote temperature register */
+       sc->regs[0] = 0x0a;     /* remote temperature register */
        cur_r->low = adm1030c_temp2muk(-127);
        cur_r->high = adm1030c_temp2muk(127);
        cur_r->units = ENVSYS_STEMP;
@@ -235,11 +235,11 @@
        cur_r = &adm1030c_ranges[1];
        cur_i = &adm1030c_info[1];
        cur_t = &datap->adm1030c_info[1];
-       strcpy(cur_i->desc, "case temperature");
+       strcpy(cur_i->desc, "CPU temperature");
        
        cur_i->units = ENVSYS_STEMP;
        cur_i->sensor = 1;
-       sc->regs[1] = 0x0a;     /* built-in temperature register */
+       sc->regs[1] = 0x0b;     /* built-in temperature register */
        cur_r->low = adm1030c_temp2muk(-127);
        cur_r->high = adm1030c_temp2muk(127);
        cur_r->units = ENVSYS_STEMP;
diff -r 9808d8f81aed -r 200b1d04a5c6 sys/dev/i2c/adt7467.c
--- a/sys/dev/i2c/adt7467.c     Sun Sep 11 20:19:31 2005 +0000
+++ b/sys/dev/i2c/adt7467.c     Sun Sep 11 20:26:15 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adt7467.c,v 1.1 2005/08/10 14:18:28 macallan Exp $     */
+/*     $NetBSD: adt7467.c,v 1.2 2005/09/11 20:26:15 macallan Exp $     */
 
 /*-
  * Copyright (C) 2005 Michael Lorenz
@@ -37,7 +37,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adt7467.c,v 1.1 2005/08/10 14:18:28 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adt7467.c,v 1.2 2005/09/11 20:26:15 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -199,8 +199,10 @@
        struct envsys_tre_data *cur_t;
        int i, ret;
        int error;
-       uint8_t stuff;
+       const char *sensor_desc[] = { "case temperature", "CPU temperature",
+           "GPU temperature" };
        char name[16];
+       uint8_t stuff, sensortab[] = {0x26, 0x27, 0x25};
        
        sc->num_sensors = 5;
        datap = malloc(sizeof(struct sysmon_envsys) + 5 * 
@@ -226,10 +228,10 @@
                cur_i = &adt7467c_info[i];
                cur_t = &datap->adt7467c_info[i];
                snprintf(name, 16, "temp%d", i);
-               strcpy(cur_i->desc, name);
+               strcpy(cur_i->desc, sensor_desc[i]);
                cur_r->units = ENVSYS_STEMP;
                cur_i->sensor = i;
-               sc->regs[i] = i + 0x25;
+               sc->regs[i] = sensortab[i];
                cur_r->low = temp2muk(-127);
                cur_r->high = temp2muk(127);
                ret = sysctl_createv(NULL, 0, NULL, 



Home | Main Index | Thread Index | Old Index