Changeset 4660

Show
Ignore:
Timestamp:
08/12/07 21:39:43 (7 years ago)
Author:
khali
Message:

Add detection of the Winbond W83L786NR/NG/R/G and W83L771W/G chips.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4659 r4660  
    1010  Module lm93: Fix an array overrun (2.6 backport) 
    1111  Program sensors-detect: Don't probe i2c-isa as a regular i2c bus 
     12                          Add Winbond W83L786NR/NG/R/G detection 
     13                          Add Winbond W83L771W/G detection 
    1214 
    1315 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r4657 r4660  
    10051005     } , 
    10061006     { 
    1007        name => "Winbond W83L784R/AR", 
     1007       name => "Winbond W83L784R/AR/G", 
    10081008       driver => "to-be-written", 
    10091009       i2c_addrs => [0x2d], 
     
    10111011     } , 
    10121012     { 
    1013        name => "Winbond W83L785R", 
     1013       name => "Winbond W83L785R/G", 
    10141014       driver => "to-be-written", 
    10151015       i2c_addrs => [0x2d], 
    10161016       i2c_detect => sub { w83l784r_detect(1, @_); }, 
    10171017     } , 
     1018     { 
     1019       name => "Winbond W83L786NR/NG/R/G", 
     1020       driver => "to-be-written", 
     1021       i2c_addrs => [0x2e, 0x2f], 
     1022       i2c_detect => sub { w83l784r_detect(2, @_); }, 
     1023     }, 
    10181024     { 
    10191025       name => "Winbond W83L785TS-S", 
     
    12311237       i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e], 
    12321238       i2c_detect => sub { lm90_detect(7, @_); }, 
     1239     }, 
     1240     { 
     1241       name => "Winbond W83L771W/G", 
     1242       driver => "lm90", 
     1243       i2c_addrs => [0x4c], 
     1244       i2c_detect => sub { lm90_detect(8, @_); }, 
    12331245     }, 
    12341246     { 
     
    38393851# $_[0]: Chip to detect 
    38403852#   (0 = LM90, 1=LM89/LM99, 2=LM86, 3=ADM1032, 4=MAX6657/MAX6658/MAX6659, 
    3841 #    5 = ADT7461, 6 = MAX6648/MAX6692, 7 = MAX6680/MAX6681) 
     3853#    5 = ADT7461, 6 = MAX6648/MAX6692, 7 = MAX6680/MAX6681, 
     3854#    8 = W83L771W/G) 
    38423855# $_[1]: A reference to the file descriptor to access this chip. 
    38433856# $_[2]: Address 
     
    39123925    return if $mid != 0x4d;     # Maxim 
    39133926    return if $cid != 0x01;     # MAX6680/MAX6681 
     3927    return 6; 
     3928  } 
     3929  if ($chip == 8) { 
     3930    return if ($conf & 0x2a) != 0; 
     3931    return if $rate > 0x09; 
     3932    return if $mid != 0x5c;     # Winbond 
     3933    return if $cid != 0x00;     # W83L771W/G 
    39143934    return 6; 
    39153935  } 
     
    51175137} 
    51185138 
    5119 # $_[0]: Chip to detect (0 = W83L784R/AR, 1 = W83L785R) 
     5139# $_[0]: Chip to detect (0 = W83L784R/AR/G, 1 = W83L785R/G, 
     5140#                        2 = W83L786NR/NG/R/G) 
    51205141# $_[1]: A reference to the file descriptor to access this chip. 
    51215142# $_[2]: Address 
     
    51235144# Registers used: 
    51245145#   0x40: Configuration 
    5125 #   0x4a: Full I2C Address (not W83L785R) 
    5126 #   0x4b: I2C addresses of emulated LM75 chips (not W83L785R) 
     5146#   0x4a: Full I2C Address (W83L784R only) 
     5147#   0x4b: I2C addresses of emulated LM75 chips (W83L784R only) 
    51275148#   0x4c: Winbond Vendor ID (Low Byte) 
    51285149#   0x4d: Winbond Vendor ID (High Byte) 
    51295150#   0x4e: Chip ID 
    5130 # Note that this function is always called through a closure, so the 
    5131 # arguments are shifted by one place. 
    51325151sub w83l784r_detect 
    51335152{ 
     
    51405159  return unless i2c_smbus_read_byte_data($file,0x4c) == 0xa3; 
    51415160  return unless i2c_smbus_read_byte_data($file,0x4d) == 0x5c; 
    5142   return if $chip == 0 
    5143     and i2c_smbus_read_byte_data($file,0x4e) != 0x50; 
    5144   return if $chip == 1 
    5145     and i2c_smbus_read_byte_data($file,0x4e) != 0x60; 
    5146  
    5147   $reg = i2c_smbus_read_byte_data($file,0x4b); 
    5148  
    5149   return 6 if $chip == 1; # W83L785R doesn't have subclients 
     5161 
     5162  $reg = i2c_smbus_read_byte_data($file, 0x4e); 
     5163  return if $chip == 0 and $reg != 0x50; 
     5164  return if $chip == 1 and $reg != 0x60; 
     5165  return if $chip == 2 and $reg != 0x80; 
     5166 
     5167  return 6 if $chip != 0; # No subclients 
    51505168   
    51515169  @res = (8); 
     5170  $reg = i2c_smbus_read_byte_data($file, 0x4b); 
    51525171  push @res, ($reg & 0x07) + 0x48 unless $reg & 0x08 ; 
    51535172  push @res, (($reg & 0x70) >> 4) + 0x48 unless $reg & 0x80;