Add detection for National Semiconductor LM73.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5779 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2009-10-03 10:38:14 +00:00
1 parent 183947c528
commit b6becb237e
2 files changed
+37

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ SVN-HEAD
Drop AMD K10 detection (unreliable sensors)
Add detection for AMD Family 11h thermal sensors
Add detection for Intel Atom thermal sensors
Add detection for National Semiconductor LM73
sysconfig-lm_sensors-convert: Fix exit code
3.1.1 (2009-06-21)
+36
View File
@@ -947,6 +947,11 @@ use vars qw(@i2c_adapter_names);
driver => "lm63", # Not yet
i2c_addrs => [0x4c],
i2c_detect => sub { lm63_detect(@_, 2); },
}, {
name => "National Semiconductor LM73",
driver => "lm73",
i2c_addrs => [0x48..0x4a, 0x4c..0x4e],
i2c_detect => sub { lm73_detect(@_); },
}, {
name => "National Semiconductor LM92",
driver => "lm92",
@@ -3585,6 +3590,37 @@ sub lm75_detect
return 3;
}
# Registers used:
# 0x00: Temperature
# 0x01: Configuration
# 0x02: High Limit
# 0x03: Low Limit
# 0x04: Status
# 0x07: Manufacturer ID and Product ID
sub lm73_detect
{
my ($file, $addr) = @_;
my $conf = i2c_smbus_read_byte_data($file, 0x01);
my $status = i2c_smbus_read_byte_data($file, 0x04);
# Bits that always return 0
return if ($conf & 0x0c) or ($status & 0x10);
return if i2c_smbus_read_word_data($file, 0x07) != 0x9001;
# Make sure the chip supports SMBus read word transactions
my $cur = i2c_smbus_read_word_data($file, 0x00);
return if $cur < 0;
my $high = i2c_smbus_read_word_data($file, 0x02);
return if $high < 0;
my $low = i2c_smbus_read_word_data($file, 0x03);
return if $low < 0;
return if ($cur & 0x0300) or (($high | $low) & 0x1f00);
return 3;
}
# Registers used:
# 0x00: Temperature
# 0x01: Configuration