diff --git a/CHANGES b/CHANGES index 32e20727..02f430f2 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ SVN HEAD Fix adm1026 critical temperature limits for Linux 2.6 Fix smsc47m192 temperature faults Add sch311x support + Add support for adm1022 temp3 Makefile: Fix kernel version detection (#2187) Module fscher: Add missing read of control register (2.6 backport) Module i2c-piix4: Add ATI SB700 and SB800 support (2.6 backport) @@ -20,6 +21,7 @@ SVN HEAD Program sensors: Fix a memory leak on error (with -u) Add sch311x support Hide error on missing dme1737 fan and pwm + Add thmc50/adm1022 support Program sensors-detect: Don't probe i2c-isa as a regular i2c bus Add Winbond W83L786NR/NG/R/G detection Add Winbond W83L771W/G detection diff --git a/lib/chips.c b/lib/chips.c index efa19191..450fd298 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -2756,6 +2756,19 @@ static sensors_chip_feature thmc50_features[] = SENSORS_THMC50_REMOTE_TEMP, RW }, THMC50_SYSCTL_REMOTE_TEMP, VALUE(1), 0 }, + { { SENSORS_ADM1022_REMOTE_TEMP2, "remote_temp2", NOMAP, NOMAP, R }, + NOSYSCTL, VALUE(3), + 0, "temp3_input", 3 }, + { { SENSORS_ADM1022_REMOTE_TEMP2_HYST, "remote_temp2_hyst", + SENSORS_ADM1022_REMOTE_TEMP2, + SENSORS_ADM1022_REMOTE_TEMP2, RW }, + NOSYSCTL, VALUE(2), + 0, "temp3_min", 3 }, + { { SENSORS_ADM1022_REMOTE_TEMP2_OVER, "remote2_temp_over", + SENSORS_ADM1022_REMOTE_TEMP2, + SENSORS_ADM1022_REMOTE_TEMP2, RW }, + NOSYSCTL, VALUE(1), + 0, "temp3_max", 3 }, { { SENSORS_THMC50_ANALOG_OUT, "analog output", NOMAP, NOMAP, RW }, THMC50_SYSCTL_ANALOG_OUT, VALUE(1), 0, "pwm1", 0 }, diff --git a/lib/chips.h b/lib/chips.h index 4f1f8932..e9483384 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1191,6 +1191,9 @@ #define SENSORS_THMC50_REMOTE_TEMP 54 /* R */ #define SENSORS_THMC50_REMOTE_TEMP_HYST 55 /* RW */ #define SENSORS_THMC50_REMOTE_TEMP_OVER 56 /* RW */ +#define SENSORS_ADM1022_REMOTE_TEMP2 57 /* R */ +#define SENSORS_ADM1022_REMOTE_TEMP2_HYST 58 /* RW */ +#define SENSORS_ADM1022_REMOTE_TEMP2_OVER 59 /* RW */ #define SENSORS_THMC50_ANALOG_OUT 71 /* RW */ #define SENSORS_THMC50_INTER 81 /* R */ #define SENSORS_THMC50_INTER_MASK 82 /* RW */ diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 6980a603..4b79e6a8 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -6251,6 +6251,55 @@ void print_f71882fg(const sensors_chip_name *name) print_f71882fg_temp(name, i); } +void print_thmc50(const sensors_chip_name *name) +{ + char *label; + double cur, hyst, over; + int valid; + + if (!sensors_get_label_and_valid(*name, SENSORS_THMC50_TEMP, + &label, &valid) && + !sensors_get_feature(*name, SENSORS_THMC50_TEMP, &cur) && + !sensors_get_feature(*name, SENSORS_THMC50_TEMP_HYST, &hyst) && + !sensors_get_feature(*name, SENSORS_THMC50_TEMP_OVER, &over)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, over, hyst, MINMAX, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get temperature1 data!\n"); + free(label); + + if (!sensors_get_label_and_valid(*name, SENSORS_THMC50_REMOTE_TEMP, + &label, &valid) && + !sensors_get_feature(*name, SENSORS_THMC50_REMOTE_TEMP, &cur) && + !sensors_get_feature(*name, SENSORS_THMC50_REMOTE_TEMP_HYST, &hyst) && + !sensors_get_feature(*name, SENSORS_THMC50_REMOTE_TEMP_OVER, &over)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, over, hyst, MINMAX, 0, 0); + printf("\n"); + } + } else + printf("ERROR: Can't get temperature2 data!\n"); + free(label); + + if (!sensors_get_label_and_valid(*name, SENSORS_ADM1022_REMOTE_TEMP2, + &label, &valid) && + !sensors_get_feature(*name, SENSORS_ADM1022_REMOTE_TEMP2, &cur) && + !sensors_get_feature(*name, SENSORS_ADM1022_REMOTE_TEMP2_HYST, &hyst) && + !sensors_get_feature(*name, SENSORS_ADM1022_REMOTE_TEMP2_OVER, &over)) { + if (valid) { + print_label(label, 10); + print_temp_info(cur, over, hyst, MINMAX, 0, 0); + printf("\n"); + } + } + /* No error if files are missing as it will happen for original thmc50 */ + free(label); +} + void print_unknown_chip(const sensors_chip_name *name) { int a,b,valid; diff --git a/prog/sensors/chips.h b/prog/sensors/chips.h index 140c331e..9531633f 100644 --- a/prog/sensors/chips.h +++ b/prog/sensors/chips.h @@ -80,5 +80,6 @@ extern void print_coretemp(const sensors_chip_name *name); extern void print_dme1737(const sensors_chip_name *name); extern void print_applesmc(const sensors_chip_name *name); extern void print_f71882fg(const sensors_chip_name *name); +extern void print_thmc50(const sensors_chip_name *name); #endif /* def PROG_SENSORS_CHIPS_H */ diff --git a/prog/sensors/main.c b/prog/sensors/main.c index 78789eae..2f480dea 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -427,6 +427,8 @@ static struct match matches[] = { { "sch311x", print_dme1737 }, { "applesmc", print_applesmc }, { "f71882fg", print_f71882fg }, + { "thmc50", print_thmc50 }, + { "adm1022", print_thmc50 }, { NULL, NULL } };