sensors-detect: Add detection of the Maxim MAX6655/MAX6656. Patch from

Olexiy Avramchenko.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4305 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-01-24 07:29:10 +00:00
1 parent df7a40a8b2
commit 3fb3c13ccd
2 files changed
+25

No files matched your search

+2
View File
@@ -4,6 +4,8 @@ lm_sensors CHANGES file
SVN HEAD
Program sensors-detect: Only probe relevant I2C addresses
Drop ARP-capable device detection
Add Maxim MAX6655/MAX6656 detection
(Olexiy Avramchenko)
2.10.2 (20070115)
+23
View File
@@ -1143,6 +1143,12 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x);
i2c_addrs => [0x1b,0x1f,0x48,0x4b],
i2c_detect => sub { max6650_detect(0, @_); },
},
{
name => "Maxim MAX6655/MAX6656",
driver => "max6655",
i2c_addrs => [0x18..0x1a, 0x29..0x2b, 0x4c..0x4e],
i2c_detect => sub { max6655_detect(0, @_); },
},
{
name => "TI THMC10",
driver => "adm1021",
@@ -5211,6 +5217,23 @@ sub max6650_detect
return 4;
}
# $_[0]: Chip to detect. Always zero.
# $_[1]: A reference to the file descriptor to access this chip.
# $_[2]: Address.
#
# Returns: undef if not detected, 4 if detected.
sub max6655_detect
{
my ($chip, $file, $addr) = @_;
# checking RDID (Device ID)
return unless i2c_smbus_read_byte_data($file, 0xfe) == 0x0a;
# checking RDRV (Manufacturer ID)
return unless i2c_smbus_read_byte_data($file, 0xff) == 0x4d;
return 4;
}
# $_[0]: Chip to detect (0 = VT1211)
# $_[1]: A reference to the file descriptor to access this chip.
# We may assume an i2c_set_slave_addr was already done.