diff --git a/CHANGES b/CHANGES index b8549ad6..05a4ef02 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ lm_sensors CHANGES file ----------------------- SVN HEAD + Library: Add support for the pc87247 driver (fans only) + Program sensord: Add pc87247 support (fans only) + Program sensors: Add pc87247 support (fans only) Program sensors-detect: Add SMSC DME1737 detection Add EPoX EP1308 detection (Hans Edgington) diff --git a/lib/chips.c b/lib/chips.c index cbbc8964..5cee2888 100644 --- a/lib/chips.c +++ b/lib/chips.c @@ -5193,6 +5193,99 @@ static sensors_chip_feature pc87365_features[] = { 0 } }; +static sensors_chip_feature pc87427_features[] = + { + { SENSORS_PC87427_FAN(1), "fan1", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(2), "fan2", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(3), "fan3", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(4), "fan4", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(5), "fan5", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(6), "fan6", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(7), "fan7", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN(8), "fan8", NOMAP, NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_MIN(1), "fan1_min", + SENSORS_PC87427_FAN(1), SENSORS_PC87427_FAN(1), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(2), "fan2_min", + SENSORS_PC87427_FAN(2), SENSORS_PC87427_FAN(2), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(3), "fan3_min", + SENSORS_PC87427_FAN(3), SENSORS_PC87427_FAN(3), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(4), "fan4_min", + SENSORS_PC87427_FAN(4), SENSORS_PC87427_FAN(4), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(5), "fan5_min", + SENSORS_PC87427_FAN(5), SENSORS_PC87427_FAN(5), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(6), "fan6_min", + SENSORS_PC87427_FAN(6), SENSORS_PC87427_FAN(6), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(7), "fan7_min", + SENSORS_PC87427_FAN(7), SENSORS_PC87427_FAN(7), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_MIN(8), "fan8_min", + SENSORS_PC87427_FAN(8), SENSORS_PC87427_FAN(8), RW, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(1), "fan1_alarm", + SENSORS_PC87427_FAN(1), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(2), "fan2_alarm", + SENSORS_PC87427_FAN(2), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(3), "fan3_alarm", + SENSORS_PC87427_FAN(3), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(4), "fan4_alarm", + SENSORS_PC87427_FAN(4), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(5), "fan5_alarm", + SENSORS_PC87427_FAN(5), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(6), "fan6_alarm", + SENSORS_PC87427_FAN(6), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(7), "fan7_alarm", + SENSORS_PC87427_FAN(7), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_ALARM(8), "fan8_alarm", + SENSORS_PC87427_FAN(8), NOMAP, R, + NOSYSCTL, VALUE(1), 0 }, + { SENSORS_PC87427_FAN_FAULT(1), "fan1_fault", + SENSORS_PC87427_FAN(1), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(2), "fan2_fault", + SENSORS_PC87427_FAN(2), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(3), "fan3_fault", + SENSORS_PC87427_FAN(3), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(4), "fan4_fault", + SENSORS_PC87427_FAN(4), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(5), "fan5_fault", + SENSORS_PC87427_FAN(5), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(6), "fan6_fault", + SENSORS_PC87427_FAN(6), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(7), "fan7_fault", + SENSORS_PC87427_FAN(7), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { SENSORS_PC87427_FAN_FAULT(8), "fan8_fault", + SENSORS_PC87427_FAN(8), NOMAP, R, + NOSYSCTL, VALUE(2), 0 }, + { 0 } + }; + static sensors_chip_feature lm92_features[] = { { SENSORS_LM92_TEMP, "temp", NOMAP, NOMAP, @@ -6014,6 +6107,7 @@ sensors_chip_features sensors_chip_features_list[] = { SENSORS_PC87364_PREFIX, pc87360_features }, { SENSORS_PC87365_PREFIX, pc87365_features }, { SENSORS_PC87366_PREFIX, pc87365_features }, + { SENSORS_PC87427_PREFIX, pc87427_features }, { SENSORS_LM92_PREFIX, lm92_features }, { SENSORS_VT8231_PREFIX, vt8231_features }, { SENSORS_BMC_PREFIX, bmc_features }, diff --git a/lib/chips.h b/lib/chips.h index 8d5cf9f3..f9e94d23 100644 --- a/lib/chips.h +++ b/lib/chips.h @@ -1933,6 +1933,14 @@ #define SENSORS_PC87360_VID 240 /* R */ #define SENSORS_PC87360_VRM 241 /* RW */ +#define SENSORS_PC87427_PREFIX "pc87427" + +/* fan n from 1 to 8 */ +#define SENSORS_PC87427_FAN(n) (n) /* R */ +#define SENSORS_PC87427_FAN_MIN(n) (16 + (n)) /* RW */ +#define SENSORS_PC87427_FAN_ALARM(n) (32 + (n)) /* R */ +#define SENSORS_PC87427_FAN_FAULT(n) (48 + (n)) /* R */ + #define SENSORS_LM92_PREFIX "lm92" #define SENSORS_LM92_TEMP_HIGH 1 /* RW */ diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 75f16ff1..e979496c 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1643,7 +1643,7 @@ $chip_kern26_w83791d = { }, { name => "Nat. Semi. PC87427 Super IO Fan Sensors", - driver => "to-be-written", + driver => "pc87427", devid => 0xf2, logdev => 0x09, }, diff --git a/prog/sensord/chips.c b/prog/sensord/chips.c index 0bb726b4..a51a8ebc 100644 --- a/prog/sensord/chips.c +++ b/prog/sensord/chips.c @@ -117,6 +117,13 @@ fmtFans_0 return fmtExtra (alarm, beep); } +static const char * +fmtFans_nodiv_0 +(const double values[], int alarm, int beep) { + sprintf (buff, "%.0f RPM (min = %.0f RPM)", values[0], values[1]); + return fmtExtra (alarm, beep); +} + static const char * fmtMHz_2 (const double values[], int alarm, int beep) { @@ -1093,6 +1100,37 @@ static const ChipDescriptor pc87360_chip = { pc87360_names, pc87360_features, SENSORS_PC87360_ALARMS_TEMP, 0 }; +/** PC87427 **/ + +static const char *pc87427_names[] = { + SENSORS_PC87427_PREFIX, + NULL +}; + +static const FeatureDescriptor pc87427_features[] = { + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(1), SENSORS_PC87427_FAN_MIN(1), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(2), SENSORS_PC87427_FAN_MIN(2), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(3), SENSORS_PC87427_FAN_MIN(3), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(4), SENSORS_PC87427_FAN_MIN(4), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(5), SENSORS_PC87427_FAN_MIN(5), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(6), SENSORS_PC87427_FAN_MIN(6), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(7), SENSORS_PC87427_FAN_MIN(7), -1, -1 } }, + { fmtFans_nodiv_0, rrdF0, DataType_rpm, 0, 0, + { SENSORS_PC87427_FAN(8), SENSORS_PC87427_FAN_MIN(8), -1, -1 } }, + { NULL } +}; + +static const ChipDescriptor pc87427_chip = { + pc87427_names, pc87427_features, 0, 0 +}; + /** W83627EHF **/ static const char *w83627ehf_names[] = { @@ -1191,6 +1229,7 @@ const ChipDescriptor * const knownChips[] = { &it87_chip, &asb100_chip, &pc87360_chip, + &pc87427_chip, &w83627ehf_chip, &f71805f_chip, NULL diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 489b2842..69ccd730 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -4810,6 +4810,30 @@ void print_pc87366(const sensors_chip_name *name) print_vid_info(name, SENSORS_PC87360_VID, SENSORS_PC87360_VRM); } +void print_pc87427(const sensors_chip_name *name) +{ + char *label; + double cur, min, alarm, fault; + int valid, i; + + for (i = 1; i <= 8; i++) { + if (!sensors_get_label_and_valid(*name, SENSORS_PC87427_FAN(i), + &label, &valid) && + !sensors_get_feature(*name, SENSORS_PC87427_FAN(i), &cur) && + !sensors_get_feature(*name, SENSORS_PC87427_FAN_MIN(i), &min) && + !sensors_get_feature(*name, SENSORS_PC87427_FAN_ALARM(i), &alarm) && + !sensors_get_feature(*name, SENSORS_PC87427_FAN_FAULT(i), &fault)) { + if (valid) { + print_label(label, 10); + printf("%4.0f RPM (min = %4.0f RPM) %s\n", + cur, min, + fault ? "FAULT" : alarm ? "ALARM" : ""); + } + } + } + free(label); +} + static void lm92_print_temp (float n_cur,float n_high,float n_low,float n_crit,float n_hyst) { if (fahrenheit) { diff --git a/prog/sensors/chips.h b/prog/sensors/chips.h index 3577efed..603a5550 100644 --- a/prog/sensors/chips.h +++ b/prog/sensors/chips.h @@ -60,6 +60,7 @@ extern void print_smsc47m192(const sensors_chip_name *name); extern void print_pc87360(const sensors_chip_name *name); extern void print_pc87364(const sensors_chip_name *name); extern void print_pc87366(const sensors_chip_name *name); +extern void print_pc87427(const sensors_chip_name *name); extern void print_lm92(const sensors_chip_name *name); extern void print_vt8231(const sensors_chip_name *name); extern void print_bmc(const sensors_chip_name *name); diff --git a/prog/sensors/main.c b/prog/sensors/main.c index c32e378b..e8a4c54e 100644 --- a/prog/sensors/main.c +++ b/prog/sensors/main.c @@ -402,6 +402,7 @@ struct match matches[] = { { "pc87364", print_pc87364 }, { "pc87365", print_pc87366 }, { "pc87366", print_pc87366 }, + { "pc87427", print_pc87427 }, { "lm92", print_lm92 }, { "vt8231", print_vt8231 }, { "bmc", print_bmc },