mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-02 07:15:39 +00:00
Drop unreliable DS1621/DS1631 detection
Detection of the Dallas/Maxim DS1621, DS1625 and DS1631 chips is weak and likely to result in false positive. There's no rationale for keeping it in sensors-detect as these chips are not found in desktop computer systems. So drop detection of these chips altogether.
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -17,6 +17,7 @@ SVN HEAD
|
|||||||
Add detection of LM95234
|
Add detection of LM95234
|
||||||
Add detection of TMP431/TMP432
|
Add detection of TMP431/TMP432
|
||||||
Update Nuvoton chip information and NCT6106D chip detection
|
Update Nuvoton chip information and NCT6106D chip detection
|
||||||
|
Drop unreliable DS1621/DS1631 detection
|
||||||
|
|
||||||
3.3.3 "Happy Birthday Sophie" (2012-11-06)
|
3.3.3 "Happy Birthday Sophie" (2012-11-06)
|
||||||
documentation: Update fan-divisors, fan divisors are optional
|
documentation: Update fan-divisors, fan divisors are optional
|
||||||
|
@@ -802,11 +802,6 @@ use vars qw(@i2c_adapter_names);
|
|||||||
driver => "adm9240",
|
driver => "adm9240",
|
||||||
i2c_addrs => [0x2c..0x2f],
|
i2c_addrs => [0x2c..0x2f],
|
||||||
i2c_detect => sub { adm9240_detect(@_, 0); },
|
i2c_detect => sub { adm9240_detect(@_, 0); },
|
||||||
}, {
|
|
||||||
name => "Dallas Semiconductor DS1621/DS1631",
|
|
||||||
driver => "ds1621",
|
|
||||||
i2c_addrs => [0x48..0x4f],
|
|
||||||
i2c_detect => sub { ds1621_detect(@_); },
|
|
||||||
}, {
|
}, {
|
||||||
name => "Dallas Semiconductor DS1780",
|
name => "Dallas Semiconductor DS1780",
|
||||||
driver => "adm9240",
|
driver => "adm9240",
|
||||||
@@ -4357,47 +4352,6 @@ sub lm92_detect
|
|||||||
return ($chip == 0) ? 4 : 2;
|
return ($chip == 0) ? 4 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Registers used:
|
|
||||||
# 0xAA: Temperature
|
|
||||||
# 0xA1: High limit
|
|
||||||
# 0xA2: Low limit
|
|
||||||
# 0xA8: Counter
|
|
||||||
# 0xA9: Slope
|
|
||||||
# 0xAC: Configuration
|
|
||||||
# Detection is weak. We check if bit 4 (NVB) is clear, because it is
|
|
||||||
# unlikely to be set (would mean that EEPROM is currently being accessed).
|
|
||||||
# We also check the value of the counter and slope registers, the datasheet
|
|
||||||
# doesn't mention the possible values but the conversion formula together
|
|
||||||
# with experimental evidence suggest possible sanity checks.
|
|
||||||
# Not all devices enjoy SMBus read word transactions, so we do as much as
|
|
||||||
# possible with read byte transactions first, and only use read word
|
|
||||||
# transactions second.
|
|
||||||
sub ds1621_detect
|
|
||||||
{
|
|
||||||
my ($file, $addr) = @_;
|
|
||||||
|
|
||||||
my $conf = i2c_smbus_read_byte_data($file, 0xAC);
|
|
||||||
return if ($conf & 0x10);
|
|
||||||
|
|
||||||
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,
|
|
||||||
# but in practice I very much doubt that anyone will set temperature
|
|
||||||
# limits not a multiple of 0.5 degrees C.
|
|
||||||
my $high = i2c_smbus_read_word_data($file, 0xA1);
|
|
||||||
return if $high < 0 || ($high & 0x7f00);
|
|
||||||
my $low = i2c_smbus_read_word_data($file, 0xA2);
|
|
||||||
return if $low < 0 || ($low & 0x7f00);
|
|
||||||
|
|
||||||
return if ($temp == 0 && $high == 0 && $low == 0 && $conf == 0);
|
|
||||||
|
|
||||||
# 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Chip to detect: 0 = LM80, 1 = LM96080
|
# Chip to detect: 0 = LM80, 1 = LM96080
|
||||||
# Registers used:
|
# Registers used:
|
||||||
# 0x00: Configuration register
|
# 0x00: Configuration register
|
||||||
|
Reference in New Issue
Block a user