Changeset 909
- Timestamp:
- 10/18/00 02:34:07 (8 years ago)
- Files:
-
- lm-sensors/trunk/CONTRIBUTORS (modified) (1 diff)
- lm-sensors/trunk/README (modified) (1 diff)
- lm-sensors/trunk/etc/sensors.conf.eg (modified) (1 diff)
- lm-sensors/trunk/kernel/include/sensors.h (modified) (2 diffs)
- lm-sensors/trunk/lib/chips.c (modified) (2 diffs)
- lm-sensors/trunk/lib/chips.h (modified) (1 diff)
- lm-sensors/trunk/prog/detect/sensors-detect (modified) (3 diffs)
- lm-sensors/trunk/prog/sensors/chips.c (modified) (1 diff)
- lm-sensors/trunk/prog/sensors/chips.h (modified) (1 diff)
- lm-sensors/trunk/prog/sensors/main.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/CONTRIBUTORS
r801 r909 55 55 * Chen-Yuan Wu <gwu@esoft.com> 56 56 Author of the adm1025 driver. 57 * Kris Van Hees <aedil@alchar.org> 58 Author of the mtp008 chip driver. lm-sensors/trunk/README
r908 r909 57 57 Intel Xeon processor embedded sensors 58 58 Maxim MAX1617 and MAX1617A 59 Myson MTP008 59 60 National Semicoductor LM75, LM77, LM78, LM78-J, LM79, 60 61 LM80, LM81, LM84, and LM87 lm-sensors/trunk/etc/sensors.conf.eg
r906 r909 567 567 #compute "5.0V" 1.009*@ , @/1.009 568 568 #compute "12V" 1.04*@ , @/1.04 569 570 chip "mtp008-*" 571 572 # The values below should be correct if you own a Tyan S1834D motherboard. If 573 # not, please contact us, so we can figure out better readings. 574 575 # For positive voltages outside the 0..4.09V range (in2..in4), two resistors 576 # are used, with the following formula (R1,R2: resistor values, Vs: read 577 # voltage, Vin: pin voltage) 578 # Vin = Vs * (R2 / (R1 + R2)) 579 # For negative voltages (in5) two resistors are used, with the following 580 # formula (R3,R4: resistor values, Vs: read voltage, Vin: pin voltage) 581 # Vin = ((4.096 - Vs) * (R3 / (R3 + R4))) + Vs 582 583 # Here are the official MTP008 data sheet values: 584 # Vs R1,R3 R2,R4 Vin 585 # +12.0 28000 10000 +3.16 586 # -12.0 232000 56000 +0.96 587 # -5.0 120000 56000 +1.20 588 589 label in0 "VCore1" 590 label in1 "+3.3V" 591 label in2 "+12V" 592 label in3 "Vcore2" 593 ignore in4 594 label in5 "-12V" 595 label in6 "Vtt" 596 597 label fan1 "CPUFAN1" 598 label fan2 "CPUFAN2" 599 label fan3 "CPUFAN3" 600 601 label temp1 "CPU1 Temp" 602 label temp2 "CPU2 Temp" 603 ignore temp3 604 605 compute in2 @ * 38 / 10, @ * 10 / 38 606 compute in5 (@ * 36 - 118.61) / 7, (118.61 + 7 * @) / 36 lm-sensors/trunk/kernel/include/sensors.h
r904 r909 402 402 #define I2C_DRIVERID_LM87 1021 403 403 #define I2C_DRIVERID_PCF8574 1022 404 #define I2C_DRIVERID_MTP008 1023 404 405 405 406 /* Sysctl IDs */ … … 777 778 #define PCF8574_SYSCTL_STAT 1000 778 779 780 #define MTP008_SYSCTL_IN0 1000 /* Volts * 100 */ 781 #define MTP008_SYSCTL_IN1 1001 782 #define MTP008_SYSCTL_IN2 1002 783 #define MTP008_SYSCTL_IN3 1003 784 #define MTP008_SYSCTL_IN4 1004 785 #define MTP008_SYSCTL_IN5 1005 786 #define MTP008_SYSCTL_IN6 1006 787 #define MTP008_SYSCTL_FAN1 1101 /* Rotations/min */ 788 #define MTP008_SYSCTL_FAN2 1102 789 #define MTP008_SYSCTL_FAN3 1103 790 #define MTP008_SYSCTL_TEMP1 1200 /* Degrees Celcius * 10 */ 791 #define MTP008_SYSCTL_TEMP2 1201 /* Degrees Celcius * 10 */ 792 #define MTP008_SYSCTL_TEMP3 1202 /* Degrees Celcius * 10 */ 793 #define MTP008_SYSCTL_VID 1300 /* Volts * 100 */ 794 #define MTP008_SYSCTL_PWM1 1401 795 #define MTP008_SYSCTL_PWM2 1402 796 #define MTP008_SYSCTL_PWM3 1403 797 #define MTP008_SYSCTL_SENS1 1501 /* 1, 2, or Beta (3000-5000) */ 798 #define MTP008_SYSCTL_SENS2 1502 799 #define MTP008_SYSCTL_SENS3 1503 800 #define MTP008_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ 801 #define MTP008_SYSCTL_ALARMS 2001 /* bitvector */ 802 #define MTP008_SYSCTL_BEEP 2002 /* bitvector */ 803 804 #define MTP008_ALARM_IN0 0x0001 805 #define MTP008_ALARM_IN1 0x0002 806 #define MTP008_ALARM_IN2 0x0004 807 #define MTP008_ALARM_IN3 0x0008 808 #define MTP008_ALARM_IN4 0x0100 809 #define MTP008_ALARM_IN5 0x0200 810 #define MTP008_ALARM_IN6 0x0400 811 #define MTP008_ALARM_FAN1 0x0040 812 #define MTP008_ALARM_FAN2 0x0080 813 #define MTP008_ALARM_FAN3 0x0800 814 #define MTP008_ALARM_TEMP1 0x0010 815 #define MTP008_ALARM_TEMP2 0x0100 816 #define MTP008_ALARM_TEMP3 0x0200 817 779 818 #endif /* def SENSORS_SENSORS_H */ 780 819 lm-sensors/trunk/lib/chips.c
r872 r909 1858 1858 }; 1859 1859 1860 static sensors_chip_feature mtp008_features[] = 1861 { 1862 { SENSORS_MTP008_IN0, "in0", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1863 SENSORS_MODE_R, MTP008_SYSCTL_IN0, VALUE(3), 2 }, 1864 { SENSORS_MTP008_IN1, "in1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1865 SENSORS_MODE_R, MTP008_SYSCTL_IN1, VALUE(3), 2 }, 1866 { SENSORS_MTP008_IN2, "in2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1867 SENSORS_MODE_R, MTP008_SYSCTL_IN2, VALUE(3), 2 }, 1868 { SENSORS_MTP008_IN3, "in3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1869 SENSORS_MODE_R, MTP008_SYSCTL_IN3, VALUE(3), 2 }, 1870 { SENSORS_MTP008_IN4, "in4", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1871 SENSORS_MODE_R, MTP008_SYSCTL_IN4, VALUE(3), 2 }, 1872 { SENSORS_MTP008_IN5, "in5", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1873 SENSORS_MODE_R, MTP008_SYSCTL_IN5, VALUE(3), 2 }, 1874 { SENSORS_MTP008_IN6, "in6", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1875 SENSORS_MODE_R, MTP008_SYSCTL_IN6, VALUE(3), 2 }, 1876 { SENSORS_MTP008_IN0_MIN, "in0_min", SENSORS_MTP008_IN0, 1877 SENSORS_MTP008_IN0, SENSORS_MODE_RW, 1878 MTP008_SYSCTL_IN0, VALUE(1), 2 }, 1879 { SENSORS_MTP008_IN1_MIN, "in1_min", SENSORS_MTP008_IN1, 1880 SENSORS_MTP008_IN1, SENSORS_MODE_RW, 1881 MTP008_SYSCTL_IN1, VALUE(1), 2 }, 1882 { SENSORS_MTP008_IN2_MIN, "in2_min", SENSORS_MTP008_IN2, 1883 SENSORS_MTP008_IN2, SENSORS_MODE_RW, 1884 MTP008_SYSCTL_IN2, VALUE(1), 2 }, 1885 { SENSORS_MTP008_IN3_MIN, "in3_min", SENSORS_MTP008_IN3, 1886 SENSORS_MTP008_IN3, SENSORS_MODE_RW, 1887 MTP008_SYSCTL_IN3, VALUE(1), 2 }, 1888 { SENSORS_MTP008_IN4_MIN, "in4_min", SENSORS_MTP008_IN4, 1889 SENSORS_MTP008_IN4, SENSORS_MODE_RW, 1890 MTP008_SYSCTL_IN4, VALUE(1), 2 }, 1891 { SENSORS_MTP008_IN5_MIN, "in5_min", SENSORS_MTP008_IN5, 1892 SENSORS_MTP008_IN5, SENSORS_MODE_RW, 1893 MTP008_SYSCTL_IN5, VALUE(1), 2 }, 1894 { SENSORS_MTP008_IN6_MIN, "in6_min", SENSORS_MTP008_IN6, 1895 SENSORS_MTP008_IN6, SENSORS_MODE_RW, 1896 MTP008_SYSCTL_IN6, VALUE(1), 2 }, 1897 { SENSORS_MTP008_IN0_MAX, "in0_max", SENSORS_MTP008_IN0, 1898 SENSORS_MTP008_IN0, SENSORS_MODE_RW, 1899 MTP008_SYSCTL_IN0, VALUE(2), 2 }, 1900 { SENSORS_MTP008_IN1_MAX, "in1_max", SENSORS_MTP008_IN1, 1901 SENSORS_MTP008_IN1, SENSORS_MODE_RW, 1902 MTP008_SYSCTL_IN1, VALUE(2), 2 }, 1903 { SENSORS_MTP008_IN2_MAX, "in2_max", SENSORS_MTP008_IN2, 1904 SENSORS_MTP008_IN2, SENSORS_MODE_RW, 1905 MTP008_SYSCTL_IN2, VALUE(2), 2 }, 1906 { SENSORS_MTP008_IN3_MAX, "in3_max", SENSORS_MTP008_IN3, 1907 SENSORS_MTP008_IN3, SENSORS_MODE_RW, 1908 MTP008_SYSCTL_IN3, VALUE(2), 2 }, 1909 { SENSORS_MTP008_IN4_MAX, "in4_max", SENSORS_MTP008_IN4, 1910 SENSORS_MTP008_IN4, SENSORS_MODE_RW, 1911 MTP008_SYSCTL_IN4, VALUE(2), 2 }, 1912 { SENSORS_MTP008_IN5_MAX, "in5_max", SENSORS_MTP008_IN5, 1913 SENSORS_MTP008_IN5, SENSORS_MODE_RW, 1914 MTP008_SYSCTL_IN5, VALUE(2), 2 }, 1915 { SENSORS_MTP008_IN6_MAX, "in6_max", SENSORS_MTP008_IN6, 1916 SENSORS_MTP008_IN6, SENSORS_MODE_RW, 1917 MTP008_SYSCTL_IN6, VALUE(2), 2 }, 1918 { SENSORS_MTP008_FAN1, "fan1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1919 SENSORS_MODE_R, MTP008_SYSCTL_FAN1, VALUE(2), 0 }, 1920 { SENSORS_MTP008_FAN2, "fan2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1921 SENSORS_MODE_R, MTP008_SYSCTL_FAN2, VALUE(2), 0 }, 1922 { SENSORS_MTP008_FAN3, "fan3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1923 SENSORS_MODE_R, MTP008_SYSCTL_FAN3, VALUE(2), 0 }, 1924 { SENSORS_MTP008_FAN1_MIN, "fan1_limit", SENSORS_MTP008_FAN1, 1925 SENSORS_MTP008_FAN1, SENSORS_MODE_RW, 1926 MTP008_SYSCTL_FAN1, VALUE(1), 0 }, 1927 { SENSORS_MTP008_FAN2_MIN, "fan2_limit", SENSORS_MTP008_FAN2, 1928 SENSORS_MTP008_FAN2, SENSORS_MODE_RW, 1929 MTP008_SYSCTL_FAN2, VALUE(1), 0 }, 1930 { SENSORS_MTP008_FAN3_MIN, "fan3_limit", SENSORS_MTP008_FAN3, 1931 SENSORS_MTP008_FAN3, SENSORS_MODE_RW, 1932 MTP008_SYSCTL_FAN3, VALUE(1), 0 }, 1933 { SENSORS_MTP008_TEMP1, "temp1", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1934 SENSORS_MODE_R, MTP008_SYSCTL_TEMP1, VALUE(3), 1 }, 1935 { SENSORS_MTP008_TEMP2, "temp2", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1936 SENSORS_MODE_R, MTP008_SYSCTL_TEMP2, VALUE(3), 1 }, 1937 { SENSORS_MTP008_TEMP3, "temp3", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1938 SENSORS_MODE_R, MTP008_SYSCTL_TEMP3, VALUE(3), 1 }, 1939 { SENSORS_MTP008_TEMP1_OVER, "temp1_over", SENSORS_MTP008_TEMP1, 1940 SENSORS_MTP008_TEMP1, SENSORS_MODE_RW, 1941 MTP008_SYSCTL_TEMP1, VALUE(1), 1 }, 1942 { SENSORS_MTP008_TEMP2_OVER, "temp2_over", SENSORS_MTP008_TEMP2, 1943 SENSORS_MTP008_TEMP2, SENSORS_MODE_RW, 1944 MTP008_SYSCTL_TEMP2, VALUE(1), 1 }, 1945 { SENSORS_MTP008_TEMP3_OVER, "temp3_over", SENSORS_MTP008_TEMP3, 1946 SENSORS_MTP008_TEMP3, SENSORS_MODE_RW, 1947 MTP008_SYSCTL_TEMP3, VALUE(1), 1 }, 1948 { SENSORS_MTP008_TEMP1_HYST, "temp1_hyst", SENSORS_MTP008_TEMP1, 1949 SENSORS_MTP008_TEMP1, SENSORS_MODE_RW, 1950 MTP008_SYSCTL_TEMP1, VALUE(2), 1 }, 1951 { SENSORS_MTP008_TEMP2_HYST, "temp2_hyst", SENSORS_MTP008_TEMP2, 1952 SENSORS_MTP008_TEMP2, SENSORS_MODE_RW, 1953 MTP008_SYSCTL_TEMP2, VALUE(2), 1 }, 1954 { SENSORS_MTP008_TEMP3_HYST, "temp3_hyst", SENSORS_MTP008_TEMP3, 1955 SENSORS_MTP008_TEMP3, SENSORS_MODE_RW, 1956 MTP008_SYSCTL_TEMP3, VALUE(2), 1 }, 1957 { SENSORS_MTP008_VID, "vid", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1958 SENSORS_MODE_R, MTP008_SYSCTL_VID, VALUE(1), 2 }, 1959 { SENSORS_MTP008_FAN1_DIV, "fan1_div", SENSORS_NO_MAPPING, 1960 SENSORS_NO_MAPPING, SENSORS_MODE_RW, 1961 MTP008_SYSCTL_FAN_DIV, VALUE(1), 0 }, 1962 { SENSORS_MTP008_FAN2_DIV, "fan2_div", SENSORS_NO_MAPPING, 1963 SENSORS_NO_MAPPING, SENSORS_MODE_RW, 1964 MTP008_SYSCTL_FAN_DIV, VALUE(2), 0 }, 1965 { SENSORS_MTP008_FAN3_DIV, "fan3_div", SENSORS_NO_MAPPING, 1966 SENSORS_NO_MAPPING, SENSORS_MODE_RW, 1967 MTP008_SYSCTL_FAN_DIV, VALUE(3), 0 }, 1968 { SENSORS_MTP008_ALARMS, "alarms", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1969 SENSORS_MODE_R, MTP008_SYSCTL_ALARMS, VALUE(1), 0 }, 1970 { SENSORS_MTP008_BEEP, "beeps", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING, 1971 SENSORS_MODE_R, MTP008_SYSCTL_BEEP, VALUE(1), 0 }, 1972 { 0 } 1973 }; 1974 1860 1975 sensors_chip_features sensors_chip_features_list[] = 1861 1976 { … … 1899 2014 { SENSORS_EEPROM_PREFIX, eeprom_features }, 1900 2015 { SENSORS_LM87_PREFIX, lm87_features }, 2016 { SENSORS_MTP008_PREFIX, mtp008_features }, 1901 2017 { 0 } 1902 2018 }; 1903 lm-sensors/trunk/lib/chips.h
r872 r909 855 855 #define SENSORS_LM87_ANALOG_OUT 82 /* RW */ 856 856 857 /* Myson MTP008 chips */ 858 859 #define SENSORS_MTP008_PREFIX "mtp008" 860 861 #define SENSORS_MTP008_IN0 1 /* R */ 862 #define SENSORS_MTP008_IN1 2 /* R */ 863 #define SENSORS_MTP008_IN2 3 /* R */ 864 #define SENSORS_MTP008_IN3 4 /* R */ 865 #define SENSORS_MTP008_IN4 5 /* R */ 866 #define SENSORS_MTP008_IN5 6 /* R */ 867 #define SENSORS_MTP008_IN6 7 /* R */ 868 #define SENSORS_MTP008_IN0_MIN 11 /* RW */ 869 #define SENSORS_MTP008_IN1_MIN 12 /* RW */ 870 #define SENSORS_MTP008_IN2_MIN 13 /* RW */ 871 #define SENSORS_MTP008_IN3_MIN 14 /* RW */ 872 #define SENSORS_MTP008_IN4_MIN 15 /* RW */ 873 #define SENSORS_MTP008_IN5_MIN 16 /* RW */ 874 #define SENSORS_MTP008_IN6_MIN 17 /* RW */ 875 #define SENSORS_MTP008_IN0_MAX 21 /* RW */ 876 #define SENSORS_MTP008_IN1_MAX 22 /* RW */ 877 #define SENSORS_MTP008_IN2_MAX 23 /* RW */ 878 #define SENSORS_MTP008_IN3_MAX 24 /* RW */ 879 #define SENSORS_MTP008_IN4_MAX 25 /* RW */ 880 #define SENSORS_MTP008_IN5_MAX 26 /* RW */ 881 #define SENSORS_MTP008_IN6_MAX 27 /* RW */ 882 #define SENSORS_MTP008_FAN1 31 /* R */ 883 #define SENSORS_MTP008_FAN2 32 /* R */ 884 #define SENSORS_MTP008_FAN3 33 /* R */ 885 #define SENSORS_MTP008_FAN1_MIN 41 /* RW */ 886 #define SENSORS_MTP008_FAN2_MIN 42 /* RW */ 887 #define SENSORS_MTP008_FAN3_MIN 43 /* RW */ 888 #define SENSORS_MTP008_TEMP1 51 /* R */ 889 #define SENSORS_MTP008_TEMP2 52 /* R */ 890 #define SENSORS_MTP008_TEMP3 53 /* R */ 891 #define SENSORS_MTP008_TEMP1_OVER 54 /* RW */ 892 #define SENSORS_MTP008_TEMP1_HYST 55 /* RW */ 893 #define SENSORS_MTP008_TEMP2_OVER 56 /* RW */ 894 #define SENSORS_MTP008_TEMP2_HYST 57 /* RW */ 895 #define SENSORS_MTP008_TEMP3_OVER 58 /* RW */ 896 #define SENSORS_MTP008_TEMP3_HYST 59 /* RW */ 897 #define SENSORS_MTP008_VID 61 /* R */ 898 #define SENSORS_MTP008_FAN1_DIV 71 /* RW */ 899 #define SENSORS_MTP008_FAN2_DIV 72 /* RW */ 900 #define SENSORS_MTP008_FAN3_DIV 73 /* RW */ 901 #define SENSORS_MTP008_ALARMS 81 /* R */ 902 #define SENSORS_MTP008_BEEP 82 /* RW */ 903 857 904 #endif /* def LIB_SENSORS_CHIPS_H */ lm-sensors/trunk/prog/detect/sensors-detect
r901 r909 355 355 ); 356 356 357 use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect 358 lm80_detect w83781d_detect w83781d_alias_detect adm1025_detect 359 w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect 360 adm1021_detect sis5595_isa_detect eeprom_detect via686a_isa_detect 361 adm1022_detect ltc1710_detect gl525sm_detect lm87_detect 362 ite_detect ite_isa_detect ite_alias_detect ddcmonitor_detect); 357 use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect 358 lm75_detect lm80_detect w83781d_detect w83781d_alias_detect 359 adm1025_detect w83781d_isa_detect gl518sm_detect gl520sm_detect 360 adm9240_detect adm1021_detect sis5595_isa_detect eeprom_detect 361 via686a_isa_detect adm1022_detect ltc1710_detect gl525sm_detect 362 lm87_detect ite_detect ite_isa_detect ite_alias_detect 363 ddcmonitor_detect); 363 364 364 365 # This is a list of all recognized chips. … … 386 387 # I2C bus number, and the I2C address. 387 388 @chip_ids = ( 389 { 390 name => "Myson MTP008", 391 driver => "mtp008", 392 i2c_addrs => [0x2c..0x2e], 393 i2c_detect => sub { mtp008_detect @_}, 394 } , 388 395 { 389 396 name => "National Semiconductor LM78", … … 1453 1460 1454 1461 1462 # $_[0]: A reference to the file descriptor to access this chip. 1463 # We may assume an i2c_set_slave_addr was already done. 1464 # $_[1]: Address 1465 # Returns: undef if not detected, (7) if detected. 1466 # Registers used: 0x58 1467 sub mtp008_detect 1468 { 1469 my ($file,$addr) = @_; 1470 return if (i2c_smbus_read_byte_data($file,0x58)) != 0xac; 1471 return (8); 1472 } 1473 1455 1474 # $_[0]: Chip to detect (0 = LM78, 1 = LM78-J, 2 = LM79) 1456 1475 # $_[1]: A reference to the file descriptor to access this chip. lm-sensors/trunk/prog/sensors/chips.c
r839 r909 1171 1171 print_label(label,10); 1172 1172 printf("Chassis intrusion detection ALARM\n"); 1173 } 1174 } 1175 free_the_label(&label); 1176 } 1177 1178 void print_mtp008(const sensors_chip_name *name) 1179 { 1180 char *label = NULL; 1181 double cur,min,max,fdiv; 1182 int alarms,valid; 1183 1184 if (!sensors_get_feature(*name,SENSORS_MTP008_ALARMS,&cur)) 1185 alarms = cur + 0.5; 1186 else { 1187 printf("ERROR: Can't get alarm data!\n"); 1188 alarms = 0; 1189 } 1190 1191 1192 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN0,&label,&valid) && 1193 !sensors_get_feature(*name,SENSORS_MTP008_IN0,&cur) && 1194 !sensors_get_feature(*name,SENSORS_MTP008_IN0_MIN,&min) && 1195 !sensors_get_feature(*name,SENSORS_MTP008_IN0_MAX,&max)) { 1196 if (valid) { 1197 print_label(label,10); 1198 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1199 cur,min,max,alarms&MTP008_ALARM_IN0?"ALARM":""); 1200 } 1201 } else 1202 printf("ERROR: Can't get IN0 data!\n"); 1203 free_the_label(&label); 1204 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN1,&label,&valid) && 1205 !sensors_get_feature(*name,SENSORS_MTP008_IN1,&cur) && 1206 !sensors_get_feature(*name,SENSORS_MTP008_IN1_MIN,&min) && 1207 !sensors_get_feature(*name,SENSORS_MTP008_IN1_MAX,&max)) { 1208 if (valid) { 1209 print_label(label,10); 1210 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1211 cur,min,max,alarms&MTP008_ALARM_IN1?"ALARM":""); 1212 } 1213 } else 1214 printf("ERROR: Can't get IN1 data!\n"); 1215 free_the_label(&label); 1216 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN2,&label,&valid) && 1217 !sensors_get_feature(*name,SENSORS_MTP008_IN2,&cur) && 1218 !sensors_get_feature(*name,SENSORS_MTP008_IN2_MIN,&min) && 1219 !sensors_get_feature(*name,SENSORS_MTP008_IN2_MAX,&max)) { 1220 if (valid) { 1221 print_label(label,10); 1222 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1223 cur,min,max,alarms&MTP008_ALARM_IN2?"ALARM":""); 1224 } 1225 } else 1226 printf("ERROR: Can't get IN2 data!\n"); 1227 free_the_label(&label); 1228 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN3,&label,&valid) && 1229 !sensors_get_feature(*name,SENSORS_MTP008_IN3,&cur) && 1230 !sensors_get_feature(*name,SENSORS_MTP008_IN3_MIN,&min) && 1231 !sensors_get_feature(*name,SENSORS_MTP008_IN3_MAX,&max)) { 1232 if (valid) { 1233 print_label(label,10); 1234 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1235 cur,min,max,alarms&MTP008_ALARM_IN3?"ALARM":""); 1236 } 1237 } else 1238 printf("ERROR: Can't get IN3 data!\n"); 1239 free_the_label(&label); 1240 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN4,&label,&valid) && 1241 !sensors_get_feature(*name,SENSORS_MTP008_IN4,&cur) && 1242 !sensors_get_feature(*name,SENSORS_MTP008_IN4_MIN,&min) && 1243 !sensors_get_feature(*name,SENSORS_MTP008_IN4_MAX,&max)) { 1244 if (valid) { 1245 print_label(label,10); 1246 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1247 cur,min,max,alarms&MTP008_ALARM_IN4?"ALARM":""); 1248 } 1249 } else 1250 printf("ERROR: Can't get IN4 data!\n"); 1251 free_the_label(&label); 1252 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN5,&label,&valid) && 1253 !sensors_get_feature(*name,SENSORS_MTP008_IN5,&cur) && 1254 !sensors_get_feature(*name,SENSORS_MTP008_IN5_MIN,&min) && 1255 !sensors_get_feature(*name,SENSORS_MTP008_IN5_MAX,&max)) { 1256 if (valid) { 1257 print_label(label,10); 1258 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1259 cur,min,max,alarms&MTP008_ALARM_IN5?"ALARM":""); 1260 } 1261 } else 1262 printf("ERROR: Can't get IN5 data!\n"); 1263 free_the_label(&label); 1264 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_IN6,&label,&valid) && 1265 !sensors_get_feature(*name,SENSORS_MTP008_IN6,&cur) && 1266 !sensors_get_feature(*name,SENSORS_MTP008_IN6_MIN,&min) && 1267 !sensors_get_feature(*name,SENSORS_MTP008_IN6_MAX,&max)) { 1268 if (valid) { 1269 print_label(label,10); 1270 printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n", 1271 cur,min,max,alarms&MTP008_ALARM_IN6?"ALARM":""); 1272 } 1273 } else 1274 printf("ERROR: Can't get IN6 data!\n"); 1275 free_the_label(&label); 1276 1277 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_FAN1,&label,&valid) && 1278 !sensors_get_feature(*name,SENSORS_MTP008_FAN1,&cur) && 1279 !sensors_get_feature(*name,SENSORS_MTP008_FAN1_DIV,&fdiv) && 1280 !sensors_get_feature(*name,SENSORS_MTP008_FAN1_MIN,&min)) { 1281 if (valid) { 1282 print_label(label,10); 1283 printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", 1284 cur,min,fdiv, alarms&MTP008_ALARM_FAN1?"ALARM":""); 1285 } 1286 } else 1287 printf("ERROR: Can't get FAN1 data!\n"); 1288 free_the_label(&label); 1289 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_FAN2,&label,&valid) && 1290 !sensors_get_feature(*name,SENSORS_MTP008_FAN2,&cur) && 1291 !sensors_get_feature(*name,SENSORS_MTP008_FAN2_DIV,&fdiv) && 1292 !sensors_get_feature(*name,SENSORS_MTP008_FAN2_MIN,&min)) { 1293 if (valid) { 1294 print_label(label,10); 1295 printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", 1296 cur,min,fdiv, alarms&MTP008_ALARM_FAN2?"ALARM":""); 1297 } 1298 } else 1299 printf("ERROR: Can't get FAN2 data!\n"); 1300 free_the_label(&label); 1301 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_FAN3,&label,&valid) && 1302 !sensors_get_feature(*name,SENSORS_MTP008_FAN3,&cur) && 1303 !sensors_get_feature(*name,SENSORS_MTP008_FAN3_DIV,&fdiv) && 1304 !sensors_get_feature(*name,SENSORS_MTP008_FAN3_MIN,&min)) { 1305 if (valid) { 1306 print_label(label,10); 1307 printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n", 1308 cur,min,fdiv, alarms&MTP008_ALARM_FAN3?"ALARM":""); 1309 } 1310 } else 1311 printf("ERROR: Can't get FAN3 data!\n"); 1312 free_the_label(&label); 1313 1314 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_TEMP1,&label,&valid) && 1315 !sensors_get_feature(*name,SENSORS_MTP008_TEMP1,&cur) && 1316 !sensors_get_feature(*name,SENSORS_MTP008_TEMP1_HYST,&min) && 1317 !sensors_get_feature(*name,SENSORS_MTP008_TEMP1_OVER,&max)) { 1318 if (valid) { 1319 print_label(label,10); 1320 printf("%+6.0f C (limit = %+3.0f C, hysteresis = %+3.0f C) %s\n", 1321 cur,max,min, alarms&MTP008_ALARM_TEMP1?"ALARM":""); 1322 } 1323 } else 1324 printf("ERROR: Can't get TEMP1 data!\n"); 1325 free_the_label(&label); 1326 1327 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_TEMP2,&label,&valid) && 1328 !sensors_get_feature(*name,SENSORS_MTP008_TEMP2,&cur) && 1329 !sensors_get_feature(*name,SENSORS_MTP008_TEMP2_HYST,&min) && 1330 !sensors_get_feature(*name,SENSORS_MTP008_TEMP2_OVER,&max)) { 1331 if (valid) { 1332 print_label(label,10); 1333 printf("%+6.0f C (limit = %+3.0f C, hysteresis = %+3.0f C) %s\n", 1334 cur,max,min, alarms&MTP008_ALARM_TEMP2?"ALARM":""); 1335 } 1336 } else 1337 printf("ERROR: Can't get TEMP2 data!\n"); 1338 free_the_label(&label); 1339 1340 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_TEMP3,&label,&valid) && 1341 !sensors_get_feature(*name,SENSORS_MTP008_TEMP3,&cur) && 1342 !sensors_get_feature(*name,SENSORS_MTP008_TEMP3_HYST,&min) && 1343 !sensors_get_feature(*name,SENSORS_MTP008_TEMP3_OVER,&max)) { 1344 if (valid) { 1345 print_label(label,10); 1346 printf("%+6.0f C (limit = %+3.0f C, hysteresis = %+3.0f C) %s\n", 1347 cur,max,min, alarms&MTP008_ALARM_TEMP3?"ALARM":""); 1348 } 1349 } else 1350 printf("ERROR: Can't get TEMP3 data!\n"); 1351 free_the_label(&label); 1352 1353 if (!sensors_get_label_and_valid(*name,SENSORS_MTP008_VID,&label,&valid) && 1354 !sensors_get_feature(*name,SENSORS_MTP008_VID,&cur)) { 1355 if (valid) { 1356 print_label(label,10); 1357 printf("%+6.2f V\n",cur); 1173 1358 } 1174 1359 } lm-sensors/trunk/prog/sensors/chips.h
r804 r909 25 25 extern void print_unknown_chip(const sensors_chip_name *name); 26 26 27 extern void print_mtp008(const sensors_chip_name *name); 27 28 extern void print_lm75(const sensors_chip_name *name); 28 29 extern void print_adm1021(const sensors_chip_name *name); lm-sensors/trunk/prog/sensors/main.c
r848 r909 269 269 !strcmp(name.prefix,"lm79")) 270 270 print_lm78(&name); 271 else if (!strcmp(name.prefix,"mtp008")) 272 print_mtp008(&name); 271 273 else if (!strcmp(name.prefix,"sis5595")) 272 274 print_sis5595(&name);
