Changeset 2603
- Timestamp:
- 06/19/04 23:54:08 (4 years ago)
- Files:
-
- lm-sensors/trunk/doc/chips/pc87360 (modified) (1 diff)
- lm-sensors/trunk/etc/sensors.conf.eg (modified) (1 diff)
- lm-sensors/trunk/kernel/chips/pc87360.c (modified) (12 diffs)
- lm-sensors/trunk/lib/chips.c (modified) (1 diff)
- lm-sensors/trunk/lib/chips.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/doc/chips/pc87360
r2556 r2603 152 152 triggers an alarm when crossed. 153 153 154 When available, VID inputs are used to provide the nominal CPU Core voltage. 155 The driver will default to VRM 9.0, but this can be changed from user-space. 156 The chipsets can handle two sets of VID inputs (on dual-CPU systems), but 157 the driver will only export one for now. This may change later if there is 158 a need. 159 154 160 155 161 General Remarks lm-sensors/trunk/etc/sensors.conf.eg
r2583 r2603 2070 2070 # Voltage inputs 2071 2071 2072 # Set VRM version (default 9.0) 2073 # set vrm 9.0 2074 2072 2075 label in7 "Vsb" 2073 2076 label in8 "Vdd" lm-sensors/trunk/kernel/chips/pc87360.c
r2595 r2603 42 42 #include <asm/io.h> 43 43 #include "version.h" 44 #include "sensors_vid.h" 44 45 45 46 static unsigned short normal_i2c[] = { SENSORS_I2C_END }; … … 50 51 static u8 devid; 51 52 static unsigned int extra_isa[] = { 0x0000, 0x0000, 0x0000 }; 52 static u8 confreg[ 3];53 static u8 confreg[4]; 53 54 54 55 enum chips { any_chip, pc87360, pc87363, pc87364, pc87365, pc87366 }; … … 169 170 #define PC87365_REG_IN_ALARMS1 0x00 170 171 #define PC87365_REG_IN_ALARMS2 0x01 172 #define PC87365_REG_VID 0x06 171 173 172 174 #define IN_FROM_REG(val,ref) (((val) * (ref) + 128) / 256) … … 216 218 u8 in_status[14]; /* Register value */ 217 219 u16 in_alarms; /* Register values, combined, masked */ 220 u8 vid_conf; /* Configuration register value */ 221 u8 vrm; 222 u8 vid; /* Register value */ 218 223 219 224 u8 temp[3]; /* Register value */ … … 256 261 void pc87365_in_status(struct i2c_client *client, int operation, int ctl_name, 257 262 int *nrels_mag, long *results); 263 void pc87365_vid(struct i2c_client *client, int operation, int ctl_name, 264 int *nrels_mag, long *results); 265 void pc87365_vrm(struct i2c_client *client, int operation, int ctl_name, 266 int *nrels_mag, long *results); 258 267 259 268 void pc87365_temp(struct i2c_client *client, int operation, int ctl_name, … … 319 328 #define PC87365_SYSCTL_TEMP5_STATUS 2312 /* not for PC87365 */ 320 329 #define PC87365_SYSCTL_TEMP6_STATUS 2313 /* not for PC87365 */ 330 331 #define PC87365_SYSCTL_VID 2400 332 #define PC87365_SYSCTL_VRM 2401 321 333 322 334 #define PC87365_STATUS_IN_MIN 0x02 … … 452 464 {PC87365_SYSCTL_TEMP6_STATUS, "temp6_status", NULL, 0, 0444, NULL, 453 465 &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_in_status}, 466 {PC87365_SYSCTL_VID, "vid", NULL, 0, 0444, NULL, 467 &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_vid}, 468 {PC87365_SYSCTL_VRM, "vrm", NULL, 0, 0644, NULL, 469 &i2c_proc_real, &i2c_sysctl_real, NULL, &pc87365_vrm}, 454 470 {0} 455 471 }; … … 526 542 /* Are we using thermistors? */ 527 543 if (*devid == 0xE9) { /* PC87366 */ 528 /* Th is register isnot logical-device529 specific, just that we won't need it if we530 don't use the VLM device */544 /* These registers are not logical-device 545 specific, just that we won't need them if 546 we don't use the VLM device */ 531 547 confreg[2] = superio_inb(0x2B); 548 confreg[3] = superio_inb(0x25); 532 549 533 550 if (confreg[2] & 0x40) { … … 536 553 "monitoring\n"); 537 554 } 555 556 #ifdef DEBUG 557 if (confreg[3] & 0xE0) { 558 printk(KERN_INFO "pc87360.o: VID " 559 "inputs routed (mode %d)\n", 560 confreg[3] & 0xE0); 561 } 562 #endif 538 563 } 539 564 } … … 645 670 (i&0x02) ? "external" : "internal"); 646 671 #endif 672 673 data->vid_conf = confreg[3]; 674 data->vrm = 90; 647 675 } 648 676 … … 961 989 NO_BANK, PC87365_REG_IN_ALARMS2) 962 990 & 0x07) << 8); 991 data->vid = (data->vid_conf & 0xE0) ? 992 pc87360_read_value(data, LD_IN, 993 NO_BANK, PC87365_REG_VID) : 0x1F; 963 994 } 964 995 … … 1182 1213 } 1183 1214 1215 void pc87365_vid(struct i2c_client *client, int operation, int ctl_name, 1216 int *nrels_mag, long *results) 1217 { 1218 struct pc87360_data *data = client->data; 1219 if (operation == SENSORS_PROC_REAL_INFO) 1220 *nrels_mag = 3; 1221 else if (operation == SENSORS_PROC_REAL_READ) { 1222 pc87360_update_client(client); 1223 results[0] = vid_from_reg(data->vid & 0x1f, data->vrm); 1224 *nrels_mag = 1; 1225 } 1226 } 1227 1228 void pc87365_vrm(struct i2c_client *client, int operation, int ctl_name, 1229 int *nrels_mag, long *results) 1230 { 1231 struct pc87360_data *data = client->data; 1232 if (operation == SENSORS_PROC_REAL_INFO) 1233 *nrels_mag = 1; 1234 else if (operation == SENSORS_PROC_REAL_READ) { 1235 results[0] = data->vrm; 1236 *nrels_mag = 1; 1237 } else if (operation == SENSORS_PROC_REAL_WRITE) { 1238 if (*nrels_mag >= 1) 1239 data->vrm = results[0]; 1240 } 1241 } 1242 1184 1243 void pc87365_temp(struct i2c_client *client, int operation, int ctl_name, 1185 1244 int *nrels_mag, long *results) lm-sensors/trunk/lib/chips.c
r2595 r2603 4618 4618 { SENSORS_PC87360_TEMP6_STATUS, "temp6_status", SENSORS_PC87360_TEMP6, 4619 4619 NOMAP, R, PC87365_SYSCTL_TEMP6_STATUS, VALUE(1), 0 }, 4620 { SENSORS_PC87360_VID, "vid", NOMAP, NOMAP, 4621 R, PC87365_SYSCTL_VID, VALUE(1), 3 }, 4622 { SENSORS_PC87360_VRM, "vrm", NOMAP, NOMAP, 4623 RW, PC87365_SYSCTL_VRM, VALUE(1), 1 }, 4620 4624 { 0 } 4621 4625 }; lm-sensors/trunk/lib/chips.h
r2573 r2603 1750 1750 #define SENSORS_PC87360_TEMP6_STATUS 216 /* R */ 1751 1751 1752 #define SENSORS_PC87360_VID 240 /* R */ 1753 #define SENSORS_PC87360_VRM 241 /* RW */ 1754 1752 1755 #define SENSORS_LM92_PREFIX "lm92" 1753 1756
