From 88d984681df3e5b78552ac7044b895b8ff35523e Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sat, 4 Mar 2000 16:21:48 +0000 Subject: [PATCH] (mds) add Via 686A integrated sensors detection. Untested. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@743 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 44 +++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index c0900517..e0d314c6 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -245,7 +245,7 @@ use vars qw(@pci_adapters @chip_ids @undetectable_adapters); use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect lm80_detect w83781d_detect w83781d_alias_detect w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect - adm1021_detect sis5595_isa_detect eeprom_detect + adm1021_detect sis5595_isa_detect eeprom_detect via686a_isa_detect adm1022_detect ltc1710_detect gl525sm_detect ddcmonitor_detect); # This is a list of all recognized chips. @@ -454,6 +454,12 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect isa_addrs => [ 0 ], isa_detect => sub { sis5595_isa_detect @_ }, }, + { + name => "VIA Technologies VT 82C686 Integrated Sensors", + driver => "via686a", + isa_addrs => [ 0 ], + isa_detect => sub { via686a_isa_detect @_ }, + }, { name => "Serial EEPROM (PC-100 DIMM)", driver => "eeprom", @@ -1681,6 +1687,42 @@ sub sis5595_isa_detect return 9; } +# $_[0]: Address +# Returns: undef if not detected, (9) if detected. +# Note: It is already 99% certain this chip exists if we find the PCI +# entry. The exact address is encoded in PCI space. +sub via686a_isa_detect +{ + my ($addr) = @_; + my ($adapter,$try,$local_try); + my $found = 0; + foreach $local_try (@pci_adapters) { + if ($local_try->{procid} eq "VIA Technologies VT 82C686 Apollo ACPI") { + $try = $local_try; + $found = 1; + last; + } + } + return if not $found; + + $found = 0; + foreach $adapter (@pci_list) { + if ((defined($adapter->{vendid}) and + $try->{vendid} == $adapter->{vendid} and + $try->{devid} == $adapter->{devid} and + $try->{func} == $adapter->{func}) or + (! defined($adapter->{vendid}) and + $adapter->{desc} =~ /$try->{procid}/ and + $try->{func} == $adapter->{func})) { + $found = 1; + last; + } + } + return if not $found; + + return 9; +} + # $_[0]: A reference to the file descriptor to access this chip. # We may assume an i2c_set_slave_addr was already done. # $_[1]: Address