diff --git a/CHANGES b/CHANGES index 4950a29d..7ce743aa 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ SVN HEAD Fix error seen if I2C bus numbers are not sequential Add detection of SMSC EMC1423 Add detection of the Analog Devices ADT7410 + Add detection of the National Semiconductor LM94 3.2.0 (2010-10-10) libsensors: Increase MAX_SENSORS_PER_TYPE to 24 diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index ff440710..5e304c80 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -640,7 +640,12 @@ use vars qw(@i2c_adapter_names); name => "National Semiconductor LM93", driver => "lm93", i2c_addrs => [0x2c..0x2e], - i2c_detect => sub { lm93_detect(@_); }, + i2c_detect => sub { lm93_detect(@_, 0); }, + }, { + name => "National Semiconductor LM94", + driver => "to-be-written", # Most likely lm93 + i2c_addrs => [0x2c..0x2e], + i2c_detect => sub { lm93_detect(@_, 1); }, }, { name => "Winbond W83781D", driver => "w83781d", @@ -5226,14 +5231,27 @@ sub fsc_detect return 8; } +# Chip to detect: 0 = LM93, 1 = LM94 # Registers used: # 0x3E: Manufacturer ID # 0x3F: Version/Stepping sub lm93_detect { - my ($file, $addr) = @_; - return unless i2c_smbus_read_byte_data($file, 0x3E) == 0x01 - and i2c_smbus_read_byte_data($file, 0x3F) == 0x73; + my ($file, $addr, $chip) = @_; + my ($man_id, $dev_id); + + $man_id = i2c_smbus_read_byte_data($file, 0x3E); + $dev_id = i2c_smbus_read_byte_data($file, 0x3F); + + if ($chip == 0) { + return unless $man_id == 0x01 # National Semiconductor + and $dev_id == 0x73; # LM93 + } + if ($chip == 1) { + return unless $man_id == 0x01 # National Semiconductor + and $dev_id >= 0x79 + and $dev_id <= 0x7A; # LM94 + } return 5; }