From 09bd83fa7d60feefe89609b0c4f808bce0cb9f4c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 7 Sep 2006 19:51:25 +0000 Subject: [PATCH] vt1211 fixes: * No in6 * More inputs can be missing (depends on UCH config) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4154 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 ++ doc/chips/SUMMARY | 2 +- doc/chips/vt1211 | 4 +--- etc/sensors.conf.eg | 2 -- kernel/chips/vt1211.c | 18 +++++------------- prog/sensors/chips.c | 15 ++++++++------- 6 files changed, 17 insertions(+), 26 deletions(-) diff --git a/CHANGES b/CHANGES index f2a80ef0..391a6dc3 100644 --- a/CHANGES +++ b/CHANGES @@ -33,6 +33,7 @@ lm_sensors CHANGES file Module i2c-viapro: Fix compilation with kernels < 2.4.21 Add VT8237A and VT8251 Module lm83: Add LM82 support (2.6 backport) + Module vt1211: The VT1211 has no in6 Module w83781d: Use real-time alarm registers when possible (2.6 backport) Add specific alarm and beep defines for the W83791D Module w83792d: Fix PWM range (2.6 backport) @@ -57,6 +58,7 @@ lm_sensors CHANGES file Print missing w83791d values Add w83793 support (Yuan Mu) The adt7463 may not have in4 (#2119) + Hide more vt1211 missing input errors Program sensors-detect: Add ServerWorks HT-1000 SMBus detection Add ATI IXP200/300/400 SMBus detection Prevent warning on 64-bit PCI addresses diff --git a/doc/chips/SUMMARY b/doc/chips/SUMMARY index 654a5fca..f54a0f85 100644 --- a/doc/chips/SUMMARY +++ b/doc/chips/SUMMARY @@ -229,7 +229,7 @@ via686a vt8231 3 5 2 - no yes vt1211 - vt1211 2-7 2-7 2 2 no yes (LPC) + vt1211 2-7 1-6 2 2 no yes (LPC) vt8231 vt8231 2-7 2-7 2 2 no yes diff --git a/doc/chips/vt1211 b/doc/chips/vt1211 index 14980fd5..a6156687 100644 --- a/doc/chips/vt1211 +++ b/doc/chips/vt1211 @@ -28,8 +28,7 @@ contains voltage/temperature monitoring and PWM control circuitry for two fans. We define the sensors as follows. Somewhat convoluted to minimize -changes from via686a. Temp1 and in6 are unimplemented in the vt1211 -chip but are included in the driver. +changes from via686a. Sensor Voltage Mode Temp Mode uch_config bit -------- ------------ --------- -------------- @@ -41,7 +40,6 @@ chip but are included in the driver. UCH4 in3 temp6 0x20 (32) UCH5 in4 temp7 0x40 (64) 3.3V in5 - -12V in6 As noted above, 5 of the sensors are "universal channels" and can be set for either voltage or temperature. diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index e9239af1..20a4fb0c 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -2038,8 +2038,6 @@ chip "lm63-*" chip "vt1211-*" # -# in6 is not implemented in vt1211 -# # 1 for temp, 0 for volt. # Sensor Voltage Mode Temp Mode config bit # -------- ------------ --------- -------------- diff --git a/kernel/chips/vt1211.c b/kernel/chips/vt1211.c index e8b1ad5b..725d6fea 100644 --- a/kernel/chips/vt1211.c +++ b/kernel/chips/vt1211.c @@ -107,10 +107,9 @@ superio_exit(void) UCH4 in3 temp6 UCH5 in4 temp7 3.3V in5 - -12V in6 not in vt1211 */ -/* ins numbered 0-6 */ +/* ins numbered 0-5 */ #define VT1211_REG_IN_MAX(nr) ((nr)==0 ? 0x3d : 0x29 + ((nr) * 2)) #define VT1211_REG_IN_MIN(nr) ((nr)==0 ? 0x3e : 0x2a + ((nr) * 2)) #define VT1211_REG_IN(nr) (0x21 + (nr)) @@ -140,7 +139,7 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e, 0x2c, 0x2e, 0x30, 0x32 }; #define VT1211_REG_TEMP1_CONFIG 0x4b #define VT1211_REG_TEMP2_CONFIG 0x4c -/* temps 1-7; voltages 0-6 */ +/* temps 1-7; voltages 0-5 */ #define ISTEMP(i, ch_config) ((i) == 1 ? 1 : \ (i) == 3 ? 1 : \ (i) == 2 ? ((ch_config) >> 1) & 0x01 : \ @@ -183,9 +182,9 @@ struct vt1211_data { char valid; /* !=0 if following fields are valid */ unsigned long last_updated; /* In jiffies */ - u8 in[7]; /* Register value */ - u8 in_max[7]; /* Register value */ - u8 in_min[7]; /* Register value */ + u8 in[6]; /* Register value */ + u8 in_max[6]; /* Register value */ + u8 in_min[6]; /* Register value */ u16 temp[7]; /* Register value 10 bit */ u8 temp_over[7]; /* Register value */ u8 temp_hyst[7]; /* Register value */ @@ -246,7 +245,6 @@ static struct i2c_driver vt1211_driver = { #define VT1211_SYSCTL_IN3 1003 #define VT1211_SYSCTL_IN4 1004 #define VT1211_SYSCTL_IN5 1005 -#define VT1211_SYSCTL_IN6 1006 #define VT1211_SYSCTL_FAN1 1101 #define VT1211_SYSCTL_FAN2 1102 #define VT1211_SYSCTL_TEMP1 1200 @@ -272,7 +270,6 @@ static struct i2c_driver vt1211_driver = { #define VT1211_ALARM_FAN1 0x40 #define VT1211_ALARM_FAN2 0x80 #define VT1211_ALARM_IN4 0x100 -#define VT1211_ALARM_IN6 0x200 #define VT1211_ALARM_TEMP2 0x800 #define VT1211_ALARM_CHAS 0x1000 #define VT1211_ALARM_TEMP3 0x8000 @@ -298,11 +295,6 @@ static ctl_table vt1211_dir_table_template[] = { &i2c_sysctl_real, NULL, &vt1211_in}, {VT1211_SYSCTL_IN5, "in5", NULL, 0, 0644, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &vt1211_in}, -/* - datasheet says these are reserved - {VT1211_SYSCTL_IN6, "in6", NULL, 0, 0644, NULL, &i2c_proc_real, - &i2c_sysctl_real, NULL, &vt1211_in}, -*/ {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, diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index eeeaa31d..85574ce0 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -4423,7 +4423,7 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", cur,min,max,alarms&VT1211_ALARM_IN2?"ALARM":""); - } else + } else if (err != -SENSORS_ERR_PROC) printf("ERROR: Can't get IN2 data!\n"); } free(label); @@ -4436,7 +4436,7 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", cur,min,max,alarms&VT1211_ALARM_IN3?"ALARM":""); - } else + } else if (err != -SENSORS_ERR_PROC) printf("ERROR: Can't get IN3 data!\n"); } free(label); @@ -4449,7 +4449,7 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", cur,min,max,alarms&VT1211_ALARM_IN4?"ALARM":""); - } else + } else if (err != -SENSORS_ERR_PROC) printf("ERROR: Can't get IN4 data!\n"); } free(label); @@ -4462,10 +4462,10 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", cur,min,max,alarms&VT1211_ALARM_IN5?"ALARM":""); - } else - printf("ERROR: Can't get IN5 data!\n"); + } } free(label); + if (sensors_get_label_and_valid(*name,SENSORS_VT1211_FAN1,&label,&valid)) { printf("ERROR: Can't get FAN1 config!\n"); } else if (valid) { @@ -4492,6 +4492,7 @@ void print_vt1211(const sensors_chip_name *name) printf("ERROR: Can't get FAN2 data!\n"); } free(label); + if (sensors_get_label_and_valid(*name,SENSORS_VT1211_TEMP1,&label,&valid)) { printf("ERROR: Can't get TEMP1 config!\n"); } else if (valid) { @@ -4527,7 +4528,7 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); print_temp_info( cur, max, min, HYST, 1, 0); printf(" %s\n", alarms & VT1211_ALARM_TEMP3 ? "ALARM" : "" ); - } else + } else if (err != -SENSORS_ERR_PROC) printf("ERROR: Can't get TEMP3 data!\n"); } free(label); @@ -4540,7 +4541,7 @@ void print_vt1211(const sensors_chip_name *name) print_label(label,10); print_temp_info( cur, max, min, HYST, 1, 0); printf(" %s\n", alarms & VT1211_ALARM_TEMP4 ? "ALARM" : "" ); - } else + } else if (err != -SENSORS_ERR_PROC) printf("ERROR: Can't get TEMP4 data!\n"); } free(label);