diff --git a/CHANGES b/CHANGES index 59786e14..7bdd587f 100644 --- a/CHANGES +++ b/CHANGES @@ -18,8 +18,9 @@ ask CVS about it: ----------------------------------------------------------------------------- 2.6.5 (2002????) - File sensors.conf.eg: Fix temp[23] for as99127f - Library: Fix fan3_div writes for w8378* and it87 + NOTE: Requires i2c-2.6.1 or newer, or kernel 2.4.13 or newer. + File sensors.conf.eg: Fix temp[23] for as99127f; add vt8231 + Library: Fix fan3_div writes for w8378* and it87; add vt8231 Module dmi_scan: new Module ds1621: Fix enable/disable Module i2c-i801: Check for uninitialized base address; @@ -41,7 +42,7 @@ ask CVS about it: fix down-converting raw labels for RRD; update chip support, still behind sensors Program sensors: Add /usr/local/etc to config file path; - fix -c and -u flags + fix -c and -u flags; add vt8231 Program sensors-detect: recognize Asus "ASB100 Bach" as AS99127F; refuse to run on IBM systems; fix sysconfig module numbering diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index 63674946..01225ce4 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -951,6 +951,8 @@ chip "adm1025-*" label temp1 "SYS Temp" label temp2 "CPU Temp" +# temp minimums should be renamed from _hyst to _min!!! + # adjust this if your vid is wrong; see doc/vid set vrm 9.0 set in1_min vid * 0.95 @@ -1344,9 +1346,9 @@ chip "adm1021-*" "adm1023-*" "max1617-*" "max1617a-*" "thmc10-*" "lm84-*" "gl523 # set remote_temp_low 40 # set remote_temp_over 70 -chip "vt1211-*" +chip "vt1211-*" "vt8231-*" # -# temp1 and in6 are not implemented in vt1211 +# temp1 and in6 are not implemented in vt1211 / vt8231 # temp4-7 (thermistor) cacluations unimplemented here - requires logarithms :( # # 1 for temp, 0 for volt. diff --git a/lib/chips.c b/lib/chips.c index 43f2495e..ac2a3a06 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -2829,6 +2829,149 @@ static sensors_chip_feature lm92_features[] = LM92_ALARM (SENSORS_LM92_ALARMS,"alarms",SENSORS_NO_MAPPING,1), }; +static sensors_chip_feature vt8231_features[] = + { + { SENSORS_VT8231_IN0, "in0", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN0, VALUE(3), 2 }, + { SENSORS_VT8231_IN1, "in1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN1, VALUE(3), 2 }, + { SENSORS_VT8231_IN2, "in2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN2, VALUE(3), 2 }, + { SENSORS_VT8231_IN3, "in3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN3, VALUE(3), 2 }, + { SENSORS_VT8231_IN4, "in4", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN4, VALUE(3), 2 }, + { SENSORS_VT8231_IN5, "in5", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN5, VALUE(3), 2 }, + { SENSORS_VT8231_IN6, "in6", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_IN6, VALUE(3), 2 }, + { SENSORS_VT8231_IN0_MIN, "in0_min", SENSORS_VT8231_IN0, + SENSORS_VT8231_IN0, + SENSORS_MODE_RW, VT8231_SYSCTL_IN0, VALUE(1), 2 }, + { SENSORS_VT8231_IN1_MIN, "in1_min", SENSORS_VT8231_IN1, + SENSORS_VT8231_IN1, + SENSORS_MODE_RW, VT8231_SYSCTL_IN1, VALUE(1), 2 }, + { SENSORS_VT8231_IN2_MIN, "in2_min", SENSORS_VT8231_IN2, + SENSORS_VT8231_IN2, + SENSORS_MODE_RW, VT8231_SYSCTL_IN2, VALUE(1), 2 }, + { SENSORS_VT8231_IN3_MIN, "in3_min", SENSORS_VT8231_IN3, + SENSORS_VT8231_IN3, + SENSORS_MODE_RW, VT8231_SYSCTL_IN3, VALUE(1), 2 }, + { SENSORS_VT8231_IN4_MIN, "in4_min", SENSORS_VT8231_IN4, + SENSORS_VT8231_IN4, + SENSORS_MODE_RW, VT8231_SYSCTL_IN4, VALUE(1), 2 }, + { SENSORS_VT8231_IN5_MIN, "in5_min", SENSORS_VT8231_IN5, + SENSORS_VT8231_IN5, + SENSORS_MODE_RW, VT8231_SYSCTL_IN5, VALUE(1), 2 }, + { SENSORS_VT8231_IN6_MIN, "in6_min", SENSORS_VT8231_IN6, + SENSORS_VT8231_IN6, + SENSORS_MODE_RW, VT8231_SYSCTL_IN6, VALUE(1), 2 }, + { SENSORS_VT8231_IN0_MAX, "in0_max", SENSORS_VT8231_IN0, + SENSORS_VT8231_IN0, + SENSORS_MODE_RW, VT8231_SYSCTL_IN0, VALUE(2), 2 }, + { SENSORS_VT8231_IN1_MAX, "in1_max", SENSORS_VT8231_IN1, + SENSORS_VT8231_IN1, + SENSORS_MODE_RW, VT8231_SYSCTL_IN1, VALUE(2), 2 }, + { SENSORS_VT8231_IN2_MAX, "in2_max", SENSORS_VT8231_IN2, + SENSORS_VT8231_IN2, + SENSORS_MODE_RW, VT8231_SYSCTL_IN2, VALUE(2), 2 }, + { SENSORS_VT8231_IN3_MAX, "in3_max", SENSORS_VT8231_IN3, + SENSORS_VT8231_IN3, + SENSORS_MODE_RW, VT8231_SYSCTL_IN3, VALUE(2), 2 }, + { SENSORS_VT8231_IN4_MAX, "in4_max", SENSORS_VT8231_IN4, + SENSORS_VT8231_IN4, + SENSORS_MODE_RW, VT8231_SYSCTL_IN4, VALUE(2), 2 }, + { SENSORS_VT8231_IN5_MAX, "in5_max", SENSORS_VT8231_IN5, + SENSORS_VT8231_IN5, + SENSORS_MODE_RW, VT8231_SYSCTL_IN5, VALUE(2), 2 }, + { SENSORS_VT8231_IN6_MAX, "in6_max", SENSORS_VT8231_IN6, + SENSORS_VT8231_IN6, + SENSORS_MODE_RW, VT8231_SYSCTL_IN6, VALUE(2), 2 }, + { SENSORS_VT8231_FAN1, "fan1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_FAN1, VALUE(2), 0 }, + { SENSORS_VT8231_FAN2, "fan2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_FAN2, VALUE(2), 0 }, + { SENSORS_VT8231_FAN1_MIN, "fan1_min", SENSORS_VT8231_FAN1, + SENSORS_VT8231_FAN1, + SENSORS_MODE_RW, VT8231_SYSCTL_FAN1, VALUE(1), 0 }, + { SENSORS_VT8231_FAN2_MIN, "fan2_min", SENSORS_VT8231_FAN2, + SENSORS_VT8231_FAN2, + SENSORS_MODE_RW, VT8231_SYSCTL_FAN2, VALUE(1), 0 }, + { SENSORS_VT8231_TEMP, "temp1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP_HYST, "temp1_hyst", SENSORS_VT8231_TEMP, + SENSORS_VT8231_TEMP, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP_OVER, "temp1_over", SENSORS_VT8231_TEMP, + SENSORS_VT8231_TEMP, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP2, "temp2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP2, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP2_HYST, "temp2_hyst", SENSORS_VT8231_TEMP2, + SENSORS_VT8231_TEMP2, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP2, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP2_OVER, "temp2_over", SENSORS_VT8231_TEMP2, + SENSORS_VT8231_TEMP2, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP2, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP3, "temp3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP3, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP3_HYST, "temp3_hyst", SENSORS_VT8231_TEMP3, + SENSORS_VT8231_TEMP3, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP3, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP3_OVER, "temp3_over", SENSORS_VT8231_TEMP3, + SENSORS_VT8231_TEMP3, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP3, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP4, "temp4", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP4, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP4_HYST, "temp4_hyst", SENSORS_VT8231_TEMP4, + SENSORS_VT8231_TEMP4, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP4, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP4_OVER, "temp4_over", SENSORS_VT8231_TEMP4, + SENSORS_VT8231_TEMP4, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP4, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP5, "temp5", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP5, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP5_HYST, "temp5_hyst", SENSORS_VT8231_TEMP5, + SENSORS_VT8231_TEMP5, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP5, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP5_OVER, "temp5_over", SENSORS_VT8231_TEMP5, + SENSORS_VT8231_TEMP5, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP5, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP6, "temp6", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP6, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP6_HYST, "temp6_hyst", SENSORS_VT8231_TEMP6, + SENSORS_VT8231_TEMP6, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP6, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP6_OVER, "temp6_over", SENSORS_VT8231_TEMP6, + SENSORS_VT8231_TEMP6, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP6, VALUE(1), 1 }, + { SENSORS_VT8231_TEMP7, "temp7", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_TEMP7, VALUE(3), 1 }, + { SENSORS_VT8231_TEMP7_HYST, "temp7_hyst", SENSORS_VT8231_TEMP7, + SENSORS_VT8231_TEMP7, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP7, VALUE(2), 1 }, + { SENSORS_VT8231_TEMP7_OVER, "temp7_over", SENSORS_VT8231_TEMP7, + SENSORS_VT8231_TEMP7, SENSORS_MODE_RW, + VT8231_SYSCTL_TEMP7, VALUE(1), 1 }, + { SENSORS_VT8231_FAN1_DIV, "fan1_div", SENSORS_VT8231_FAN1, + SENSORS_NO_MAPPING, + SENSORS_MODE_RW, VT8231_SYSCTL_FAN_DIV, VALUE(1), + 0 }, + { SENSORS_VT8231_FAN2_DIV, "fan2_div", SENSORS_VT8231_FAN2, + SENSORS_NO_MAPPING, + SENSORS_MODE_RW, VT8231_SYSCTL_FAN_DIV, VALUE(2), + 0 }, + { SENSORS_VT8231_ALARMS, "alarms", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_ALARMS, VALUE(1), 0 }, + { SENSORS_VT8231_VID, "vid", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_VID, VALUE(1), 3 }, + { SENSORS_VT8231_VRM, "vrm", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_RW, VT8231_SYSCTL_VRM, VALUE(1), 1 }, + { SENSORS_VT8231_UCH, "config", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, VT8231_SYSCTL_UCH, VALUE(1), 0 }, + { 0 } + }; + sensors_chip_features sensors_chip_features_list[] = { { SENSORS_LM78_PREFIX, lm78_features }, @@ -2883,5 +3026,6 @@ sensors_chip_features sensors_chip_features_list[] = { SENSORS_VT1211_PREFIX, vt1211_features }, { SENSORS_SMSC47M1_PREFIX, smsc47m1_features }, { SENSORS_LM92_PREFIX, lm92_features }, + { SENSORS_VT8231_PREFIX, vt8231_features }, { 0 } }; diff --git a/lib/chips.h b/lib/chips.h index 1977556b..390c3b82 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1206,4 +1206,59 @@ #define SENSORS_LM92_TEMP 5 /* R */ #define SENSORS_LM92_ALARMS 6 /* R */ +#define SENSORS_VT8231_PREFIX "vt8231" + +#define SENSORS_VT8231_IN0 1 /* R */ +#define SENSORS_VT8231_IN1 2 /* R */ +#define SENSORS_VT8231_IN2 3 /* R */ +#define SENSORS_VT8231_IN3 4 /* R */ +#define SENSORS_VT8231_IN4 5 /* R */ +#define SENSORS_VT8231_IN5 6 /* R */ +#define SENSORS_VT8231_IN6 7 /* R */ +#define SENSORS_VT8231_IN0_MIN 11 /* RW */ +#define SENSORS_VT8231_IN1_MIN 12 /* RW */ +#define SENSORS_VT8231_IN2_MIN 13 /* RW */ +#define SENSORS_VT8231_IN3_MIN 14 /* RW */ +#define SENSORS_VT8231_IN4_MIN 15 /* RW */ +#define SENSORS_VT8231_IN5_MIN 16 /* RW */ +#define SENSORS_VT8231_IN6_MIN 17 /* RW */ +#define SENSORS_VT8231_IN0_MAX 21 /* RW */ +#define SENSORS_VT8231_IN1_MAX 22 /* RW */ +#define SENSORS_VT8231_IN2_MAX 23 /* RW */ +#define SENSORS_VT8231_IN3_MAX 24 /* RW */ +#define SENSORS_VT8231_IN4_MAX 25 /* RW */ +#define SENSORS_VT8231_IN5_MAX 26 /* RW */ +#define SENSORS_VT8231_IN6_MAX 27 /* RW */ +#define SENSORS_VT8231_FAN1 31 /* R */ +#define SENSORS_VT8231_FAN2 32 /* R */ +#define SENSORS_VT8231_FAN1_MIN 41 /* RW */ +#define SENSORS_VT8231_FAN2_MIN 42 /* RW */ +#define SENSORS_VT8231_TEMP 51 /* R */ +#define SENSORS_VT8231_TEMP_HYST 52 /* RW */ +#define SENSORS_VT8231_TEMP_OVER 53 /* RW */ +#define SENSORS_VT8231_TEMP2 54 /* R */ +#define SENSORS_VT8231_TEMP2_HYST 55 /* RW */ +#define SENSORS_VT8231_TEMP2_OVER 56 /* RW */ +#define SENSORS_VT8231_TEMP3 57 /* R */ +#define SENSORS_VT8231_TEMP3_HYST 58 /* RW */ +#define SENSORS_VT8231_TEMP3_OVER 59 /* RW */ +#define SENSORS_VT8231_TEMP4 60 /* R */ +#define SENSORS_VT8231_TEMP4_HYST 61 /* RW */ +#define SENSORS_VT8231_TEMP4_OVER 62 /* RW */ +#define SENSORS_VT8231_TEMP5 63 /* R */ +#define SENSORS_VT8231_TEMP5_HYST 64 /* RW */ +#define SENSORS_VT8231_TEMP5_OVER 65 /* RW */ +#define SENSORS_VT8231_TEMP6 66 /* R */ +#define SENSORS_VT8231_TEMP6_HYST 67 /* RW */ +#define SENSORS_VT8231_TEMP6_OVER 68 /* RW */ +#define SENSORS_VT8231_TEMP7 69 /* R */ +#define SENSORS_VT8231_TEMP7_HYST 70 /* RW */ +#define SENSORS_VT8231_TEMP7_OVER 71 /* RW */ +#define SENSORS_VT8231_FAN1_DIV 75 /* RW */ +#define SENSORS_VT8231_FAN2_DIV 76 /* RW */ +#define SENSORS_VT8231_ALARMS 81 /* R */ +#define SENSORS_VT8231_VID 82 /* R */ +#define SENSORS_VT8231_VRM 83 /* RW */ +#define SENSORS_VT8231_UCH 84 /* RW */ + #endif /* def LIB_SENSORS_CHIPS_H */ diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index c7d02ebe..df459107 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -915,7 +915,7 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect }, { name => "VIA Technologies VT8231 Integrated Sensors", - driver => "via686a", + driver => "vt8231", isa_addrs => [ 0 ], isa_detect => sub { via8231_isa_detect @_ }, }, diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index c82494a5..67841629 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -3374,6 +3374,225 @@ void print_lm92 (const sensors_chip_name *name) free_the_label (&label); } +void print_vt8231(const sensors_chip_name *name) +{ + char *label = NULL; + double cur,min,max,fdiv; + int alarms,valid; + + if (!sensors_get_feature(*name,SENSORS_VT8231_ALARMS,&cur)) + alarms = cur + 0.5; + else { + printf("ERROR: Can't get alarm data!\n"); + alarms = 0; + } + + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN0,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN0,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN0_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN0_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN0?"ALARM":""); + } + } else + printf("ERROR: Can't get IN0 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN1,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN1,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN1_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN1_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN1?"ALARM":""); + } + } else + printf("ERROR: Can't get IN1 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN2,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN2,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN2_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN2_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN2?"ALARM":""); + } + } else + printf("ERROR: Can't get IN2 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN3,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN3,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN3_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN3_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN3?"ALARM":""); + } + } else + printf("ERROR: Can't get IN3 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN4,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN4,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN4_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN4_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN4?"ALARM":""); + } + } else + printf("ERROR: Can't get IN4 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN5,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN5,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN5_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN5_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN5?"ALARM":""); + } + } else + printf("ERROR: Can't get IN5 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_IN6,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_IN6,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_IN6_MIN,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_IN6_MAX,&max)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", + cur,min,max,alarms&VT8231_ALARM_IN6?"ALARM":""); + } + } else + printf("ERROR: Can't get IN6 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_FAN1,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN1,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN1_DIV,&fdiv) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN1_MIN,&min)) { + if (valid) { + print_label(label,10); + printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", + cur,min,fdiv, alarms&VT8231_ALARM_FAN1?"ALARM":""); + } + } else + printf("ERROR: Can't get FAN1 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_FAN2,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN2,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN2_DIV,&fdiv) && + !sensors_get_feature(*name,SENSORS_VT8231_FAN2_MIN,&min)) { + if (valid) { + print_label(label,10); + printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", + cur,min,fdiv, alarms&VT8231_ALARM_FAN2?"ALARM":""); + } + } else + printf("ERROR: Can't get FAN2 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP2,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP2,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP2_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP2_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP2 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP2 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP3,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP3,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP3_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP3_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP3 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP3 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP4,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP4,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP4_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP4_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP4 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP4 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP5,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP5,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP5_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP5_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP5 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP5 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP6,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP6,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP6_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP6_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP6 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP6 data!\n"); + free_the_label(&label); + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_TEMP7,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP7,&cur) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP7_HYST,&min) && + !sensors_get_feature(*name,SENSORS_VT8231_TEMP7_OVER,&max)) { + if (valid) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT8231_ALARM_TEMP7 ? "ALARM" : "" ); + } + } else + printf("ERROR: Can't get TEMP7 data!\n"); + free_the_label(&label); + + if (!sensors_get_label_and_valid(*name,SENSORS_VT8231_VID,&label,&valid) && + !sensors_get_feature(*name,SENSORS_VT8231_VID,&cur)) { + if (valid) { + print_label(label,10); + printf("%+6.2f V\n",cur); + } + } + free_the_label(&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 24e3ec84..ac960ba1 100644 --- a/prog/sensors/chips.h +++ b/prog/sensors/chips.h @@ -48,5 +48,6 @@ extern void print_pcf8591(const sensors_chip_name *name); extern void print_vt1211(const sensors_chip_name *name); extern void print_smsc47m1(const sensors_chip_name *name); extern void print_lm92(const sensors_chip_name *name); +extern void print_vt8231(const sensors_chip_name *name); #endif /* def PROG_SENSORS_CHIPS_H */ diff --git a/prog/sensors/main.c b/prog/sensors/main.c index 37a82641..e31a2283 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -353,6 +353,8 @@ void do_a_print(sensors_chip_name name) print_smsc47m1(&name); else if (!strcmp(name.prefix,"lm92")) print_lm92(&name); + else if (!strcmp(name.prefix,"vt8231")) + print_vt8231(&name); else print_unknown_chip(&name); printf("\n");