X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fhwmon%2Flm73.c;h=c15c7514d86598562acaa07dd5d0ec25af189277;hb=30e6d979fa9da56a5badcb981cdddd58638d3375;hp=98e8bd298476e4150811ebdbd0482e6893b75dd9;hpb=7754f33c6fb7a2c050388d20bf3847038558bdcf;p=u-boot diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index 98e8bd2984..c15c7514d8 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c @@ -7,23 +7,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+ */ /* @@ -38,6 +22,12 @@ * 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 +96,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 +108,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 +132,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) {