2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 05:48:07 +00:00

Fix detection of older DS1621.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5612 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare 2009-01-19 20:38:53 +00:00
parent f776de748d
commit 3a3a467c06
2 changed files with 6 additions and 5 deletions

View File

@ -58,6 +58,7 @@ SVN-HEAD
Add Intel Core I7 support
Generate new format for /etc/sysconfig/lm_sensors
Print warnings about missing modules on screen
Fix detection of older DS1621
sensors-detect-stat.pl: Delete (functionality merged into sensors-detect)
3.0.3 (2008-09-28)

View File

@ -3544,10 +3544,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,
@ -3560,7 +3556,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;
}
# Registers used: