From a13e4335f8c929eb32ae853e9158d55b27f67618 Mon Sep 17 00:00:00 2001 From: Philip Edelbrock Date: Sun, 28 Feb 1999 17:32:59 +0000 Subject: [PATCH] (Phil) A little bit improved reporting for the eeproms. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@279 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/detect.pl | 16 +++++++++++++--- prog/detect/sensors-detect | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/prog/detect/detect.pl b/prog/detect/detect.pl index 5c04d928..b5d2770a 100755 --- a/prog/detect/detect.pl +++ b/prog/detect/detect.pl @@ -214,7 +214,13 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect name => "Serial EEPROM", driver => "eeprom", i2c_addrs => [0x50..0x57], - i2c_detect => sub { eeprom_detect @_ }, + i2c_detect => sub { eeprom_detect 0,@_ }, + }, + { + name => "Serial EEPROM on PC-100 DIMM", + driver => "eeprom", + i2c_addrs => [0x50..0x57], + i2c_detect => sub { eeprom_detect 1,@_ }, } ); @@ -1293,7 +1299,7 @@ sub sis5595_isa_detect # 0x00-0x63: PC-100 Data and Checksum sub eeprom_detect { - my ($file,$addr) = @_; + my ($chip,$file,$addr) = @_; # Check the checksum for validity (only works for PC-100 DIMMs) my $checksum = 0; for (my $i = 0; $i <= 62; $i = $i + 1) { @@ -1304,7 +1310,11 @@ sub eeprom_detect return (8); } # Even if checksum test fails, it still may be an eeprom - return (1); + if ($chip == 0) { + return (1); + } else { + return; + } } ################ diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 5c04d928..b5d2770a 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -214,7 +214,13 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect name => "Serial EEPROM", driver => "eeprom", i2c_addrs => [0x50..0x57], - i2c_detect => sub { eeprom_detect @_ }, + i2c_detect => sub { eeprom_detect 0,@_ }, + }, + { + name => "Serial EEPROM on PC-100 DIMM", + driver => "eeprom", + i2c_addrs => [0x50..0x57], + i2c_detect => sub { eeprom_detect 1,@_ }, } ); @@ -1293,7 +1299,7 @@ sub sis5595_isa_detect # 0x00-0x63: PC-100 Data and Checksum sub eeprom_detect { - my ($file,$addr) = @_; + my ($chip,$file,$addr) = @_; # Check the checksum for validity (only works for PC-100 DIMMs) my $checksum = 0; for (my $i = 0; $i <= 62; $i = $i + 1) { @@ -1304,7 +1310,11 @@ sub eeprom_detect return (8); } # Even if checksum test fails, it still may be an eeprom - return (1); + if ($chip == 0) { + return (1); + } else { + return; + } } ################