2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

Improve EMC6W201 detection.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5971 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2011-05-07 11:50:23 +00:00
parent 69e02824a1
commit 16ebefd716

View File

@@ -4929,14 +4929,17 @@ sub lm85_detect
# Registers used:
# 0x3e: Vendor register
# 0x3f: Version/Stepping register
# 0x40: Configuration register (reserved bits + ready)
sub emc6w201_detect
{
my ($file, $addr) = @_;
my $vendor = i2c_smbus_read_byte_data($file, 0x3e);
my $verstep = i2c_smbus_read_byte_data($file, 0x3f);
my $conf = i2c_smbus_read_byte_data($file, 0x40);
return if $vendor != 0x5c; # SMSC
return if $verstep < 0xb0 || $verstep < 0xb1; # EMC6W201
return if ($conf & 0xf4) != 0x04;
return 6;
}