2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

Add SMSC SCH5027D detection. Patch from Juerg Haefliger.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5117 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-02-03 21:03:07 +00:00
parent 2fd9c2d098
commit 10f1901765
2 changed files with 46 additions and 9 deletions

View File

@@ -1411,7 +1411,13 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x);
name => "SMSC DME1737",
driver => "dme1737",
i2c_addrs => [0x2c..0x2e],
i2c_detect => sub { dme1737_detect(@_); },
i2c_detect => sub { dme1737_detect(1, @_); },
},
{
name => "SMSC SCH5027D-NW",
driver => "dme1737",
i2c_addrs => [0x2c..0x2e],
i2c_detect => sub { dme1737_detect(2, @_); },
},
{
name => "Fintek F75111R/RG/N (GPIO)",
@@ -1895,6 +1901,12 @@ use vars qw(@chip_kern24_ids @chip_kern26_ids
devid => 0x90,
logdev => 0x08,
},
{
name => "SMSC SCH5027D-NW Super IO",
# Hardware monitoring features are accessed on the SMBus
driver => "via-smbus-only",
devid => 0x89,
},
{
name => "SMSC SCH5307-NS Super IO",
driver => "smsc47b397",
@@ -4342,7 +4354,9 @@ sub lm85_detect
{
my ($vendor,$file,$addr) = @_;
return if (i2c_smbus_read_byte_data($file,0x3e)) != $vendor ;
return if (i2c_smbus_read_byte_data($file,0x3f) & 0xf0) != 0x60;
my $verstep = i2c_smbus_read_byte_data($file,0x3f);
return if ($verstep & 0xf0) != 0x60;
if ($vendor == 0x41) # Analog Devices
{
@@ -4350,6 +4364,13 @@ sub lm85_detect
return (8);
}
if ($vendor == 0x5c) # SMSC
{
# Return undef if this is a SCH5027
return if $verstep >= 0x69 and
i2c_smbus_read_byte_data($file, 0xba) == 0x0f;
}
return (7);
}
@@ -5166,21 +5187,34 @@ sub smsc47m192_detect
return ($addr == 0x2d ? 6 : 5);
}
# $_[0]: A reference to the file descriptor to access this chip.
# $_[1]: Address
# $_[0]: Chip to detect
# (1 = DME1737, 2 = SCH5027)
# $_[1]: A reference to the file descriptor to access this chip.
# $_[2]: Address
# Returns: undef if not detected, 5 or 6 if detected.
# Registers used:
# 0x3E: Manufacturer ID
# 0x3F: Version/Stepping
# 0x73: Read-only test register (4 test bits)
# 0x8A: Read-only test register (7 test bits)
# 0xBA: Read-only test register (8 test bits)
sub dme1737_detect
{
my ($file, $addr) = @_;
return unless i2c_smbus_read_byte_data($file, 0x3E) == 0x5c
and (i2c_smbus_read_byte_data($file, 0x3F) & 0xF8) == 0x88
and (i2c_smbus_read_byte_data($file, 0x73) & 0x0F) == 0x09
and (i2c_smbus_read_byte_data($file, 0x8A) & 0x7F) == 0x4D;
my ($chip, $file, $addr) = @_;
my $vendor = i2c_smbus_read_byte_data($file, 0x3E);
my $verstep = i2c_smbus_read_byte_data($file, 0x3F);
return unless $vendor == 0x5C; # SMSC
if ($chip == 1) { # DME1737
return unless ($verstep & 0xF8) == 0x88 and
(i2c_smbus_read_byte_data($file, 0x73) & 0x0F) == 0x09 and
(i2c_smbus_read_byte_data($file, 0x8A) & 0x7F) == 0x4D;
} elsif ($chip == 2) { # SCH5027
return unless $verstep >= 0x69 and $verstep <= 0x6F and
i2c_smbus_read_byte_data($file, 0xBA) == 0x0F;
}
return ($addr == 0x2e ? 6 : 5);
}