2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-02 07:15:39 +00:00

adm1026 and auto-sensors.h patch from P.P.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1777 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker
2003-06-08 21:33:39 +00:00
parent 63443070b3
commit e9c0fce42a
22 changed files with 2695 additions and 29 deletions

View File

@@ -761,7 +761,8 @@ 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 lm85_detect smartbatt_detect);
ipmi_smic_detect via8231_isa_detect lm85_detect smartbatt_detect
adm1026_detect);
# This is a list of all recognized chips.
# Each entry must have the following fields:
@@ -955,6 +956,12 @@ use subs qw(mtp008_detect lm78_detect lm78_isa_detect lm78_alias_detect
i2c_addrs => [0x2c..0x2f],
i2c_detect => sub { adm9240_detect 2, @_ }
},
{
name => "Analog Devices ADM1026",
driver => "adm1026",
i2c_addrs => [0x2c,0x2d,0x2e],
i2c_detect => sub { adm1026_detect 0, @_ }
},
{
name => "Analog Devices ADM1025",
driver => "adm1025",
@@ -2525,6 +2532,24 @@ sub adm1025_detect
return (8);
}
# $_[0]: Chip to detect (0 = ADM1026)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.
# $_[2]: Address
# Returns: undef if not detected, (8) if detected.
# Registers used:
# 0x16: Company ID
# 0x17: Revision
sub adm1026_detect
{
my $reg;
my ($chip, $file,$addr) = @_;
$reg = i2c_smbus_read_byte_data($file,0x16);
return unless ($reg == 0x41);
return unless (i2c_smbus_read_byte_data($file,0x17) & 0xf0) == 0x40;
return (8);
}
# $_[0]: Chip to detect (0 = ADM1024)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.