Changeset 743

Show
Ignore:
Timestamp:
03/04/00 17:21:48 (9 years ago)
Author:
mds
Message:

(mds) add Via 686A integrated sensors detection. Untested.

Files:

Legend:

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

    r739 r743  
    246246            lm80_detect w83781d_detect w83781d_alias_detect 
    247247            w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect  
    248             adm1021_detect sis5595_isa_detect eeprom_detect 
     248            adm1021_detect sis5595_isa_detect eeprom_detect via686a_isa_detect 
    249249            adm1022_detect ltc1710_detect gl525sm_detect ddcmonitor_detect); 
    250250 
     
    454454       isa_addrs => [ 0 ], 
    455455       isa_detect => sub { sis5595_isa_detect @_ }, 
     456     }, 
     457     { 
     458       name => "VIA Technologies VT 82C686 Integrated Sensors", 
     459       driver => "via686a", 
     460       isa_addrs => [ 0 ], 
     461       isa_detect => sub { via686a_isa_detect @_ }, 
    456462     }, 
    457463     { 
     
    16821688} 
    16831689 
     1690# $_[0]: Address 
     1691# Returns: undef if not detected, (9) if detected. 
     1692# Note: It is already 99% certain this chip exists if we find the PCI 
     1693# entry. The exact address is encoded in PCI space. 
     1694sub via686a_isa_detect 
     1695{ 
     1696  my ($addr) = @_; 
     1697  my ($adapter,$try,$local_try); 
     1698  my $found = 0; 
     1699  foreach $local_try (@pci_adapters) { 
     1700    if ($local_try->{procid} eq "VIA Technologies VT 82C686 Apollo ACPI") { 
     1701      $try = $local_try; 
     1702      $found = 1; 
     1703      last; 
     1704    } 
     1705  } 
     1706  return if not $found; 
     1707 
     1708  $found = 0; 
     1709  foreach $adapter (@pci_list) { 
     1710    if ((defined($adapter->{vendid}) and  
     1711         $try->{vendid} == $adapter->{vendid} and 
     1712         $try->{devid} == $adapter->{devid} and 
     1713         $try->{func} == $adapter->{func}) or 
     1714        (! defined($adapter->{vendid}) and 
     1715         $adapter->{desc} =~ /$try->{procid}/ and 
     1716         $try->{func} == $adapter->{func})) { 
     1717      $found = 1; 
     1718      last; 
     1719    } 
     1720  } 
     1721  return if not $found; 
     1722 
     1723  return 9; 
     1724} 
     1725 
    16841726# $_[0]: A reference to the file descriptor to access this chip. 
    16851727#        We may assume an i2c_set_slave_addr was already done.