Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Initialize sensor state before registering.



details:   https://anonhg.NetBSD.org/src/rev/6e73b005a9b3
branches:  trunk
changeset: 766328:6e73b005a9b3
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Jun 20 20:16:19 2011 +0000

description:
Initialize sensor state before registering.

XXX Still need to fix i2c/ibmhawk.c

diffstat:

 sys/dev/i2c/adm1021.c |  6 ++++--
 sys/dev/i2c/dbcool.c  |  8 ++++++--
 sys/dev/i2c/g760a.c   |  5 +++--
 sys/dev/i2c/lm75.c    |  5 +++--
 sys/dev/i2c/pic16lc.c |  6 ++++--
 sys/dev/i2c/smscmon.c |  5 +++--
 6 files changed, 23 insertions(+), 12 deletions(-)

diffs (182 lines):

diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/adm1021.c
--- a/sys/dev/i2c/adm1021.c     Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/adm1021.c     Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adm1021.c,v 1.6 2011/06/19 11:44:03 martin Exp $ */
+/*     $NetBSD: adm1021.c,v 1.7 2011/06/20 20:16:19 pgoyette Exp $ */
 /*     $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $        */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.6 2011/06/19 11:44:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.7 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -157,6 +157,8 @@
        sc->sc_sensor[ADMTEMP_INT].units = ENVSYS_STEMP;
        sc->sc_sensor[ADMTEMP_EXT].state = ENVSYS_SINVALID;
        sc->sc_sensor[ADMTEMP_EXT].units = ENVSYS_STEMP;
+       sc->sc_sensor[ADMTEMP_INT].state = ENVSYS_SINVALID;
+       sc->sc_sensor[ADMTEMP_EXT].state = ENVSYS_SINVALID;
        strlcpy(sc->sc_sensor[ADMTEMP_INT].desc, "internal",sizeof("internal"));
        strlcpy(sc->sc_sensor[ADMTEMP_EXT].desc, "external",sizeof("external"));
        sc->sc_sme = sysmon_envsys_create();
diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/dbcool.c
--- a/sys/dev/i2c/dbcool.c      Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/dbcool.c      Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dbcool.c,v 1.29 2011/03/12 13:33:18 pgoyette Exp $ */
+/*     $NetBSD: dbcool.c,v 1.30 2011/06/20 20:16:19 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.29 2011/03/12 13:33:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.30 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1601,6 +1601,7 @@
                switch (chip->table[i].type) {
                case DBC_TEMP:
                        sc->sc_sensor[i].units = ENVSYS_STEMP;
+                       sc->sc_sensor[i].state = ENVSYS_SINVALID;
                        sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
                        error = dbcool_attach_sensor(sc, i);
                        break;
@@ -1616,16 +1617,19 @@
                                break;
 
                        sc->sc_sensor[i].units = ENVSYS_SVOLTS_DC;
+                       sc->sc_sensor[i].state = ENVSYS_SINVALID;
                        sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
                        error = dbcool_attach_sensor(sc, i);
                        break;
                case DBC_FAN:
                        sc->sc_sensor[i].units = ENVSYS_SFANRPM;
+                       sc->sc_sensor[i].state = ENVSYS_SINVALID;
                        sc->sc_sensor[i].flags |= ENVSYS_FMONLIMITS;
                        error = dbcool_attach_sensor(sc, i);
                        break;
                case DBC_VID:
                        sc->sc_sensor[i].units = ENVSYS_INTEGER;
+                       sc->sc_sensor[i].state = ENVSYS_SINVALID;
                        sc->sc_sensor[i].flags |= ENVSYS_FMONNOTSUPP;
 
                        /* retrieve 5- or 6-bit value */
diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/g760a.c
--- a/sys/dev/i2c/g760a.c       Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/g760a.c       Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: g760a.c,v 1.1 2010/10/02 06:07:37 kiyohara Exp $       */
+/*     $NetBSD: g760a.c,v 1.2 2011/06/20 20:16:19 pgoyette Exp $       */
 
 /*-
  * Copyright (C) 2008 A.Leo.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: g760a.c,v 1.1 2010/10/02 06:07:37 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: g760a.c,v 1.2 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -231,6 +231,7 @@
        (void)strlcpy(sc->sc_sensor.desc, "sysfan rpm",
                        sizeof(sc->sc_sensor.desc));
        sc->sc_sensor.units = ENVSYS_SFANRPM;
+       sc->sc_sensor.state = ENVSYS_SINVALID;
 
        if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor))
                goto out;
diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/lm75.c
--- a/sys/dev/i2c/lm75.c        Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/lm75.c        Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lm75.c,v 1.21 2010/02/28 11:36:27 martin Exp $ */
+/*     $NetBSD: lm75.c,v 1.22 2011/06/20 20:16:19 pgoyette Exp $       */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.21 2010/02/28 11:36:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.22 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -177,6 +177,7 @@
        sc->sc_sme = sysmon_envsys_create();
        /* Initialize sensor data. */
        sc->sc_sensor.units =  ENVSYS_STEMP;
+       sc->sc_sensor.state =  ENVSYS_SINVALID;
        (void)strlcpy(sc->sc_sensor.desc,
            ia->ia_name? ia->ia_name : device_xname(self),
            sizeof(sc->sc_sensor.desc));
diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/pic16lc.c
--- a/sys/dev/i2c/pic16lc.c     Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/pic16lc.c     Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pic16lc.c,v 1.15 2008/06/08 03:56:09 tsutsui Exp $ */
+/* $NetBSD: pic16lc.c,v 1.16 2011/06/20 20:16:19 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic16lc.c,v 1.15 2008/06/08 03:56:09 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic16lc.c,v 1.16 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -113,10 +113,12 @@
 
        /* initialize CPU sensor */
        sc->sc_sensor[XBOX_SENSOR_CPU].units = ENVSYS_STEMP;
+       sc->sc_sensor[XBOX_SENSOR_CPU].state = ENVSYS_SINVALID;
        (void)strlcpy(sc->sc_sensor[XBOX_SENSOR_CPU].desc, "Xbox CPU Temp",
            sizeof(sc->sc_sensor[XBOX_SENSOR_CPU]));
        /* initialize board sensor */
        sc->sc_sensor[XBOX_SENSOR_BOARD].units = ENVSYS_STEMP;
+       sc->sc_sensor[XBOX_SENSOR_BOARD].state = ENVSYS_SINVALID;
        (void)strlcpy(sc->sc_sensor[XBOX_SENSOR_BOARD].desc, "Xbox Board Temp",
            sizeof(sc->sc_sensor[XBOX_SENSOR_BOARD]));
 
diff -r 91247c3d63d9 -r 6e73b005a9b3 sys/dev/i2c/smscmon.c
--- a/sys/dev/i2c/smscmon.c     Mon Jun 20 19:56:10 2011 +0000
+++ b/sys/dev/i2c/smscmon.c     Mon Jun 20 20:16:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smscmon.c,v 1.1 2010/02/22 03:50:56 pgoyette Exp $ */
+/* $NetBSD: smscmon.c,v 1.2 2011/06/20 20:16:19 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2009 Takahiro Hayashi
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smscmon.c,v 1.1 2010/02/22 03:50:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smscmon.c,v 1.2 2011/06/20 20:16:19 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -285,6 +285,7 @@
                strlcpy(sc->sensors[i].desc, sens[i].desc,
                    sizeof(sc->sensors[i].desc));
                sc->sensors[i].units = sens[i].type;
+               sc->sensors[i].state = ENVSYS_SINVALID;
                sc->numsensors++;
        }
        sc->smscmon_sensors = sens;



Home | Main Index | Thread Index | Old Index