]> git.sur5r.net Git - u-boot/blobdiff - drivers/hwmon/lm73.c
mmc: support the correct card version for eMMC
[u-boot] / drivers / hwmon / lm73.c
index 98e8bd298476e4150811ebdbd0482e6893b75dd9..45cc6db58b0e74f89b58abda3f15bc09fa5a36ef 100644 (file)
  * Device code
  */
 #define DTT_I2C_DEV_CODE 0x48  /* National Semi's LM73 device */
+#define DTT_READ_TEMP          0x0
+#define DTT_CONFIG             0x1
+#define DTT_TEMP_HIGH          0x2
+#define DTT_TEMP_LOW           0x3
+#define DTT_CONTROL            0x4
+#define DTT_ID                 0x7
 
 int dtt_read(int const sensor, int const reg)
 {
@@ -106,7 +112,7 @@ int dtt_write(int const sensor, int const reg, int const val)
                              dlen);
 } /* dtt_write() */
 
-static int _dtt_init(int const sensor)
+int dtt_init_one(int const sensor)
 {
        int val;
 
@@ -118,11 +124,11 @@ static int _dtt_init(int const sensor)
        /*
         * Setup THIGH (upper-limit) and TLOW (lower-limit) registers
         */
-       val = CFG_DTT_MAX_TEMP << 7;
+       val = CONFIG_SYS_DTT_MAX_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_HIGH, val))
                return -1;
 
-       val = CFG_DTT_MIN_TEMP << 7;
+       val = CONFIG_SYS_DTT_MIN_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_LOW, val))
                return -1;
        /*
@@ -142,23 +148,7 @@ static int _dtt_init(int const sensor)
 
        dtt_read(sensor, DTT_CONTROL);  /* clear temperature flags */
        return 0;
-} /* _dtt_init() */
-
-int dtt_init(void)
-{
-       int i;
-       unsigned char sensors[] = CONFIG_DTT_SENSORS;
-       const char *const header = "DTT:   ";
-
-       for (i = 0; i < sizeof(sensors); i++) {
-               if (0 != _dtt_init(sensors[i]))
-                       printf("%s%d FAILED INIT\n", header, i + 1);
-               else
-                       printf("%s%d is %i C\n", header, i + 1,
-                              dtt_get_temp(sensors[i]));
-       }
-       return 0;
-} /* dtt_init() */
+} /* dtt_init_one() */
 
 int dtt_get_temp(int const sensor)
 {