2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

add smsc47m1 to library and 'sensors'

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1428 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker
2002-07-07 16:41:23 +00:00
parent 248547cefb
commit 887ace586d
6 changed files with 84 additions and 0 deletions

View File

@@ -3269,6 +3269,47 @@ void print_vt1211(const sensors_chip_name *name)
}
void print_smsc47m1(const sensors_chip_name *name)
{
char *label = NULL;
double cur,min,fdiv;
int alarms,valid;
if (!sensors_get_feature(*name,SENSORS_SMSC47M1_ALARMS,&cur))
alarms = cur + 0.5;
else {
printf("ERROR: Can't get alarm data!\n");
alarms = 0;
}
if (!sensors_get_label_and_valid(*name,SENSORS_SMSC47M1_FAN1,&label,&valid) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN1,&cur) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN1_DIV,&fdiv) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN1_MIN,&min)) {
if (valid) {
print_label(label,10);
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n",
cur,min,fdiv, alarms&SMSC47M1_ALARM_FAN1?"ALARM":"");
}
} else
printf("ERROR: Can't get FAN1 data!\n");
free_the_label(&label);
if (!sensors_get_label_and_valid(*name,SENSORS_SMSC47M1_FAN2,&label,&valid) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN2,&cur) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN2_DIV,&fdiv) &&
!sensors_get_feature(*name,SENSORS_SMSC47M1_FAN2_MIN,&min)) {
if (valid) {
print_label(label,10);
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n",
cur,min,fdiv, alarms&SMSC47M1_ALARM_FAN2?"ALARM":"");
}
} else
printf("ERROR: Can't get FAN2 data!\n");
free_the_label(&label);
}
void print_unknown_chip(const sensors_chip_name *name)
{
int a,b,valid;