Changeset 2197
- Timestamp:
- 12/31/03 22:30:43 (9 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 4 modified
-
etc/sensors.conf.eg (modified) (1 diff)
-
lib/chips.c (modified) (1 diff)
-
lib/proc.c (modified) (4 diffs)
-
prog/sensors/chips.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/etc/sensors.conf.eg
r2195 r2197 1629 1629 1630 1630 # change the hysteresis value to fit your needs 1631 # relative value, applies to both critical thresholds 1631 # This is a little bit tricky. Under Linux 2.4, this is a relative value 1632 # and applies to both critical thresholds. This is a direct representation 1633 # of the chipset register. 1632 1634 # set hyst 5 1635 # Under Linux 2.6 however, this is an absolute value and applies to 1636 # tcrit2. Keep in mind that this is still internally represented as a 1637 # relative, common value (because there's a single register, holding a 1638 # relative value, in the chipset itself) so it is important to set it 1639 # *after* setting tcrit2 (i.e. don't change the set lines order). 1640 # set hyst 80 1641 # Tcrit1 hysteresis value will be set automatically, with the same delta. 1642 # In this example (with tcrit1=75 and tcrit2=85), the internal register 1643 # would be set to 5, and the hysteresis temperature for tcrit1 would be 70. 1644 # Note that the internal register cannot hold values greater than 31, so 1645 # the delta between critical temperatures and respective absolute hysteresis 1646 # can never exceed this value. 1633 1647 1634 1648 chip "vt1211-*" "vt8231-*" -
lm-sensors/trunk/lib/chips.c
r2181 r2197 730 730 { SENSORS_LM90_TCRIT_HYST, "hyst", 731 731 NOMAP, NOMAP, 732 RW, LM90_SYSCTL_HYST, VALUE(1), 0 },732 RW, LM90_SYSCTL_HYST, VALUE(1), 0, "temp_hyst2", 3 }, 733 733 { SENSORS_LM90_ALARMS, "alarms", 734 734 NOMAP, NOMAP, -
lm-sensors/trunk/lib/proc.c
r2196 r2197 412 412 First looks for a sysfs name and magnitude in the feature structure. 413 413 These should be added in chips.c for all non-standard feature names. 414 If that fails, converts common /proc feature names414 If that fails, converts common /proc feature names 415 415 to their sysfs equivalent, and uses common sysfs magnitude. 416 416 Common magnitudes are #defined above. … … 425 425 temp%d_hyst -> temp_min%d ("") 426 426 temp%d_max -> temp_max%d 427 temp%d_high -> temp_max%d 427 428 temp%d_min -> temp_min%d 429 temp%d_low -> temp_min%d 428 430 temp%d -> temp_input%d 431 tcrit%d -> temp_crit%d 429 432 AND all conversions listed in the matches[] structure below. 430 433 … … 451 454 { "beeps", "beep_mask", 0 }, 452 455 { "pwm", "pwm1", 0 }, 453 { "rem pte_temp", "temp_input2", TEMPMAG },456 { "remote_temp", "temp_input2", TEMPMAG }, 454 457 { "remote_temp_hyst", "temp_hyst2", TEMPMAG }, 455 458 { "remote_temp_low", "temp_min2", TEMPMAG }, … … 542 545 return 0; 543 546 } 547 if(sscanf(name, "temp%d_lo%c%c", &num, &last, &check) == 2 && last == 'w') { 548 sprintf(sysname, "temp_min%d", num); 549 *sysmag = TEMPMAG; 550 return 0; 551 } 544 552 if(sscanf(name, "temp%d_ma%c%c", &num, &last, &check) == 2 && last == 'x') { 545 553 sprintf(sysname, "temp_max%d", num); 554 *sysmag = TEMPMAG; 555 return 0; 556 } 557 if(sscanf(name, "temp%d_hig%c%c", &num, &last, &check) == 2 && last == 'h') { 558 sprintf(sysname, "temp_max%d", num); 559 *sysmag = TEMPMAG; 560 return 0; 561 } 562 if(sscanf(name, "tcrit%d%c", &num, &check) == 1) { 563 sprintf(sysname, "temp_crit%d", num); 546 564 *sysmag = TEMPMAG; 547 565 return 0; -
lm-sensors/trunk/prog/sensors/chips.c
r2181 r2197 4537 4537 { 4538 4538 char *label; 4539 double cur, high, low ;4539 double cur, high, low, hyst; 4540 4540 int valid, alarms; 4541 4541 … … 4580 4580 free_the_label(&label); 4581 4581 4582 /* 2.6 tweak: 4583 * In 2.4 there is only one, relative hyst value, (default 10). 4584 * In 2.6 there are two, absolute values. 4585 * The library will link hyst (2.4) to temp_hyst2 (2.6) and we have 4586 * to compute the relative value from temp_hyst2 and temp_crit2. 4587 * We detect that using the following rules: 4588 * - if hyst is not in the range 0..31, it is absolute (2.6); 4589 * - if hyst exceeds tcrit1 or tcrit2, it is absolute (2.6); 4590 * - if hyst is greater than it would be if considered absolute, 4591 * it is absolute (heuristic); 4592 * - else it is relative (2.4). 4593 * Also note that the use of low and high right below is 4594 * arbitrary, only to reuse previously defined variables, at the 4595 * admitted cost of a lower readability. 4596 */ 4597 if (!sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &hyst) 4598 && !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TCRIT, &low) 4599 && !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TCRIT, &high)) { 4600 if (hyst<=-0.5 || hyst>=31.5 || hyst>low || hyst>high || hyst>high-hyst) 4601 hyst = high-hyst; 4602 } else { 4603 printf("ERROR: Can't get hyst data!\n"); 4604 hyst = 10; 4605 } 4606 4582 4607 if (!sensors_get_label_and_valid(*name, SENSORS_LM90_LOCAL_TCRIT, 4583 &label, &valid) 4584 && !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TCRIT, &high) 4585 && !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &low)) { 4608 &label, &valid)) { 4586 4609 if (valid) { 4587 4610 print_label(label, 10); 4588 print_temp_info( high, high-low, 0, HYSTONLY, 0, 0);4611 print_temp_info(low, low-hyst, 0, HYSTONLY, 0, 0); 4589 4612 printf("\n"); 4590 4613 } … … 4594 4617 4595 4618 if (!sensors_get_label_and_valid(*name, SENSORS_LM90_REMOTE_TCRIT, 4596 &label, &valid) 4597 && !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TCRIT, &high) 4598 && !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &low)) { 4619 &label, &valid)) { 4599 4620 if (valid) { 4600 4621 print_label(label, 10); 4601 print_temp_info(high, high- low, 0, HYSTONLY, 0, 0);4622 print_temp_info(high, high-hyst, 0, HYSTONLY, 0, 0); 4602 4623 printf("\n"); 4603 4624 }
