diff --git a/CHANGES b/CHANGES index ad4e7197..89e6c18a 100644 --- a/CHANGES +++ b/CHANGES @@ -21,13 +21,15 @@ ask CVS about it: NOTE: Requires i2c-2.6.1 or newer, or kernel 2.4.13 or newer. File doc/vid: New File include/sensors_vid.h: New - Library: Add multiple VRM version support for w83781d + Library: Add multiple VRM version support for adm1025, w83781d Makefiles: For 2.4+ kernels, modules now install in kernel/drivers/[i2c,sensors] , not misc/ , and removes old versions in misc/ . Use $CFLAGS and $CPPFLAGS if defined. + Module adm1025: Add multiple VID version support Module i2c-amd756: Add nVidia nForce support; fix block read length; reliability improvements + Module i2c-i801: Add support for 82801DB (ICH4) Module i2c-savage4: new Module i2c-viapro: Add support for VT8231 (0x8235), VT8233A (0x3147) Module via686a: Add support for VT8231 sensors @@ -37,9 +39,9 @@ ask CVS about it: Program rrd: Fix swapped CPU and MB temps in summ_week.cgi Program sensord: Major update, now requires rrd source; not compiled by default - Program sensors: Recognize DDR SDRAM + Program sensors: Recognize DDR SDRAM; add adm1025 VID Program sensors-detect: Add VT8231, VT8233A, several S3 devices; - fix perl warnings + add 82801DB; fix perl warnings 2.6.3 (20020322) NOTE: Requires i2c-2.6.1 or newer, or kernel 2.4.13 or newer. diff --git a/etc/sensors.conf.eg b/etc/sensors.conf.eg index 1a22bb8f..24b77673 100644 --- a/etc/sensors.conf.eg +++ b/etc/sensors.conf.eg @@ -378,6 +378,9 @@ chip "w83782d-*" "w83783s-*" "w83627hf-*" compute in6 (3.14 * @) - 7.71 , (@ + 7.71) / 3.14 compute in7 ((6.8/10)+1)*@ , @/((6.8/10)+1) +# adjust this if your vid is wrong; see doc/vid +# set vrm 9.0 + # set limits to 5% for the critical voltages # set limits to 10% for the non-critical voltages # set limits to 20% for the battery voltage @@ -504,6 +507,9 @@ chip "as99127f-*" compute temp2 (@*30/43)+25, (@-25)*43/30 +# adjust this if your vid is wrong; see doc/vid +# set vrm 9.0 + # set limits to 5% for the critical voltages # set limits to 10% for the non-critical voltages # set limits to 20% for the battery voltage @@ -921,11 +927,18 @@ chip "mtp008-*" # ignore temp3 chip "adm1025-*" - -# These are as advised in the data sheet - +# +# The ADM1025 has integrated scaling resistors, rather +# than external resistors common to most sensor devices. +# These apply to the first 6 voltage inputs in0-in5 +# (+2.5, VCore, +3.3, +5, 12, VCC). As the scaling is fixed inside +# the chip for these inputs, it is fairly certain that the +# motherboard connections match these labels, and that the +# driver computations are correct. Therefore they do not need to +# be overridden here. +# label in0 "+2.5V" - label in1 "VCCP" + label in1 "VCore" label in2 "+3.3V" label in3 "+5V" label in4 "+12V" @@ -934,9 +947,14 @@ chip "adm1025-*" label temp1 "SYS Temp" label temp2 "CPU Temp" +# adjust this if your vid is wrong; see doc/vid + set vrm 9.0 + set in1_min vid * 0.95 + set in1_max vid * 1.05 + chip "lm87-*" # -# The LM87 is unique in having integrated scaling resistors, rather +# The LM87 has integrated scaling resistors, rather # than external resistors common to most sensor devices. # These apply to the first 6 voltage inputs in0-in5 # (+2.5, Vccp1, +3.3, +5, 12, +Vccp2). As the scaling is fixed inside diff --git a/kernel/chips/adm1025.c b/kernel/chips/adm1025.c index b52bcfe7..83477add 100644 --- a/kernel/chips/adm1025.c +++ b/kernel/chips/adm1025.c @@ -34,6 +34,7 @@ #include #include "version.h" #include "sensors.h" +#include "sensors_vid.h" #include #ifdef MODULE_LICENSE @@ -116,9 +117,6 @@ SENSORS_INSMOD_1(adm1025); #define ALARMS_FROM_REG(val) (val) -#define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\ - 205-(val)*5) - /* Initial limits */ #define ADM1025_INIT_IN_0 190 #define ADM1025_INIT_IN_1 190 @@ -188,6 +186,7 @@ struct adm1025_data { u16 alarms; /* Register encoding, combined */ u8 analog_out; /* Register value */ u8 vid; /* Register value combined */ + u8 vrm; }; @@ -228,6 +227,8 @@ static void adm1025_alarms(struct i2c_client *client, int operation, long *results);*/ static void adm1025_vid(struct i2c_client *client, int operation, int ctl_name, int *nrels_mag, long *results); +static void adm1025_vrm(struct i2c_client *client, int operation, + int ctl_name, int *nrels_mag, long *results); /* I choose here for semi-static ADM1025 allocation. Complete dynamic allocation could also be used; the code needed for this would probably @@ -277,6 +278,8 @@ static ctl_table adm1025_dir_table_template[] = { &i2c_sysctl_real, NULL, &adm1025_analog_out},*/ {ADM1025_SYSCTL_VID, "vid", NULL, 0, 0444, NULL, &i2c_proc_real, &i2c_sysctl_real, NULL, &adm1025_vid}, + {ADM1025_SYSCTL_VRM, "vrm", NULL, 0, 0644, NULL, &i2c_proc_real, + &i2c_sysctl_real, NULL, &adm1025_vrm}, {0} }; @@ -449,6 +452,9 @@ int adm1025_write_value(struct i2c_client *client, u8 reg, u8 value) /* Called when we have found a new ADM1025. It should set limits, etc. */ void adm1025_init_client(struct i2c_client *client) { + struct adm1025_data *data = client->data; + + data->vrm = DEFAULT_VRM; /* Reset all except Watchdog values and last conversion values This sets fan-divs to 2, among others. This makes most other initializations unnecessary */ @@ -694,14 +700,29 @@ void adm1025_vid(struct i2c_client *client, int operation, int ctl_name, struct adm1025_data *data = client->data; if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 2; + *nrels_mag = 3; else if (operation == SENSORS_PROC_REAL_READ) { adm1025_update_client(client); - results[0] = VID_FROM_REG(data->vid); + results[0] = vid_from_reg(data->vid, data->vrm); *nrels_mag = 1; } } +void adm1025_vrm(struct i2c_client *client, int operation, int ctl_name, + int *nrels_mag, long *results) +{ + struct adm1025_data *data = client->data; + if (operation == SENSORS_PROC_REAL_INFO) + *nrels_mag = 1; + else if (operation == SENSORS_PROC_REAL_READ) { + results[0] = data->vrm; + *nrels_mag = 1; + } else if (operation == SENSORS_PROC_REAL_WRITE) { + if (*nrels_mag >= 1) + data->vrm = results[0]; + } +} + int __init sensors_adm1025_init(void) { int res; diff --git a/kernel/include/sensors.h b/kernel/include/sensors.h index 17bf7f33..0788da9e 100644 --- a/kernel/include/sensors.h +++ b/kernel/include/sensors.h @@ -258,6 +258,7 @@ #define ADM1025_SYSCTL_ALARMS 2001 /* bitvector */ #define ADM1025_SYSCTL_ANALOG_OUT 2002 #define ADM1025_SYSCTL_VID 2003 +#define ADM1025_SYSCTL_VRM 2004 #define ADM1025_ALARM_IN0 0x0001 #define ADM1025_ALARM_IN1 0x0002 diff --git a/lib/chips.c b/lib/chips.c index 5d3bdd82..1c629623 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -1885,7 +1885,9 @@ static sensors_chip_feature adm1025_features[] = SENSORS_ADM1025_TEMP2, SENSORS_MODE_RW, ADM1025_SYSCTL_RTEMP, VALUE(1), 1 }, { SENSORS_ADM1025_VID, "vid", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, - SENSORS_MODE_R, ADM1025_SYSCTL_VID, VALUE(1), 2 }, + SENSORS_MODE_R, ADM1025_SYSCTL_VID, VALUE(1), 3 }, + { SENSORS_ADM1025_VRM, "vrm", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, + SENSORS_MODE_R, ADM1025_SYSCTL_VRM, VALUE(1), 1 }, { SENSORS_ADM1025_ALARMS, "alarms", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, SENSORS_MODE_R, ADM1025_SYSCTL_ALARMS, VALUE(1), 0 }, { 0 } diff --git a/lib/chips.h b/lib/chips.h index 13a27b25..b48bb504 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -763,6 +763,7 @@ #define SENSORS_ADM1025_TEMP2_HYST 55 /* RW */ #define SENSORS_ADM1025_TEMP2_OVER 56 /* RW */ #define SENSORS_ADM1025_VID 61 /* R */ +#define SENSORS_ADM1025_VRM 62 /* R */ #define SENSORS_ADM1025_ALARMS 81 /* R */