2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-05 08:45:26 +00:00

MAX1617A chip support (both driver and detect)

This one was easy. A MAX1617 is just a MAX1617A with better detection.
Life is beautiful!


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@375 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard
1999-04-10 00:05:10 +00:00
parent 68eee1a670
commit 647ad6e2b7
2 changed files with 23 additions and 8 deletions

View File

@@ -219,6 +219,12 @@ use subs qw(lm78_detect lm78_isa_detect lm78_alias_detect lm75_detect
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
i2c_detect => sub { adm1021_detect 1, @_ },
},
{
name => "Maxim MAX1617A",
driver => "adm1021",
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
i2c_detect => sub { adm1021_detect 2, @_ },
},
{
name => "Silicon Integrated Systems SIS5595",
driver => "sis5595",
@@ -1311,7 +1317,7 @@ sub adm9240_detect
return (8);
}
# $_[0]: Chip to detect (0 = ADM1021, 1 = MAX1617)
# $_[0]: Chip to detect (0 = ADM1021, 1 = MAX1617, 2 = MAX1617A)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.
# $_[2]: Address
@@ -1326,13 +1332,15 @@ sub adm1021_detect
my $reg;
my ($chip, $file,$addr) = @_;
return if $chip == 0 and i2c_smbus_read_byte_data($file,0xfe) != 0x41;
return if $chip == 2 and i2c_smbus_read_byte_data($file,0xfe) != 0x4d and
i2c_smbus_read_byte_data($file,0xff) != 0x01;
# The remaining things are flaky at best. Perhaps something can be done
# with the fact that some registers are unreadable?
return if (i2c_smbus_read_byte_data($file,0x02) & 0x03) != 0;
if ($chip == 0) {
return (6);
} else {
if ($chip == 1) {
return (3);
} else {
return (6);
}
}