Changeset 940
- Timestamp:
- 11/30/00 03:44:47 (12 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (2 diffs)
-
kernel/chips/adm1025.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r935 r940 20 20 2.5.5 (2000????) 21 21 Chip modules (all): Update mutex definition (works now for new 2.2 kernels) 22 File sensors.conf.eg: Add mtp008 entries 22 File sensors.conf.eg: Add mtp008 entries, adm1025 entries 23 23 Library: Add ds1621, mtp008 support 24 24 Module adm1021: Add support for adm1021a / adm1023 25 Module adm1025: Add support for remote temp; rename /proc entries to 26 in[0-5] and temp[1-2]; fix negative temp readings 25 27 Module ddcmon: allow force and force_ddcmon parameters 26 28 Module ds1621: new … … 31 33 Module w83781d: fix beep setting via /proc 32 34 Program mkpatch.pl: more fixes 33 Program sensors: Add ds1621, mtp008 support, add -f (Fahrenheit) option 34 Program sensors-detect: Add ds1621, mtp008 detection 35 Program sensors: Add ds1621, mtp008 support; add -f (Fahrenheit) option; 36 add adm1025 temp2; report temp limits correctly as 37 min/max or limit/hysteresis 38 Program sensors-detect: Add ds1621, mtp008 detection; 39 add ServerWorks detection (no driver yet) 35 40 36 41 2.5.4 (20001012) -
lm-sensors/trunk/kernel/chips/adm1025.c
r933 r940 3 3 monitoring 4 4 Add by Gordon Wu <gwu@esoft.com> according to the adm9240.c written by 5 6 5 Frodo Looijaard <frodol@dds.nl> 7 6 and Philip Edelbrock <phil@netroedge.com> … … 22 21 */ 23 22 24 /* Supports ADM10250. See doc/chips/adm9240for details */23 /* Supports the Analog Devices ADM1025. See doc/chips/adm1025 for details */ 25 24 26 25 #include <linux/version.h> … … 108 107 #define IN_FROM_REG(val,nr) (val) 109 108 110 /* #define TEMP_FROM_REG(temp) \ 111 ((temp)<256?((((temp)&0x1fe) >> 1) * 10) + ((temp) & 1) * 5: \ 112 ((((temp)&0x1fe) >> 1) -255) * 10 - ((temp) & 1) * 5) \ 113 */ 114 #define TEMP_FROM_REG(temp) (((temp)>0x7f?(-temp):(temp))*10) 115 116 #define TEMP_LIMIT_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) 117 109 #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) 110 #define TEMP_LIMIT_FROM_REG(val) TEMP_FROM_REG(val) 118 111 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT(((val)<0?(((val)-5)/10):\ 119 ((val)+5)/10), \ 120 0,255) 112 ((val)+5)/10), 0, 255) 121 113 122 114 #define ALARMS_FROM_REG(val) (val) 123 124 115 125 116 #define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\ … … 162 153 163 154 #define ADM1025_INIT_RTEMP_MAX 600 164 #define ADM1025_INIT_RTEMP_MIN 500155 #define ADM1025_INIT_RTEMP_MIN 0 165 156 #define ADM1025_INIT_TEMP_MAX 600 166 #define ADM1025_INIT_TEMP_MIN 500157 #define ADM1025_INIT_TEMP_MIN 0 167 158 168 159 #ifdef MODULE … … 186 177 u8 in_max[6]; /* Register value */ 187 178 u8 in_min[6]; /* Register value */ 188 intrtemp; /* Register value */179 u8 rtemp; /* Register value */ 189 180 u8 rtemp_max; /* Register value */ 190 u8 rtemp_min; /* Register encoding, shifted right*/191 int temp; /* Temp, shifted right*/181 u8 rtemp_min; /* Register value */ 182 u8 temp; /* Register value */ 192 183 u8 temp_max; /* Register value */ 193 184 u8 temp_min; /* Register value */ … … 225 216 int ctl_name, int *nrels_mag, long *results); 226 217 static void adm1025_temp(struct i2c_client *client, int operation, 218 int ctl_name, int *nrels_mag, long *results); 219 static void adm1025_rm_temp(struct i2c_client *client, int operation, 227 220 int ctl_name, int *nrels_mag, long *results); 228 221 static void adm1025_alarms(struct i2c_client *client, int operation, … … 260 253 when a new copy is allocated. */ 261 254 static ctl_table adm1025_dir_table_template[] = { 262 {ADM1025_SYSCTL_IN0, " 2.5V", NULL, 0, 0644, NULL, &sensors_proc_real,255 {ADM1025_SYSCTL_IN0, "in0", NULL, 0, 0644, NULL, &sensors_proc_real, 263 256 &sensors_sysctl_real, NULL, &adm1025_in}, 264 {ADM1025_SYSCTL_IN1, " Vccp1", NULL, 0, 0644, NULL, &sensors_proc_real,257 {ADM1025_SYSCTL_IN1, "in1", NULL, 0, 0644, NULL, &sensors_proc_real, 265 258 &sensors_sysctl_real, NULL, &adm1025_in}, 266 {ADM1025_SYSCTL_IN2, " 3.3V", NULL, 0, 0644, NULL, &sensors_proc_real,259 {ADM1025_SYSCTL_IN2, "in2", NULL, 0, 0644, NULL, &sensors_proc_real, 267 260 &sensors_sysctl_real, NULL, &adm1025_in}, 268 {ADM1025_SYSCTL_IN3, " 5V", NULL, 0, 0644, NULL, &sensors_proc_real,261 {ADM1025_SYSCTL_IN3, "in3", NULL, 0, 0644, NULL, &sensors_proc_real, 269 262 &sensors_sysctl_real, NULL, &adm1025_in}, 270 {ADM1025_SYSCTL_IN4, " 12V", NULL, 0, 0644, NULL, &sensors_proc_real,263 {ADM1025_SYSCTL_IN4, "in4", NULL, 0, 0644, NULL, &sensors_proc_real, 271 264 &sensors_sysctl_real, NULL, &adm1025_in}, 272 {ADM1025_SYSCTL_IN5, " Vcc", NULL, 0, 0644, NULL, &sensors_proc_real,265 {ADM1025_SYSCTL_IN5, "in5", NULL, 0, 0644, NULL, &sensors_proc_real, 273 266 &sensors_sysctl_real, NULL, &adm1025_in}, 274 /*{ADM1025_SYSCTL_RTEMP, "Remote_temp", NULL, 0, 0644, NULL, &sensors_proc_real,275 &sensors_sysctl_real, NULL, &adm1025_rm_temp}, */276 {ADM1025_SYSCTL_TEMP, " Local_temp", NULL, 0, 0644, NULL, &sensors_proc_real,267 {ADM1025_SYSCTL_RTEMP, "temp2", NULL, 0, 0644, NULL, &sensors_proc_real, 268 &sensors_sysctl_real, NULL, &adm1025_rm_temp}, 269 {ADM1025_SYSCTL_TEMP, "temp1", NULL, 0, 0644, NULL, &sensors_proc_real, 277 270 &sensors_sysctl_real, NULL, &adm1025_temp}, 278 271 {ADM1025_SYSCTL_ALARMS, "alarms", NULL, 0, 0444, NULL, &sensors_proc_real, … … 524 517 data->temp = 525 518 adm1025_read_value(client, ADM1025_REG_TEMP); 519 data->rtemp = 520 adm1025_read_value(client, ADM1025_REG_RTEMP); 526 521 #ifdef DEBUG 527 522 printk("The temp is %2x\n",data->temp); … … 531 526 data->temp_min = 532 527 adm1025_read_value(client, ADM1025_REG_TEMP_LOW); 528 data->rtemp_max = 529 adm1025_read_value(client, ADM1025_REG_RTEMP_HIGH); 530 data->rtemp_min = 531 adm1025_read_value(client, ADM1025_REG_RTEMP_LOW); 533 532 534 533 i = adm1025_read_value(client, ADM1025_REG_VID); … … 627 626 } 628 627 628 void adm1025_rm_temp(struct i2c_client *client, int operation, int ctl_name, 629 int *nrels_mag, long *results) 630 { 631 struct adm1025_data *data = client->data; 632 if (operation == SENSORS_PROC_REAL_INFO) 633 *nrels_mag = 1; 634 else if (operation == SENSORS_PROC_REAL_READ) { 635 adm1025_update_client(client); 636 results[0] = TEMP_LIMIT_FROM_REG(data->rtemp_max); 637 results[1] = TEMP_LIMIT_FROM_REG(data->rtemp_min); 638 results[2] = TEMP_FROM_REG(data->rtemp); 639 *nrels_mag = 3; 640 } else if (operation == SENSORS_PROC_REAL_WRITE) { 641 if (*nrels_mag >= 1) { 642 data->temp_max = TEMP_LIMIT_TO_REG(results[0]); 643 adm1025_write_value(client, ADM1025_REG_RTEMP_HIGH, 644 data->rtemp_max); 645 } 646 if (*nrels_mag >= 2) { 647 data->temp_min = TEMP_LIMIT_TO_REG(results[1]); 648 adm1025_write_value(client, ADM1025_REG_RTEMP_LOW, 649 data->rtemp_min); 650 } 651 } 652 } 653 629 654 void adm1025_alarms(struct i2c_client *client, int operation, int ctl_name, 630 655 int *nrels_mag, long *results)
