--- lm-sensors/prog/detect/sensors-detect 2011-01-17 03:12:10.000000000 -0500 +++ lm-sensors/prog/detect/sensors-detect.new 2011-01-17 13:32:45.751002637 -0500 @@ -1205,6 +1205,11 @@ i2c_addrs => [0x18, 0x2a, 0x4c, 0x4d], i2c_detect => sub { emc1403_detect(@_, 3); }, }, { + name => "SMSC_EMC1023", + driver => "emc1023", + i2c_addrs => [0x48,0x49,0x4c,0x4d], + i2c_detect => sub { emc1023_detect(@_); }, + }, { name => "ST STTS424", driver => "jc42", i2c_addrs => [0x18..0x1f], @@ -5387,6 +5392,27 @@ return 6; } +# Chip to detect: +# Registers used: +# 0xed: Device ID register +# 0xfe: Vendor ID register +# 0xff: Revision register +sub emc1023_detect +{ + my ($file, $addr) = @_; + my $dev_id = i2c_smbus_read_byte_data($file, 0xed); + my $man_id = i2c_smbus_read_byte_data($file, 0xfe); + my $rev = i2c_smbus_read_byte_data($file, 0xff); + + return unless $man_id == 0x5d; # SMSC + + return unless ($dev_id == 0x0c) || ($dev_id == 0x0d) || ($dev_id == 0x08) || ($dev_id == 0x09) ; + return unless $rev == 0x01; + + return 8; +} + + # This checks for non-FFFF values for temperature, voltage, and current. # The address (0x0b) is specified by the SMBus standard so it's likely # that this really is a smart battery.