Changeset 111

Show
Ignore:
Timestamp:
12/24/98 21:29:29 (14 years ago)
Author:
frodo
Message:

prog/sensors now supports GL518SM. Please test! A configuration

entry for VDD (+5V) is added.

Location:
lm-sensors/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/etc/sensors.conf.eg

    r107 r111  
    11# Hardware sensors configuration file 
    22 
    3 # This configuration file will be used by all applcations linked to  
     3# This configuration file will be used by all applications linked to  
    44# libsensors. 
    55 
     
    120120# because one mistyped characted will inhibit the match. Wildcards are not 
    121121# yet supported; spaces at the end are ignored, though. 
     122 
     123 
     124chip "gl518sm-r00-*" "gl518sm-r80-*" 
     125 
     126# The below declaration is from the data sheet. We have no idea how these 
     127# chips are typically used. Please contact us if you own one. 
     128  label vdd "+5V" 
     129  compute vdd @ * 2.5, @ / 2.5 
  • lm-sensors/trunk/prog/sensors/chips.c

    r110 r111  
    216216    } 
    217217  } 
     218  free_the_label(&label); 
     219} 
     220 
     221void print_gl518(const sensors_chip_name *name) 
     222{ 
     223  char *label = NULL; 
     224  double cur,min,max,fdiv; 
     225  int alarms; 
     226  int is_r00; 
     227 
     228  is_r00 = !strcmp(name->prefix,"gl518sm-r00"); 
     229  if (!sensors_get_feature(*name,SENSORS_GL518R00_ALARMS,&cur))  
     230    alarms = cur + 0.5; 
     231  else { 
     232    printf("ERROR: Can't get alarm data!\n"); 
     233    alarms = 0; 
     234  } 
     235 
     236  if (!sensors_get_label(*name,SENSORS_GL518R00_VDD,&label) && 
     237      !sensors_get_feature(*name,SENSORS_GL518R00_VDD,&cur) && 
     238      !sensors_get_feature(*name,SENSORS_GL518R00_VDD_MIN,&min) && 
     239      !sensors_get_feature(*name,SENSORS_GL518R00_VDD_MAX,&max)) { 
     240    print_label(label,10); 
     241    printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     242           cur,min,max,alarms&GL518_ALARM_VDD?"ALARM":""); 
     243  } else 
     244    printf("ERROR: Can't get VDD data!\n"); 
     245  free_the_label(&label); 
     246   
     247  /* We need special treatment for the R00 chips, because they can't display 
     248     actual readings! We hardcode this, as this is the easiest way. */ 
     249  if (is_r00) { 
     250    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN1,&label) && 
     251        !sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MIN,&min) && 
     252        !sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MAX,&max)) { 
     253      print_label(label,10); 
     254      printf("          (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     255             min,max,alarms&GL518_ALARM_VIN1?"ALARM":""); 
     256    } else 
     257      printf("ERROR: Can't get VIN1 data!\n"); 
     258    free_the_label(&label); 
     259 
     260    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN2,&label) && 
     261        !sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MIN,&min) && 
     262        !sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MAX,&max)) { 
     263      print_label(label,10); 
     264      printf("          (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     265             min,max,alarms&GL518_ALARM_VIN2?"ALARM":""); 
     266    } else 
     267      printf("ERROR: Can't get VIN2 data!\n"); 
     268    free_the_label(&label); 
     269    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN3,&label) && 
     270        !sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MIN,&min) && 
     271        !sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MAX,&max)) { 
     272      print_label(label,10); 
     273      printf("          (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     274               min,max,alarms&GL518_ALARM_VIN3?"ALARM":""); 
     275    } else 
     276      printf("ERROR: Can't get IN3 data!\n"); 
     277    free_the_label(&label); 
     278  } else { 
     279    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN1,&label) && 
     280        !sensors_get_feature(*name,SENSORS_GL518R00_VIN1,&cur) && 
     281        !sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MIN,&min) && 
     282        !sensors_get_feature(*name,SENSORS_GL518R00_VIN1_MAX,&max)) { 
     283      print_label(label,10); 
     284      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     285             cur,min,max,alarms&GL518_ALARM_VIN1?"ALARM":""); 
     286    } else 
     287      printf("ERROR: Can't get VIN1 data!\n"); 
     288    free_the_label(&label); 
     289    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN2,&label) && 
     290        !sensors_get_feature(*name,SENSORS_GL518R00_VIN2,&cur) && 
     291        !sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MIN,&min) && 
     292        !sensors_get_feature(*name,SENSORS_GL518R00_VIN2_MAX,&max)) { 
     293      print_label(label,10); 
     294      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     295             cur,min,max,alarms&GL518_ALARM_VIN2?"ALARM":""); 
     296    } else 
     297      printf("ERROR: Can't get VIN2 data!\n"); 
     298    free_the_label(&label); 
     299    if (!sensors_get_label(*name,SENSORS_GL518R00_VIN3,&label) && 
     300        !sensors_get_feature(*name,SENSORS_GL518R00_VIN3,&cur) && 
     301        !sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MIN,&min) && 
     302        !sensors_get_feature(*name,SENSORS_GL518R00_VIN3_MAX,&max)) { 
     303      print_label(label,10); 
     304      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)   %s\n", 
     305             cur,min,max,alarms&GL518_ALARM_VIN3?"ALARM":""); 
     306    } else 
     307      printf("ERROR: Can't get IN3 data!\n"); 
     308    free_the_label(&label); 
     309  } 
     310 
     311  if (!sensors_get_label(*name,SENSORS_GL518R00_FAN1,&label) && 
     312      !sensors_get_feature(*name,SENSORS_GL518R00_FAN1,&cur) && 
     313      !sensors_get_feature(*name,SENSORS_GL518R00_FAN1_DIV,&fdiv) && 
     314      !sensors_get_feature(*name,SENSORS_GL518R00_FAN1_MIN,&min)) { 
     315    print_label(label,10); 
     316    printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)          %s\n", 
     317           cur,min,fdiv, alarms&GL518_ALARM_FAN1?"ALARM":""); 
     318  } else 
     319    printf("ERROR: Can't get FAN1 data!\n"); 
     320  free_the_label(&label); 
     321  if (!sensors_get_label(*name,SENSORS_GL518R00_FAN2,&label) && 
     322      !sensors_get_feature(*name,SENSORS_GL518R00_FAN2,&cur) && 
     323      !sensors_get_feature(*name,SENSORS_GL518R00_FAN2_DIV,&fdiv) && 
     324      !sensors_get_feature(*name,SENSORS_GL518R00_FAN2_MIN,&min)) { 
     325    print_label(label,10); 
     326    printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)          %s\n", 
     327           cur,min,fdiv, alarms&GL518_ALARM_FAN2?"ALARM":""); 
     328  } else 
     329    printf("ERROR: Can't get FAN2 data!\n"); 
     330  free_the_label(&label); 
     331 
     332  if (!sensors_get_label(*name,SENSORS_GL518R00_TEMP,&label) && 
     333      !sensors_get_feature(*name,SENSORS_GL518R00_TEMP,&cur) && 
     334      !sensors_get_feature(*name,SENSORS_GL518R00_TEMP_HYST,&min) && 
     335      !sensors_get_feature(*name,SENSORS_GL518R00_TEMP_OVER,&max)) { 
     336    print_label(label,10); 
     337    printf("%+3.0f C     (limit = %+3.0f C,  hysteris = %+3.0f C) %s\n", 
     338           cur,max,min, alarms&GL518_ALARM_TEMP?"ALARM":""); 
     339  } else 
     340    printf("ERROR: Can't get TEMP data!\n"); 
    218341  free_the_label(&label); 
    219342} 
  • lm-sensors/trunk/prog/sensors/chips.h

    r110 r111  
    2727extern void print_lm75(const sensors_chip_name *name); 
    2828extern void print_lm78(const sensors_chip_name *name); 
     29extern void print_gl518(const sensors_chip_name *name); 
    2930 
    3031#endif /* def PROG_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/sensors/main.c

    r110 r111  
    185185             !strcmp(chip->prefix,"lm79")) 
    186186      print_lm78(chip); 
     187    else if (!strcmp(chip->prefix,"gl518sm-r00") ||  
     188             !strcmp(chip->prefix,"gl518sm-r80")) 
     189      print_gl518(chip); 
    187190    else 
    188191      print_unknown_chip(chip);