X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fadm1021.c;h=99e942b4995457bdf0fcb1b4539ce8cec7da5db6;hb=dfcaa61c33e1fc5f737318cfdbcf7f7b49f237a3;hp=b791ec0415b1e9254988e5b140067524daf3d34c;hpb=ab06bddb04ed4be50a8f9ad5f94fa23953a734e3;p=oweals%2Fu-boot.git diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index b791ec0415..99e942b499 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.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+ */ /* @@ -81,7 +65,7 @@ typedef } dtt_cfg_t; -dtt_cfg_t dttcfg[] = CFG_DTT_ADM1021; +dtt_cfg_t dttcfg[] = CONFIG_SYS_DTT_ADM1021; int dtt_read (int sensor, int reg) @@ -109,8 +93,8 @@ dtt_write (int sensor, int reg, int val) return 0; } /* dtt_write() */ -static int -_dtt_init (int sensor) +int +dtt_init_one(int sensor) { dtt_cfg_t *dcp = &dttcfg[sensor >> 1]; int reg, val; @@ -164,28 +148,7 @@ _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: "; - - /* switch to correct I2C bus */ - I2C_SET_BUS(CFG_DTT_BUS_NUM); - - 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)