Changeset 540

Show
Ignore:
Timestamp:
08/28/99 21:10:27 (15 years ago)
Author:
mds
Message:

(mds) Added adm1022/thmc50 detection. Confidence 8. No driver though.

Changed adm9240 confidence from 8 to 7 to let adm1022 win,
not sure about register 0x3F in adm1022.
Removed 0x69 from i2c range on all drivers, that address
looks entrenched for clock chips.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r533 r540  
    124124            lm80_detect w83781d_detect w83781d_alias_detect 
    125125            w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect  
    126             adm1021_detect sis5595_isa_detect eeprom_detect ltc1710_detect); 
     126            adm1021_detect sis5595_isa_detect eeprom_detect 
     127            adm1022_detect ltc1710_detect); 
    127128 
    128129# This is a list of all recognized chips.  
     
    132133#      written yet. 
    133134#  i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to 
    134 #      probe. 
     135#      probe. Recommend avoiding 0x69 because of clock chips. 
    135136#  i2c_driver_addrs (optional): For I2C chips, the range of valid I2C 
    136137#      addresses probed by the kernel driver. Strictly optional. 
     
    153154       name => "National Semiconductor LM78", 
    154155       driver => "lm78", 
    155        i2c_addrs => [0x00..0x7f],  
     156       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    156157       i2c_driver_addrs => [0x20..0x2f],  
    157158       i2c_detect => sub { lm78_detect 0, @_}, 
     
    163164       name => "National Semiconductor LM78-J", 
    164165       driver => "lm78", 
    165        i2c_addrs => [0x00..0x7f], 
     166       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    166167       i2c_driver_addrs => [0x20..0x2f],  
    167168       i2c_detect => sub { lm78_detect 1, @_ }, 
     
    173174       name => "National Semiconductor LM79", 
    174175       driver => "lm78", 
    175        i2c_addrs => [0x00..0x7f], 
     176       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    176177       i2c_driver_addrs => [0x20..0x2f],  
    177178       i2c_detect => sub { lm78_detect 2, @_ }, 
     
    195196       name => "Winbond W83781D", 
    196197       driver => "w83781d", 
    197        i2c_addrs => [0x00..0x7f],  
     198       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    198199       i2c_detect => sub { w83781d_detect 0, @_}, 
    199200       i2c_driver_addrs => [0x20..0x2f],  
     
    205206       name => "Winbond W83782D", 
    206207       driver => "w83781d", 
    207        i2c_addrs => [0x00..0x7f],  
     208       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    208209       i2c_driver_addrs => [0x20..0x2f],  
    209210       i2c_detect => sub { w83781d_detect 1, @_}, 
     
    215216       name => "Winbond W83783S", 
    216217       driver => "w83781d", 
    217        i2c_addrs => [0x00..0x7f],  
     218       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    218219       i2c_driver_addrs => [0x20..0x2f],  
    219220       i2c_detect => sub { w83781d_detect 2, @_}, 
     
    222223       name => "Winbond W83627HF", 
    223224       driver => "w83781d", 
    224        i2c_addrs => [0x00..0x7f],  
     225       i2c_addrs => [0x00..0x68,0x6a..0x7f],  
    225226       i2c_driver_addrs => [0x20..0x2f],  
    226227       i2c_detect => sub { w83781d_detect 3, @_}, 
     
    288289       i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 
    289290       i2c_detect => sub { adm1021_detect 3, @_ }, 
     291     }, 
     292     { 
     293       name => "Analog Devices ADM1022", 
     294# driver to be written 
     295       i2c_addrs => [0x2c..0x2f], 
     296       i2c_detect => sub { adm1022_detect 0, @_ }, 
     297     }, 
     298     { 
     299       name => "Texas Instruments THMC50", 
     300# driver to be written 
     301       i2c_addrs => [0x2c..0x2f], 
     302       i2c_detect => sub { adm1022_detect 1, @_ }, 
    290303     }, 
    291304     { 
     
    11881201# Registers used: 
    11891202#   0x01: Configuration 
    1190 #   0x02: Hysteris 
     1203#   0x02: Hysteresis 
    11911204#   0x03: Overtemperature Shutdown 
    11921205# Detection really sucks! It is only based on the fact that the LM75 has only 
     
    13631376#        We may assume an i2c_set_slave_addr was already done. 
    13641377# $_[2]: Address 
    1365 # Returns: undef if not detected, (8) if detected. 
     1378# Returns: undef if not detected, (7) if detected. 
    13661379# Registers used: 
    13671380#   0x3e: Company ID 
     
    13791392  return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; 
    13801393  return unless i2c_smbus_read_byte_data($file,0x48) == $addr; 
     1394   
     1395  return (7); 
     1396} 
     1397 
     1398# $_[0]: Chip to detect (0 = ADM1022, 1 = THMC50) 
     1399# $_[1]: A reference to the file descriptor to access this chip. 
     1400#        We may assume an i2c_set_slave_addr was already done. 
     1401# $_[2]: Address 
     1402# Returns: undef if not detected, (8) if detected. 
     1403# Registers used: 
     1404#   0x3e: Company ID 
     1405#   0x3f: Revision 
     1406#   0x40: Configuration 
     1407# Note: Detection overrules a previous LM78 or ADM9240 detection 
     1408sub adm1022_detect 
     1409{ 
     1410  my $reg; 
     1411  my ($chip, $file,$addr) = @_; 
     1412  $reg = i2c_smbus_read_byte_data($file,0x3e); 
     1413  return unless ($chip == 0 and $reg == 0x41) or 
     1414                ($chip == 1 and $reg == 0x49); 
     1415  return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; 
     1416  return unless (i2c_smbus_read_byte_data($file,0x3f) & 0xc0) == 0xc0; 
    13811417   
    13821418  return (8);