diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index cd41302a..73ec21ff 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -1923,12 +1923,13 @@ chip "lm63-*" chip "vt1211-*" # -# temp1 and in6 are not implemented in vt1211 +# in6 is not implemented in vt1211 # # 1 for temp, 0 for volt. # Sensor Voltage Mode Temp Mode config bit # -------- ------------ --------- -------------- # Reading 1 temp3 +# Reading 3 temp1 # UCH1/Reading2 in0 temp2 0x04 (4) # UCH2 in1 temp4 0x08 (8) # UCH3 in2 temp5 0x10 (16) @@ -1959,6 +1960,7 @@ chip "vt1211-*" label in4 "+12V" label in5 "+3.3V" + label temp1 "Int Temp" label temp2 "MB1 Temp" label temp3 "Proc Temp" label temp4 "MB2 Temp" diff --git a/kernel/chips/vt1211.c b/kernel/chips/vt1211.c index 35a51386..e8b1ad5b 100644 --- a/kernel/chips/vt1211.c +++ b/kernel/chips/vt1211.c @@ -99,8 +99,8 @@ superio_exit(void) changes from via686a. Sensor Voltage Mode Temp Mode -------- ------------ --------- - Reading 1 temp3 - Reading 3 temp1 not in vt1211 + Reading 1 temp3 Intel thermal diode + Reading 3 temp1 VT1211 internal thermal diode UCH1/Reading2 in0 temp2 UCH2 in1 temp4 UCH3 in2 temp5 @@ -249,7 +249,7 @@ static struct i2c_driver vt1211_driver = { #define VT1211_SYSCTL_IN6 1006 #define VT1211_SYSCTL_FAN1 1101 #define VT1211_SYSCTL_FAN2 1102 -#define VT1211_SYSCTL_TEMP 1200 +#define VT1211_SYSCTL_TEMP1 1200 #define VT1211_SYSCTL_TEMP2 1201 #define VT1211_SYSCTL_TEMP3 1202 #define VT1211_SYSCTL_TEMP4 1203 @@ -268,7 +268,7 @@ static struct i2c_driver vt1211_driver = { #define VT1211_ALARM_IN2 0x02 #define VT1211_ALARM_IN5 0x04 #define VT1211_ALARM_IN3 0x08 -#define VT1211_ALARM_TEMP 0x10 +#define VT1211_ALARM_TEMP1 0x10 #define VT1211_ALARM_FAN1 0x40 #define VT1211_ALARM_FAN2 0x80 #define VT1211_ALARM_IN4 0x100 @@ -277,7 +277,7 @@ static struct i2c_driver vt1211_driver = { #define VT1211_ALARM_CHAS 0x1000 #define VT1211_ALARM_TEMP3 0x8000 /* duplicates */ -#define VT1211_ALARM_IN0 VT1211_ALARM_TEMP +#define VT1211_ALARM_IN0 VT1211_ALARM_TEMP2 #define VT1211_ALARM_TEMP4 VT1211_ALARM_IN1 #define VT1211_ALARM_TEMP5 VT1211_ALARM_IN2 #define VT1211_ALARM_TEMP6 VT1211_ALARM_IN3 @@ -302,9 +302,9 @@ static ctl_table vt1211_dir_table_template[] = { datasheet says these are reserved {VT1211_SYSCTL_IN6, "in6", NULL, 0, 0644, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &vt1211_in}, - {VT1211_SYSCTL_TEMP, "temp1", NULL, 0, 0644, NULL, &i2c_proc_real, - &i2c_sysctl_real, NULL, &vt1211_temp}, */ + {VT1211_SYSCTL_TEMP1, "temp1", NULL, 0, 0644, NULL, + &i2c_proc_real, &i2c_sysctl_real, NULL, &vt1211_temp}, {VT1211_SYSCTL_TEMP2, "temp2", NULL, 0, 0644, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &vt1211_temp}, {VT1211_SYSCTL_TEMP3, "temp3", NULL, 0, 0644, NULL, @@ -513,7 +513,7 @@ static void vt1211_update_client(struct i2c_client *client) data->fan_min[i - 1] = vt_rdval(client, VT1211_REG_FAN_MIN(i)); } - for (i = 2; i <= 7; i++) { + for (i = 1; i <= 7; i++) { if(ISTEMP(i, data->uch_config)) { data->temp[i - 1] = vt_rdval(client, VT1211_REG_TEMP(i)) << 2; @@ -638,7 +638,7 @@ void vt1211_temp(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results) { struct vt1211_data *data = client->data; - int nr = ctl_name - VT1211_SYSCTL_TEMP; + int nr = ctl_name - VT1211_SYSCTL_TEMP1; if (operation == SENSORS_PROC_REAL_INFO) *nrels_mag = 1; diff --git a/lib/chips.c b/lib/chips.c index 1b7adc9f..135f0de2 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -4536,7 +4536,14 @@ static sensors_chip_feature vt1211_features[] = { SENSORS_VT1211_FAN2_MIN, "fan2_min", SENSORS_VT1211_FAN2, SENSORS_VT1211_FAN2, RW, VT1211_SYSCTL_FAN2, VALUE(1), 0 }, - /* no temp1 */ + { SENSORS_VT1211_TEMP1, "temp1", NOMAP, NOMAP, + R, VT1211_SYSCTL_TEMP1, VALUE(3), 1 }, + { SENSORS_VT1211_TEMP1_HYST, "temp1_hyst", SENSORS_VT1211_TEMP1, + SENSORS_VT1211_TEMP1, RW, + VT1211_SYSCTL_TEMP1, VALUE(2), 1 }, + { SENSORS_VT1211_TEMP1_OVER, "temp1_over", SENSORS_VT1211_TEMP1, + SENSORS_VT1211_TEMP1, RW, + VT1211_SYSCTL_TEMP1, VALUE(1), 1 }, { SENSORS_VT1211_TEMP2, "temp2", NOMAP, NOMAP, R, VT1211_SYSCTL_TEMP2, VALUE(3), 1 }, { SENSORS_VT1211_TEMP2_HYST, "temp2_hyst", SENSORS_VT1211_TEMP2, diff --git a/lib/chips.h b/lib/chips.h index d0e46955..9779eff9 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1709,9 +1709,9 @@ #define SENSORS_VT1211_FAN2 32 /* R */ #define SENSORS_VT1211_FAN1_MIN 41 /* RW */ #define SENSORS_VT1211_FAN2_MIN 42 /* RW */ -#define SENSORS_VT1211_TEMP 51 /* R */ -#define SENSORS_VT1211_TEMP_HYST 52 /* RW */ -#define SENSORS_VT1211_TEMP_OVER 53 /* RW */ +#define SENSORS_VT1211_TEMP1 51 /* R */ +#define SENSORS_VT1211_TEMP1_HYST 52 /* RW */ +#define SENSORS_VT1211_TEMP1_OVER 53 /* RW */ #define SENSORS_VT1211_TEMP2 54 /* R */ #define SENSORS_VT1211_TEMP2_HYST 55 /* RW */ #define SENSORS_VT1211_TEMP2_OVER 56 /* RW */ diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 6010ba0d..d985404f 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -4311,8 +4311,19 @@ void print_vt1211(const sensors_chip_name *name) printf("ERROR: Can't get FAN2 data!\n"); } free(label); - - /* no temp 1 */ + if (sensors_get_label_and_valid(*name,SENSORS_VT1211_TEMP1,&label,&valid)) { + printf("ERROR: Can't get TEMP1 config!\n"); + } else if (valid) { + if(!(err = sensors_get_feature(*name,SENSORS_VT1211_TEMP1,&cur)) && + !(err = sensors_get_feature(*name,SENSORS_VT1211_TEMP1_HYST,&min)) && + !(err = sensors_get_feature(*name,SENSORS_VT1211_TEMP1_OVER,&max))) { + print_label(label,10); + print_temp_info( cur, max, min, HYST, 1, 0); + printf(" %s\n", alarms & VT1211_ALARM_TEMP1 ? "ALARM" : "" ); + } else + printf("ERROR: Can't get TEMP1 data!\n"); + } + free(label); if (sensors_get_label_and_valid(*name,SENSORS_VT1211_TEMP2,&label,&valid)) { printf("ERROR: Can't get TEMP2 config!\n"); } else if (valid) {