mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-27 20:48:22 +00:00
Add detection of MAX1668, MAX1805, MAX1989 - original code by ticket#2125
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4314 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
cadc300e3e
commit
532217ed23
2 files changed
+42
No files matched your search
@@ -6,6 +6,7 @@ SVN HEAD
|
||||
Drop ARP-capable device detection
|
||||
Add Maxim MAX6655/MAX6656 detection
|
||||
(Olexiy Avramchenko)
|
||||
Add Maxim MAX1668, MAX1805, MAX1989 detection
|
||||
Add VIA CX700 detection
|
||||
Drop legacy W83627HF ISA detection
|
||||
Don't bufferize stdout during probes
|
||||
|
||||
@@ -1141,6 +1141,24 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x);
|
||||
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
|
||||
i2c_detect => sub { adm1021_detect(3, @_); },
|
||||
},
|
||||
{
|
||||
name => "Maxim MAX1668",
|
||||
driver => "max1668",
|
||||
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
|
||||
i2c_detect => sub { max1668_detect(0, @_); },
|
||||
},
|
||||
{
|
||||
name => "Maxim MAX1805",
|
||||
driver => "max1668",
|
||||
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
|
||||
i2c_detect => sub { max1668_detect(1, @_); },
|
||||
},
|
||||
{
|
||||
name => "Maxim MAX1989",
|
||||
driver => "max1668",
|
||||
i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e],
|
||||
i2c_detect => sub { max1668_detect(2, @_); },
|
||||
},
|
||||
{
|
||||
name => "Maxim MAX6650/MAX6651",
|
||||
driver => "max6650",
|
||||
@@ -4473,6 +4491,29 @@ sub adm1021_detect
|
||||
return 5;
|
||||
}
|
||||
|
||||
# $_[0]: Chip to detect
|
||||
# (0 = MAX1668, 1 = MAX1805, 2 = MAX1989)
|
||||
# $_[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, 7 if detected
|
||||
# Registers used:
|
||||
# 0xfe: Company ID
|
||||
# 0xff: Device ID
|
||||
sub max1668_detect
|
||||
{
|
||||
my ($chip, $file, $addr) = @_;
|
||||
my $man_id = i2c_smbus_read_byte_data($file, 0xfe);
|
||||
my $dev_id = i2c_smbus_read_byte_data($file, 0xff);
|
||||
|
||||
return if $man_id != 0x4d;
|
||||
return if $chip == 0 and $dev_id != 0x03;
|
||||
return if $chip == 1 and $dev_id != 0x05;
|
||||
return if $chip == 2 and $dev_id != 0x0b;
|
||||
|
||||
return 7;
|
||||
}
|
||||
|
||||
# $_[0]: Chip to detect
|
||||
# (0 = MAX1619)
|
||||
# $_[1]: A reference to the file descriptor to access this chip.
|
||||
|
||||
Reference in new issue
Block a user