detect LM85. patch from

Richard Barrington <rich_b_nz@clear.net.nz>


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1410 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker committed 2002-06-30 20:34:35 +00:00
1 parent 3e65c375be
commit 28347b71b6
1 file changed
+27 -5
+27 -5
View File
@@ -648,7 +648,7 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect
lm87_detect ite_detect ite_isa_detect ite_alias_detect
ddcmonitor_detect ds1621_detect adm1024_detect fscpos_detect
fscscy_detect pcf8591_detect arp_detect ipmi_kcs_detect
ipmi_smic_detect via8231_isa_detect );
ipmi_smic_detect via8231_isa_detect lm85_detect);
# This is a list of all recognized chips.
# Each entry must have the following fields:
@@ -722,6 +722,12 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect
i2c_addrs => [0x28..0x2f],
i2c_detect => sub { lm80_detect @_} ,
},
{
name => "National Semiconductor LM85",
driver => "Unwritten: lm85",
i2c_addrs => [0x2c..0x2e],
i2c_detect => sub { lm85_detect @_},
},
{
name => "National Semiconductor LM87",
driver => "lm87",
@@ -919,7 +925,7 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect
isa_detect => sub { ite_isa_detect 0, @_ },
} ,
{
name => "Serial EEPROM (PC-100 DIMM)",
name => "Serial EEPROM (SDRAM DIMM)",
driver => "eeprom",
i2c_addrs => [0x50..0x57],
i2c_detect => sub { eeprom_detect @_ },
@@ -955,8 +961,8 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect
i2c_detect => sub { pcf8591_detect @_},
},
{
name => "SMBus 2.0 ARP-Capable Device??",
driver => "to-be-written",
name => "SMBus 2.0 ARP-Capable Device",
driver => "smbus-arp",
i2c_addrs => [0x61],
i2c_detect => sub { arp_detect @_},
},
@@ -1957,7 +1963,23 @@ sub lm80_detect
}
return (3);
}
# $_[0]: A reference to the file descriptor to access this chip.
# #_[1]: Base address.
# Returns: undef if not detected, (7) if detected.
# Registers used: 0x3e == Vendor register.
# 0x3f == Version/Stepping register.
# Constants used: 0x01 == National Semiconductor Vendor Id.
# 0x60 == Version number. The lower 4 stepping
# bits are masked and ignored.
sub lm85_detect
{
my ($file,$addr) = @_;
return if (i2c_smbus_read_byte_data($file,0x3e)) != 0x01;
return if (i2c_smbus_read_byte_data($file,0x3f) & 0xf0) != 0x60;
return (7);
}
# $_[0]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.
# $_[1]: Address