diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 12ce62b7..2e1e6d1a 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2546,19 +2546,30 @@ sub lm75_detect # We may assume an i2c_set_slave_addr was already done. # $_[1]: Address # Returns: undef if not detected, (3) if detected, -# (6) or (9) if even more bits match. +# (5) or (7) if even more bits match. # Registers used: +# 0xAA: Temperature +# 0xA1: High limit +# 0xA2: Low limit # 0xAC: Configuration # Detection is weak. We check if Bit 3 is set and Bit 2 is clear. # The DS1621 will aways have a config like 0x????10??. A even better # match would be 0x0??01000. +# Temperature checkings will hopefully prevent LM75 chips from being +# detected as a DS1621. sub ds1621_detect { my $i; my ($file,$addr) = @_; + my $temp = i2c_smbus_read_word_data($file,0xAA); + return if ($temp & 0x007F); + $temp = i2c_smbus_read_word_data($file,0xA1); + return if ($temp & 0x007F); + $temp = i2c_smbus_read_word_data($file,0xA2); + return if ($temp & 0x007F); my $conf = i2c_smbus_read_byte_data($file,0xAC); - return (9) if ($conf & 0x9F) == 0x98; - return (6) if ($conf & 0x0F) == 0x08; + return (7) if ($conf & 0x9F) == 0x98; + return (5) if ($conf & 0x0F) == 0x08; return (3) if ($conf & 0x0C) == 0x08; return ; }