Changeset 4096

Show
Ignore:
Timestamp:
08/18/06 18:06:55 (7 years ago)
Author:
khali
Message:

Enhance w83791d support. Add output for in7, in8, in9, fan4 and fan5.
Also update to display the (beep) properly due to the fact that the
w83791d beep enable mask is different than the alarm mask.
Patch from Sven Anders and Charles Spirakis.

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4089 r4096  
    3131  Module lm83: Add LM82 support (2.6 backport) 
    3232  Module w83781d: Use real-time alarm registers when possible (2.6 backport) 
     33                  Add specific alarm and beep defines for the W83791D 
    3334  Module w83792d: Fix PWM range (2.6 backport) 
    3435  Program decode-dimms.pl: Decode depending on the memory type 
     
    4849                   Add it8716 and it8718 support 
    4950                   Make each it87 fan and fan div optional 
     51                   Print missing w83791d values 
    5052  Program sensors-detect: Add ServerWorks HT-1000 SMBus detection 
    5153                          Add ATI IXP200/300/400 SMBus detection 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r3260 r4096  
    136136#define W83781D_REG_PIN 0x4B 
    137137 
    138 /* 782D/783S only */ 
     138/* 782D/783S/791D only */ 
    139139#define W83781D_REG_VBAT 0x5D 
    140140 
     
    388388#define W83782D_ALARM_IN7 0x10000 
    389389#define W83782D_ALARM_IN8 0x20000 
     390#define W83791D_ALARM_IN7 0x080000      /* 791D only */ 
     391#define W83791D_ALARM_IN8 0x100000      /* 791D only */ 
     392#define W83791D_ALARM_IN9 0x004000      /* 791D only */ 
    390393#define W83781D_ALARM_FAN1 0x0040 
    391394#define W83781D_ALARM_FAN2 0x0080 
    392395#define W83781D_ALARM_FAN3 0x0800 
     396#define W83791D_ALARM_FAN4 0x200000     /* 791D only */ 
     397#define W83791D_ALARM_FAN5 0x400000     /* 791D only */ 
    393398#define W83781D_ALARM_TEMP1 0x0010 
    394399#define W83781D_ALARM_TEMP23 0x0020     /* 781D only */ 
    395 #define W83781D_ALARM_TEMP2 0x0020      /* 782D/783S */ 
    396 #define W83781D_ALARM_TEMP3 0x2000      /* 782D only */ 
    397 #define W83781D_ALARM_CHAS 0x1000 
     400#define W83781D_ALARM_TEMP2 0x0020      /* 782D/783S/791D */ 
     401#define W83781D_ALARM_TEMP3 0x2000      /* 782D/791D */ 
     402#define W83781D_ALARM_CHAS 0x1000       /* 782D/791D */ 
     403 
     404#define W83791D_BEEP_IN1 0x002000       /* 791D only */ 
     405#define W83791D_BEEP_IN7 0x010000       /* 791D only */ 
     406#define W83791D_BEEP_IN8 0x020000       /* 791D only */ 
     407#define W83791D_BEEP_TEMP3 0x000002     /* 791D only */ 
    398408 
    399409/* -- SENSORS SYSCTL END -- */ 
  • lm-sensors/trunk/prog/sensors/chips.c

    r4095 r4096  
    21882188  double cur,min,max,fdiv,sens; 
    21892189  int alarms,beeps; 
    2190   int is81d, is82d, is83s, is697hf, is627thf, valid; 
     2190  int beep_mask; 
     2191  int is81d, is82d, is83s, is91d, is697hf, is627thf, valid; 
    21912192 
    21922193  is81d = !strcmp(name->prefix,"w83781d"); 
     
    21972198          (!strcmp(name->prefix, "w83687thf")); 
    21982199  is83s = !strcmp(name->prefix,"w83783s"); 
     2200  is91d = !strcmp(name->prefix,"w83791d"); 
    21992201  is627thf = (!strcmp(name->prefix,"w83627thf")) || 
    22002202             (!strcmp(name->prefix, "w83637hf")) || 
     
    22352237        !sensors_get_feature(*name,SENSORS_W83781D_IN1_MAX,&max)) { 
    22362238      if (valid) { 
     2239        /* for the w83791d, beep mask is different than the alarm mask */ 
     2240        if (is91d) 
     2241          beep_mask = W83791D_BEEP_IN1; 
     2242        else 
     2243          beep_mask = W83781D_ALARM_IN1; 
     2244 
    22372245        print_label(label,10); 
    22382246        printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
    22392247             cur,min,max,alarms&W83781D_ALARM_IN1?"ALARM":"     ", 
    2240              beeps&W83781D_ALARM_IN1?"(beep)":""); 
     2248             beeps&beep_mask?"(beep)":""); 
    22412249      } 
    22422250    } else 
     
    23402348  } 
    23412349 
     2350  if (is91d) { 
     2351    if (!sensors_get_label_and_valid(*name,SENSORS_W83791D_IN7,&label,&valid) && 
     2352        !sensors_get_feature(*name,SENSORS_W83791D_IN7,&cur) && 
     2353        !sensors_get_feature(*name,SENSORS_W83791D_IN7_MIN,&min) && 
     2354        !sensors_get_feature(*name,SENSORS_W83791D_IN7_MAX,&max)) { 
     2355      if (valid) { 
     2356        print_label(label,10); 
     2357        printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
     2358             cur,min,max,alarms&W83791D_ALARM_IN7?"ALARM":"     ", 
     2359             beeps&W83791D_BEEP_IN7?"(beep)":""); 
     2360      } 
     2361    } else 
     2362      printf("ERROR: Can't get IN7 data!\n"); 
     2363    free(label); 
     2364    if (!sensors_get_label_and_valid(*name,SENSORS_W83791D_IN8,&label,&valid) && 
     2365        !sensors_get_feature(*name,SENSORS_W83791D_IN8,&cur) && 
     2366        !sensors_get_feature(*name,SENSORS_W83791D_IN8_MIN,&min) && 
     2367        !sensors_get_feature(*name,SENSORS_W83791D_IN8_MAX,&max)) { 
     2368      if (valid) { 
     2369        print_label(label,10); 
     2370        printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
     2371             cur,min,max,alarms&W83791D_ALARM_IN8?"ALARM":"     ", 
     2372             beeps&W83791D_BEEP_IN8?"(beep)":""); 
     2373      } 
     2374    } else 
     2375      printf("ERROR: Can't get IN8 data!\n"); 
     2376    free(label); 
     2377    if (!sensors_get_label_and_valid(*name,SENSORS_W83791D_IN9,&label,&valid) && 
     2378        !sensors_get_feature(*name,SENSORS_W83791D_IN9,&cur) && 
     2379        !sensors_get_feature(*name,SENSORS_W83791D_IN9_MIN,&min) && 
     2380        !sensors_get_feature(*name,SENSORS_W83791D_IN9_MAX,&max)) { 
     2381      if (valid) { 
     2382        print_label(label,10); 
     2383        printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
     2384             cur,min,max,alarms&W83791D_ALARM_IN9?"ALARM":"     ", 
     2385             beeps&W83791D_ALARM_IN9?"(beep)":""); 
     2386      } 
     2387    } else 
     2388      printf("ERROR: Can't get IN9 data!\n"); 
     2389    free(label); 
     2390  } 
     2391 
    23422392  if (!sensors_get_label_and_valid(*name,SENSORS_W83781D_FAN1,&label,&valid) && 
    23432393      !sensors_get_feature(*name,SENSORS_W83781D_FAN1,&cur) && 
     
    23802430    } else 
    23812431      printf("ERROR: Can't get FAN3 data!\n"); 
     2432    free(label); 
     2433  } 
     2434 
     2435  if(is91d) { 
     2436    if (!sensors_get_label_and_valid(*name,SENSORS_W83791D_FAN4,&label,&valid) && 
     2437        !sensors_get_feature(*name,SENSORS_W83791D_FAN4,&cur) && 
     2438        !sensors_get_feature(*name,SENSORS_W83791D_FAN4_DIV,&fdiv) && 
     2439        !sensors_get_feature(*name,SENSORS_W83791D_FAN4_MIN,&min)) { 
     2440      if (valid) { 
     2441        print_label(label,10); 
     2442        printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)              %s  %s\n", 
     2443             cur,min,fdiv, alarms&W83791D_ALARM_FAN4?"ALARM":"     ", 
     2444             beeps&W83791D_ALARM_FAN4?"(beep)":""); 
     2445      } 
     2446    } else 
     2447      printf("ERROR: Can't get FAN4 data!\n"); 
     2448    free(label); 
     2449    if (!sensors_get_label_and_valid(*name,SENSORS_W83791D_FAN5,&label,&valid) && 
     2450        !sensors_get_feature(*name,SENSORS_W83791D_FAN5,&cur) && 
     2451        !sensors_get_feature(*name,SENSORS_W83791D_FAN5_DIV,&fdiv) && 
     2452        !sensors_get_feature(*name,SENSORS_W83791D_FAN5_MIN,&min)) { 
     2453      if (valid) { 
     2454        print_label(label,10); 
     2455        printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)              %s  %s\n", 
     2456             cur,min,fdiv, alarms&W83791D_ALARM_FAN5?"ALARM":"     ", 
     2457             beeps&W83791D_ALARM_FAN5?"(beep)":""); 
     2458      } 
     2459    } else 
     2460      printf("ERROR: Can't get FAN5 data!\n"); 
    23822461    free(label); 
    23832462  } 
     
    24542533          print_label(label,10); 
    24552534          print_temp_info( cur, max, min, HYST, 1, 0); 
    2456           if (!is81d) 
     2535          if (!is81d) { 
     2536            /* for the w83791d, beep mask is different than the alarm mask */ 
     2537            if (is91d) 
     2538              beep_mask = W83791D_BEEP_TEMP3; 
     2539            else 
     2540              beep_mask = W83781D_ALARM_TEMP3; 
    24572541            printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP3?"ALARM":"     ", 
    2458                    beeps&W83781D_ALARM_TEMP3?"(beep)":""); 
    2459           else 
     2542                   beeps&beep_mask?"(beep)":""); 
     2543          } else 
    24602544            printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP23?"ALARM":"     ", 
    24612545                   beeps&W83781D_ALARM_TEMP23?"(beep)":"");