sunxi: mmc: Use a realistic timeout when sending a mmc command
[oweals/u-boot.git] / drivers / hwmon / lm75.c
index f544ebb772913d68bd98af0482e52e3fafd72a11..462f902dad49394306889335a04bfd874e38a7ff 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2001
  * Bill Hunter,  Wave 7 Optics, williamhunter@mediaone.net
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -32,8 +16,8 @@
 /*
  * Device code
  */
-#if defined(CFG_I2C_DTT_ADDR)
-#define DTT_I2C_DEV_CODE CFG_I2C_DTT_ADDR
+#if defined(CONFIG_SYS_I2C_DTT_ADDR)
+#define DTT_I2C_DEV_CODE CONFIG_SYS_I2C_DTT_ADDR
 #else
 #define DTT_I2C_DEV_CODE 0x48                  /* ON Semi's LM75 device */
 #endif
@@ -119,17 +103,17 @@ int dtt_write(int sensor, int reg, int val)
 } /* dtt_write() */
 
 
-static int _dtt_init(int sensor)
+int dtt_init_one(int sensor)
 {
        int val;
 
        /* Setup TSET ( trip point ) register */
-       val = ((CFG_DTT_MAX_TEMP * 2) << 7) & 0xff80; /* trip */
+       val = ((CONFIG_SYS_DTT_MAX_TEMP * 2) << 7) & 0xff80; /* trip */
        if (dtt_write(sensor, DTT_TEMP_SET, val) != 0)
                return 1;
 
        /* Setup THYST ( untrip point ) register - Hysteresis */
-       val = (((CFG_DTT_MAX_TEMP - CFG_DTT_HYSTERESIS) * 2) << 7) & 0xff80;
+       val = (((CONFIG_SYS_DTT_MAX_TEMP - CONFIG_SYS_DTT_HYSTERESIS) * 2) << 7) & 0xff80;
        if (dtt_write(sensor, DTT_TEMP_HYST, val) != 0)
                return 1;
 
@@ -145,26 +129,7 @@ static int _dtt_init(int sensor)
                return 1;
 
        return 0;
-} /* _dtt_init() */
-
-
-int dtt_init (void)
-{
-       int i;
-       unsigned char sensors[] = CONFIG_DTT_SENSORS;
-       const char *const header = "DTT:   ";
-       int old_bus;
-
-       for (i = 0; i < sizeof(sensors); i++) {
-       if (_dtt_init(sensors[i]) != 0)
-               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 sensor)
 {