summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2011-07-10 19:22:53 +0000
committerGuenter Roeck <linux@roeck-us.net>2011-07-10 19:22:53 +0000
commit60eaad824f96f907d37bc3cf5567d863a2ade732 (patch)
tree25ecb19c2e21d2c028cf7c48371fcd67a21a1ff4
parent93213b20cbfb2268e04c23e80dc52be26afac40a (diff)
downloadlm-sensors-git-60eaad824f96f907d37bc3cf5567d863a2ade732.tar.gz
Add code to detect LM95245
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5984 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r--CHANGES1
-rwxr-xr-xprog/detect/sensors-detect33
2 files changed, 25 insertions, 9 deletions
diff --git a/CHANGES b/CHANGES
index a3404a8a..87126535 100644
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,7 @@ SVN HEAD
Add detection of ITE IT8772E
Don't advertise the ipmisensors driver
Add detection of SA56004
+ Add detection of LM95245
3.3.0 (2011-03-28)
Makefile: Check for bison and flex
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index b4ff3578..aa525b14 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -1008,6 +1008,11 @@ use vars qw(@i2c_adapter_names);
i2c_addrs => [0x2b, 0x19, 0x2a],
i2c_detect => sub { lm95231_detect(@_, 1); },
}, {
+ name => "National Semiconductor LM95245",
+ driver => "lm95245",
+ i2c_addrs => [0x18, 0x19, 0x29, 0x4c, 0x4d],
+ i2c_detect => sub { lm95231_detect(@_, 2); },
+ }, {
name => "National Semiconductor LM63",
driver => "lm63",
i2c_addrs => [0x4c],
@@ -4540,12 +4545,14 @@ sub max6657_detect
return 5;
}
-# Chip to detect: 0 = LM95231, 1 = LM95241
+# Chip to detect: 0 = LM95231, 1 = LM95241, 2 = LM95245
# Registers used:
# 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)
+# 0x06: Remote diode filter control (6 unused bits, LM95231 and LM95241)
+# 0x30: Remote diode model type select (6 unused bits, LM95231 and LM95241)
+# 0x30: Local Temperature LSB (5 unused bits, LM95245)
+# 0x33: Status register 2 (6 unused bits, LM95245)
# 0xfe: Manufacturer ID
# 0xff: Revision ID
sub lm95231_detect
@@ -4555,13 +4562,21 @@ sub lm95231_detect
my $cid = i2c_smbus_read_byte_data($file, 0xff);
return if $mid != 0x01; # National Semiconductor
- return if $chip == 0 && $cid != 0xa1; # LM95231
- return if $chip == 1 && $cid != 0xa4; # LM95241
- 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;
+ if ($chip == 0 || $chip == 1) {
+ return if $chip == 0 && $cid != 0xa1; # LM95231
+ return if $chip == 1 && $cid != 0xa4; # LM95241
+ 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;
+ } elsif ($chip == 2) {
+ return if $cid != 0xb3; # LM95245
+ return if i2c_smbus_read_byte_data($file, 0x02) & 0x68;
+ return if i2c_smbus_read_byte_data($file, 0x03) & 0xa1;
+ return if i2c_smbus_read_byte_data($file, 0x30) & 0x1f;
+ return if i2c_smbus_read_byte_data($file, 0x33) & 0x3f;
+ }
return 6;
}