Update sensors-detect for new fschmd driver

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4957 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Hans de Goede committed 2007-10-19 09:42:25 +00:00
1 parent 551652eec1
commit dfefc604a0
1 file changed
+28 -1
+28 -1
View File
@@ -1397,10 +1397,16 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x);
},
{
name => "FSC Heimdal",
driver => "to-be-written",
driver => "fschmd",
i2c_addrs => [0x73],
i2c_detect => sub { fschmd_detect(@_); },
},
{
name => "FSC Heracles",
driver => "fschmd",
i2c_addrs => [0x73],
i2c_detect => sub { fschrc_detect(@_); },
},
{
name => "ALi M5879",
driver => "to-be-written",
@@ -5016,6 +5022,27 @@ sub fschmd_detect
return (8);
}
# $_[0]: A reference to the file descriptor to access this chip.
# $_[1]: Address
# Returns: undef if not detected, (8) if detected.
# Registers used:
# 0x00-0x02: Identification ('H','R','C')
sub fschrc_detect
{
my ($file,$addr) = @_;
# check the first 3 registers
if (i2c_smbus_read_byte_data($file,0x00) != 0x48) {
return;
}
if (i2c_smbus_read_byte_data($file,0x01) != 0x52) {
return;
}
if (i2c_smbus_read_byte_data($file,0x02) != 0x43) {
return;
}
return (8);
}
# $_[0]: A reference to the file descriptor to access this chip.
# $_[1]: Address (unused)
# Returns: undef if not detected, 5 if detected.