Changeset 150
- Timestamp:
- 01/08/99 21:21:32 (10 years ago)
- Files:
-
- lm-sensors/trunk/CHANGES (modified) (1 diff)
- lm-sensors/trunk/doc/progs (modified) (1 diff)
- lm-sensors/trunk/etc/sensors.conf.eg (modified) (1 diff)
- lm-sensors/trunk/kernel/chips/gl518sm.c (modified) (5 diffs)
- lm-sensors/trunk/lib/chips.c (modified) (1 diff)
- lm-sensors/trunk/src/gl518sm.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/CHANGES
r149 r150 16 16 2.1.2 (199801??) 17 17 Modules lm80.o, w83781d.o: fan-related Segmentation fault corrected 18 Module gl518sm.o: yet more bug fixes. It should at long last be usable now 18 19 19 20 2.1.1 (19990107) lm-sensors/trunk/doc/progs
r139 r150 8 8 and prints to stdout `bus' statements reflecting the currently detected 9 9 adapters. 10 * prog/dump/isadump (written in C, not installed) 11 This program helps to dump the registers of LM78-like chips, or more 12 exactly, chips which use an I/O-port for its address and one as its 13 data register. Usual syntax: 14 ./isadump 0x295 0x296 10 15 * prog/eeprom/decode-dimms.pl (written in Perl 5, not installed) 11 16 This program decodes the information generated by the `eeprom.o' module. lm-sensors/trunk/etc/sensors.conf.eg
r139 r150 202 202 # chips are typically used. Please contact us if you own one. 203 203 label vdd "+5V" 204 compute vdd @ * 2.5, @ / 2.5205 206 207 204 208 205 chip "lm80-*" lm-sensors/trunk/kernel/chips/gl518sm.c
r145 r150 64 64 #define IN_FROM_REG(val) (((val)*19)/10) 65 65 66 #define VDD_TO_REG(val) ((((val)*10+11)/23) & 0xff) 67 #define VDD_FROM_REG(val) (((val)*23)/10) 68 66 69 #define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1) 67 70 #define DIV_FROM_REG(val) (1 << (val)) … … 85 88 #define GL518_INIT_VIN_2 300 86 89 #define GL518_INIT_VIN_3 300 87 #define GL518_INIT_VDD 30090 #define GL518_INIT_VDD 500 88 91 89 92 #define GL518_INIT_PERCENTAGE 10 … … 314 317 IN_TO_REG(GL518_INIT_VIN_MIN_3)); 315 318 gl518_write_value(new_client,GL518_REG_VDD_LIMIT, 316 ( IN_TO_REG(GL518_INIT_VDD_MAX) << 8) |317 IN_TO_REG(GL518_INIT_VDD_MIN));319 (VDD_TO_REG(GL518_INIT_VDD_MAX) << 8) | 320 VDD_TO_REG(GL518_INIT_VDD_MIN)); 318 321 /* Clear status register (bit 5=1), start (bit6=1) */ 319 322 gl518_write_value(new_client,GL518_REG_CONF,0x24); … … 505 508 else if (operation == SENSORS_PROC_REAL_READ) { 506 509 gl518_update_client(client); 507 results[0] = IN_FROM_REG(data->voltage_min[nr]); 508 results[1] = IN_FROM_REG(data->voltage_max[nr]); 510 results[0] = nr?IN_FROM_REG(data->voltage_min[nr]): 511 VDD_FROM_REG(data->voltage_min[nr]); 512 results[1] = nr?IN_FROM_REG(data->voltage_max[nr]): 513 VDD_FROM_REG(data->voltage_max[nr]); 509 514 if ((data->revision == 0x00) && (nr != 3)) 510 515 results[2] = 0; 511 516 else 512 results[2] = IN_FROM_REG(data->voltage[nr]); 517 results[2] = nr?IN_FROM_REG(data->voltage[nr]): 518 VDD_FROM_REG(data->voltage[nr]); 513 519 *nrels_mag = 3; 514 520 } else if (operation == SENSORS_PROC_REAL_WRITE) { … … 518 524 old = gl518_read_value(client,regnr) & 0xff00; 519 525 if (*nrels_mag >= 2) { 520 data->voltage_max[nr] = IN_TO_REG(results[1]);526 data->voltage_max[nr] = nr?IN_TO_REG(results[1]):VDD_TO_REG(results[1]); 521 527 old = data->voltage_max[nr] << 8; 522 528 } 523 529 if (*nrels_mag >= 1) { 524 data->voltage_min[nr] = IN_TO_REG(results[0]);530 data->voltage_min[nr] = nr?IN_TO_REG(results[0]):VDD_TO_REG(results[0]); 525 531 old |= data->voltage_min[nr]; 526 532 gl518_write_value(client,regnr,old); lm-sensors/trunk/lib/chips.c
r145 r150 435 435 { SENSORS_GL518R80_ALARMS, "alarms", SENSORS_NO_MAPPING, 436 436 SENSORS_NO_MAPPING, SENSORS_MODE_R, 437 GL518_SYSCTL_ FAN_DIV, VALUE(3), 0 },437 GL518_SYSCTL_ALARMS, VALUE(1), 0 }, 438 438 { SENSORS_GL518R80_BEEP_ENABLE, "beep_enable", SENSORS_GL518R80_ALARMS, 439 439 SENSORS_NO_MAPPING, SENSORS_MODE_RW, lm-sensors/trunk/src/gl518sm.c
r145 r150 64 64 #define IN_FROM_REG(val) (((val)*19)/10) 65 65 66 #define VDD_TO_REG(val) ((((val)*10+11)/23) & 0xff) 67 #define VDD_FROM_REG(val) (((val)*23)/10) 68 66 69 #define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1) 67 70 #define DIV_FROM_REG(val) (1 << (val)) … … 85 88 #define GL518_INIT_VIN_2 300 86 89 #define GL518_INIT_VIN_3 300 87 #define GL518_INIT_VDD 30090 #define GL518_INIT_VDD 500 88 91 89 92 #define GL518_INIT_PERCENTAGE 10 … … 314 317 IN_TO_REG(GL518_INIT_VIN_MIN_3)); 315 318 gl518_write_value(new_client,GL518_REG_VDD_LIMIT, 316 ( IN_TO_REG(GL518_INIT_VDD_MAX) << 8) |317 IN_TO_REG(GL518_INIT_VDD_MIN));319 (VDD_TO_REG(GL518_INIT_VDD_MAX) << 8) | 320 VDD_TO_REG(GL518_INIT_VDD_MIN)); 318 321 /* Clear status register (bit 5=1), start (bit6=1) */ 319 322 gl518_write_value(new_client,GL518_REG_CONF,0x24); … … 505 508 else if (operation == SENSORS_PROC_REAL_READ) { 506 509 gl518_update_client(client); 507 results[0] = IN_FROM_REG(data->voltage_min[nr]); 508 results[1] = IN_FROM_REG(data->voltage_max[nr]); 510 results[0] = nr?IN_FROM_REG(data->voltage_min[nr]): 511 VDD_FROM_REG(data->voltage_min[nr]); 512 results[1] = nr?IN_FROM_REG(data->voltage_max[nr]): 513 VDD_FROM_REG(data->voltage_max[nr]); 509 514 if ((data->revision == 0x00) && (nr != 3)) 510 515 results[2] = 0; 511 516 else 512 results[2] = IN_FROM_REG(data->voltage[nr]); 517 results[2] = nr?IN_FROM_REG(data->voltage[nr]): 518 VDD_FROM_REG(data->voltage[nr]); 513 519 *nrels_mag = 3; 514 520 } else if (operation == SENSORS_PROC_REAL_WRITE) { … … 518 524 old = gl518_read_value(client,regnr) & 0xff00; 519 525 if (*nrels_mag >= 2) { 520 data->voltage_max[nr] = IN_TO_REG(results[1]);526 data->voltage_max[nr] = nr?IN_TO_REG(results[1]):VDD_TO_REG(results[1]); 521 527 old = data->voltage_max[nr] << 8; 522 528 } 523 529 if (*nrels_mag >= 1) { 524 data->voltage_min[nr] = IN_TO_REG(results[0]);530 data->voltage_min[nr] = nr?IN_TO_REG(results[0]):VDD_TO_REG(results[0]); 525 531 old |= data->voltage_min[nr]; 526 532 gl518_write_value(client,regnr,old);
