Changeset 784

Show
Ignore:
Timestamp:
03/19/00 23:06:54 (9 years ago)
Author:
mds
Message:

(mds) add ADM1025 detection. No driver.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/prog/detect/sensors-detect

    r776 r784  
    244244 
    245245use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect  
    246             lm80_detect w83781d_detect w83781d_alias_detect 
     246            lm80_detect w83781d_detect w83781d_alias_detect adm1025_detect 
    247247            w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect  
    248248            adm1021_detect sis5595_isa_detect eeprom_detect via686a_isa_detect 
     
    400400       i2c_addrs => [0x2c..0x2f], 
    401401       i2c_detect => sub { adm9240_detect 2, @_ } 
     402     }, 
     403     { 
     404       name => "Analog Devices ADM1025", 
     405#       driver => "xxxxxxx", 
     406       i2c_addrs => [0x2c..0x2f], 
     407       i2c_detect => sub { adm1025_detect 0, @_ } 
    402408     }, 
    403409     { 
     
    16231629} 
    16241630 
     1631# $_[0]: Chip to detect (0 = ADM1025) 
     1632# $_[1]: A reference to the file descriptor to access this chip. 
     1633#        We may assume an i2c_set_slave_addr was already done. 
     1634# $_[2]: Address 
     1635# Returns: undef if not detected, (8) if detected. 
     1636# Registers used: 
     1637#   0x3e: Company ID 
     1638#   0x3f: Revision 
     1639#   0x40: Configuration 
     1640# Note: Detection overrules a previous LM78 or ADM9240 detection 
     1641sub adm1025_detect 
     1642{ 
     1643  my $reg; 
     1644  my ($chip, $file,$addr) = @_; 
     1645  $reg = i2c_smbus_read_byte_data($file,0x3e); 
     1646  return unless ($chip == 0 and $reg == 0x41); 
     1647  return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; 
     1648  return unless (i2c_smbus_read_byte_data($file,0x3f) & 0xc0) == 0x20; 
     1649   
     1650  return (8); 
     1651} 
     1652 
    16251653# $_[0]: Chip to detect 
    16261654#   (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A, 3 = THMC10, 4 = LM84, 5 = GL523)