Fix detection of older DS1621.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5613 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2009-01-19 21:07:56 +00:00
1 parent 1799127231
commit b59b5489f1
2 files changed
+6 -5

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ lm_sensors CHANGES file
SVN-HEAD
File lm_sensors.lsm: Delete, don't advertise a legacy branch
File doc/developers/release_checklist: Skip mail to lsm
Program sensors-detect: Fix detection of older DS1621
2.10.8 (20081216)
File doc/chips/lm90: Update datasheet links (2.6 backport)
+5 -5
View File
@@ -3863,10 +3863,6 @@ sub ds1621_detect
my $conf = i2c_smbus_read_byte_data($file, 0xAC);
return if ($conf & 0x10);
my $counter = i2c_smbus_read_byte_data($file, 0xA8);
my $slope = i2c_smbus_read_byte_data($file, 0xA9);
return if ($slope != 0x10 || $counter > $slope);
my $temp = i2c_smbus_read_word_data($file, 0xAA);
return if $temp < 0 || ($temp & 0x0f00);
# On the DS1631, the following two checks are too strict in theory,
@@ -3879,7 +3875,11 @@ sub ds1621_detect
return if ($temp == 0 && $high == 0 && $low == 0 && $conf == 0);
return 3;
# Old versions of the DS1621 apparently don't have the counter and
# slope registers (or they return crap)
my $counter = i2c_smbus_read_byte_data($file, 0xA8);
my $slope = i2c_smbus_read_byte_data($file, 0xA9);
return ($slope == 0x10 && $counter <= $slope) ? 3 : 2;
}
# $_[0]: A reference to the file descriptor to access this chip.