X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fhwmon%2Flm73.c;h=45cc6db58b0e74f89b58abda3f15bc09fa5a36ef;hb=64f4a6192f0670de2d9af98900b750a3e7bf8ce6;hp=98e8bd298476e4150811ebdbd0482e6893b75dd9;hpb=4b7a6dd89633d60dc4b58476d5ce48247f82a3ca;p=u-boot diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index 98e8bd2984..45cc6db58b 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c @@ -38,6 +38,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 +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) {