Changeset 313

Show
Ignore:
Timestamp:
03/14/99 05:09:35 (15 years ago)
Author:
mds
Message:

added fan3 for 782d, didn't realize it is just like 781d.
removed in1 and added in6 for 783s to keep compatibility
with 781d/782d. So 783s has no in1. sorry.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r309 r313  
    2626    Chip        #vin    #fanin  #pwm    #temp   wchipid i2c     ISA 
    2727    w83781d     7       3       0       3       0x10    yes     yes 
    28     w83782d     9       2-3     2-4     3       0x30    yes     yes 
     28    w83782d     9       3       2-4     3       0x30    yes     yes 
    2929    w83783s     5-6     3       2       1-2     0x40    yes     no 
    3030 
    31     To do: PWM enable, clock, duty cycle 
    32            782d beep 3 register 
    33            782d programmable pins 
    34            783s pin programmable for vin or temp. assume both now! no way to set. 
     31    To do: 
     32     782d/783s PWM enable, clock select, duty cycle 
     33     782d beep 3 register 
     34     782d programmable pins 
     35     783s pin is programmable for -5V or temp1; defaults to -5V, 
     36          no control in driver so temp1 doesn't work. 
     37     783s temp2 (labeled as temp1 in data sheet) at different location 
     38          than 781d/782d, not implemented yet. 
    3539*/ 
    3640 
     
    411415  { W83781D_SYSCTL_FAN2, "fan2", NULL, 0, 0644, NULL, &sensors_proc_real, 
    412416    &sensors_sysctl_real, NULL, &w83781d_fan }, 
     417  { W83781D_SYSCTL_FAN3, "fan3", NULL, 0, 0644, NULL, &sensors_proc_real, 
     418    &sensors_sysctl_real, NULL, &w83781d_fan }, 
    413419  { W83781D_SYSCTL_TEMP1, "temp1", NULL, 0, 0644, NULL, &sensors_proc_real, 
    414420    &sensors_sysctl_real, NULL, &w83781d_temp }, 
     
    431437  { W83781D_SYSCTL_IN0, "in0", NULL, 0, 0644, NULL, &sensors_proc_real, 
    432438    &sensors_sysctl_real, NULL, &w83781d_in }, 
    433   { W83781D_SYSCTL_IN1, "in1", NULL, 0, 0644, NULL, &sensors_proc_real, 
    434     &sensors_sysctl_real, NULL, &w83781d_in }, 
     439  /* no in1 to maintain compatibility with 781d and 782d. */ 
    435440  { W83781D_SYSCTL_IN2, "in2", NULL, 0, 0644, NULL, &sensors_proc_real, 
    436441    &sensors_sysctl_real, NULL, &w83781d_in }, 
     
    440445    &sensors_sysctl_real, NULL, &w83781d_in }, 
    441446  { W83781D_SYSCTL_IN5, "in5", NULL, 0, 0644, NULL, &sensors_proc_real, 
     447    &sensors_sysctl_real, NULL, &w83781d_in }, 
     448  { W83781D_SYSCTL_IN6, "in6", NULL, 0, 0644, NULL, &sensors_proc_real, 
    442449    &sensors_sysctl_real, NULL, &w83781d_in }, 
    443450  { W83781D_SYSCTL_FAN1, "fan1", NULL, 0, 0644, NULL, &sensors_proc_real, 
     
    971978  w83781d_write_value(client,W83781D_REG_FAN_MIN(2), 
    972979                      FAN_TO_REG(W83781D_INIT_FAN_MIN_2,2)); 
    973   if(wchipid != W83782D_WCHIPID) { 
    974     w83781d_write_value(client,W83781D_REG_FAN_MIN(3), 
    975                         FAN_TO_REG(W83781D_INIT_FAN_MIN_3,2)); 
    976   } 
     980  w83781d_write_value(client,W83781D_REG_FAN_MIN(3), 
     981                      FAN_TO_REG(W83781D_INIT_FAN_MIN_3,2)); 
    977982 
    978983  w83781d_write_value(client,W83781D_REG_TEMP_OVER, 
     
    10161021#endif 
    10171022    for (i = 0; i <= 8; i++) { 
     1023      if(data->wchipid == W83783S_WCHIPID  &&  i == 1) 
     1024        continue; /* 783S has no in1 */ 
    10181025      data->in[i]     = w83781d_read_value(client,W83781D_REG_IN(i)); 
    10191026      data->in_min[i] = w83781d_read_value(client,W83781D_REG_IN_MIN(i)); 
    10201027      data->in_max[i] = w83781d_read_value(client,W83781D_REG_IN_MAX(i)); 
    1021       if((data->wchipid == W83783S_WCHIPID  &&  i == 5) || 
    1022          (data->wchipid == W83781D_WCHIPID  &&  i == 6)) 
     1028      if(data->wchipid != W83782D_WCHIPID  &&  i == 6) 
    10231029        break; 
    10241030    } 
     
    10261032      data->fan[i-1] = w83781d_read_value(client,W83781D_REG_FAN(i)); 
    10271033      data->fan_min[i-1] = w83781d_read_value(client,W83781D_REG_FAN_MIN(i)); 
    1028       if(data->wchipid == W83783S_WCHIPID  &&  i == 2) 
    1029         break; 
    10301034    } 
    10311035    data->temp = w83781d_read_value(client,W83781D_REG_TEMP); 
  • lm-sensors/trunk/prog/sensors/chips.c

    r311 r313  
    562562    printf("ERROR: Can't get IN0 data!\n"); 
    563563  free_the_label(&label); 
    564   if (!sensors_get_label(*name,SENSORS_W83781D_IN1,&label) && 
    565       !sensors_get_feature(*name,SENSORS_W83781D_IN1,&cur) && 
    566       !sensors_get_feature(*name,SENSORS_W83781D_IN1_MIN,&min) && 
    567       !sensors_get_feature(*name,SENSORS_W83781D_IN1_MAX,&max)) { 
    568     print_label(label,10); 
    569     printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
    570            cur,min,max,alarms&W83781D_ALARM_IN1?"ALARM":"     ", 
    571            beeps&W83781D_ALARM_IN1?"(beep)":""); 
    572   } else 
    573     printf("ERROR: Can't get IN1 data!\n"); 
    574   free_the_label(&label); 
     564  if (!is83s) { 
     565    if (!sensors_get_label(*name,SENSORS_W83781D_IN1,&label) && 
     566        !sensors_get_feature(*name,SENSORS_W83781D_IN1,&cur) && 
     567        !sensors_get_feature(*name,SENSORS_W83781D_IN1_MIN,&min) && 
     568        !sensors_get_feature(*name,SENSORS_W83781D_IN1_MAX,&max)) { 
     569      print_label(label,10); 
     570      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)       %s  %s\n", 
     571             cur,min,max,alarms&W83781D_ALARM_IN1?"ALARM":"     ", 
     572             beeps&W83781D_ALARM_IN1?"(beep)":""); 
     573    } else 
     574      printf("ERROR: Can't get IN1 data!\n"); 
     575    free_the_label(&label); 
     576  } 
    575577  if (!sensors_get_label(*name,SENSORS_W83781D_IN2,&label) && 
    576578      !sensors_get_feature(*name,SENSORS_W83781D_IN2,&cur) && 
     
    677679    printf("ERROR: Can't get FAN2 data!\n"); 
    678680  free_the_label(&label); 
    679   if (!is82d) { 
    680     if (!sensors_get_label(*name,SENSORS_W83781D_FAN3,&label) && 
    681         !sensors_get_feature(*name,SENSORS_W83781D_FAN3,&cur) && 
    682         !sensors_get_feature(*name,SENSORS_W83781D_FAN3_DIV,&fdiv) && 
    683         !sensors_get_feature(*name,SENSORS_W83781D_FAN3_MIN,&min)) { 
    684       print_label(label,10); 
    685       printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)              %s  %s\n", 
    686              cur,min,fdiv, alarms&W83781D_ALARM_FAN3?"ALARM":"     ", 
    687              beeps&W83781D_ALARM_FAN3?"(beep)":""); 
    688     } else 
    689       printf("ERROR: Can't get FAN3 data!\n"); 
    690   } 
     681  if (!sensors_get_label(*name,SENSORS_W83781D_FAN3,&label) && 
     682      !sensors_get_feature(*name,SENSORS_W83781D_FAN3,&cur) && 
     683      !sensors_get_feature(*name,SENSORS_W83781D_FAN3_DIV,&fdiv) && 
     684      !sensors_get_feature(*name,SENSORS_W83781D_FAN3_MIN,&min)) { 
     685    print_label(label,10); 
     686    printf("%4.0f RPM  (min = %4.0f RPM, div = %1.0f)              %s  %s\n", 
     687           cur,min,fdiv, alarms&W83781D_ALARM_FAN3?"ALARM":"     ", 
     688           beeps&W83781D_ALARM_FAN3?"(beep)":""); 
     689  } else 
     690    printf("ERROR: Can't get FAN3 data!\n"); 
    691691  free_the_label(&label); 
    692692