Changeset 1410

Show
Ignore:
Timestamp:
06/30/02 22:34:35 (11 years ago)
Author:
mds
Message:

detect LM85. patch from

Richard Barrington <rich_b_nz@…>

Files:
1 modified

Legend:

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

    r1394 r1410  
    649649            ddcmonitor_detect ds1621_detect adm1024_detect fscpos_detect 
    650650            fscscy_detect pcf8591_detect arp_detect ipmi_kcs_detect 
    651             ipmi_smic_detect via8231_isa_detect ); 
     651            ipmi_smic_detect via8231_isa_detect lm85_detect); 
    652652 
    653653# This is a list of all recognized chips.  
     
    724724     }, 
    725725     { 
     726       name => "National Semiconductor LM85", 
     727       driver => "Unwritten: lm85", 
     728       i2c_addrs => [0x2c..0x2e], 
     729       i2c_detect => sub { lm85_detect @_}, 
     730     }, 
     731     { 
    726732       name => "National Semiconductor LM87", 
    727733       driver => "lm87", 
     
    920926     } , 
    921927     { 
    922        name => "Serial EEPROM (PC-100 DIMM)", 
     928       name => "Serial EEPROM (SDRAM DIMM)", 
    923929       driver => "eeprom", 
    924930       i2c_addrs => [0x50..0x57], 
     
    956962     }, 
    957963     { 
    958        name => "SMBus 2.0 ARP-Capable Device??", 
    959        driver => "to-be-written", 
     964       name => "SMBus 2.0 ARP-Capable Device", 
     965       driver => "smbus-arp", 
    960966       i2c_addrs => [0x61], 
    961967       i2c_detect => sub { arp_detect @_}, 
     
    19581964  return (3); 
    19591965} 
    1960    
     1966 
     1967# $_[0]: A reference to the file descriptor to access this chip. 
     1968# #_[1]: Base address. 
     1969# Returns: undef if not detected, (7) if detected. 
     1970# Registers used: 0x3e == Vendor register. 
     1971#                 0x3f == Version/Stepping register. 
     1972# Constants used: 0x01 == National Semiconductor Vendor Id. 
     1973#                 0x60 == Version number. The lower 4 stepping 
     1974#                         bits are masked and ignored. 
     1975sub lm85_detect 
     1976{ 
     1977  my ($file,$addr) = @_; 
     1978  return if (i2c_smbus_read_byte_data($file,0x3e)) != 0x01; 
     1979  return if (i2c_smbus_read_byte_data($file,0x3f) & 0xf0) != 0x60; 
     1980  return (7); 
     1981} 
     1982 
    19611983# $_[0]: A reference to the file descriptor to access this chip. 
    19621984#        We may assume an i2c_set_slave_addr was already done.