diff --git a/CHANGES b/CHANGES index 3670537d..181a8303 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ SVN-HEAD Differentiate between PC8374L and WPCD377I Use dmidecode to find IPMI interfaces if available Add Nuvoton W83795G/ADG detection + Add National Semiconductor LM95241 detection 3.1.0 "Happy Birthday Lina" (2009-02-28) libsensors: Add support for instantaneous power sensors diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index c2b6e95f..74196a0d 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -911,7 +911,12 @@ use vars qw(@i2c_adapter_names); name => "National Semiconductor LM95231", driver => "to-be-written", i2c_addrs => [0x2b, 0x19, 0x2a], - i2c_detect => sub { lm95231_detect(@_); }, + i2c_detect => sub { lm95231_detect(@_, 0); }, + }, { + name => "National Semiconductor LM95241", + driver => "lm95241", + i2c_addrs => [0x2b, 0x19, 0x2a], + i2c_detect => sub { lm95231_detect(@_, 1); }, }, { name => "National Semiconductor LM63", driver => "lm63", @@ -3907,20 +3912,28 @@ sub max6657_detect return 5; } +# Chip to detect: 0 = LM95231, 1 = LM95241 # Registers used: -# 0x03: Configuration +# 0x02: Status (3 unused bits) +# 0x03: Configuration (3 unused bits) +# 0x06: Remote diode filter control (6 unused bits) +# 0x30: Remote diode model type select (6 unused bits) # 0xfe: Manufacturer ID # 0xff: Revision ID sub lm95231_detect { - my ($file, $addr) = @_; + my ($file, $addr, $chip) = @_; my $mid = i2c_smbus_read_byte_data($file, 0xfe); my $cid = i2c_smbus_read_byte_data($file, 0xff); - my $conf = i2c_smbus_read_byte_data($file, 0x03); - return if ($conf & 0x89) != 0; - return if $mid != 0x01; # National Semiconductor - return if $cid != 0xa1; # LM95231 + return if $mid != 0x01; # National Semiconductor + return if $chip == 0 && $cid != 0xa1; # LM95231 + return if $chip == 1 && $cid != 0xa4; # LM95231 + + return if i2c_smbus_read_byte_data($file, 0x02) & 0x70; + return if i2c_smbus_read_byte_data($file, 0x03) & 0x89; + return if i2c_smbus_read_byte_data($file, 0x06) & 0xfa; + return if i2c_smbus_read_byte_data($file, 0x30) & 0xfa; return 6; }