mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-19 19:40:49 +00:00
Improve MAX6655/MAX6656 detection.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4306 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
3fb3c13ccd
commit
6ea2d0c7a8
1 file changed
+7
-2
@@ -5221,7 +5221,7 @@ sub max6650_detect
|
|||||||
# $_[1]: A reference to the file descriptor to access this chip.
|
# $_[1]: A reference to the file descriptor to access this chip.
|
||||||
# $_[2]: Address.
|
# $_[2]: Address.
|
||||||
#
|
#
|
||||||
# Returns: undef if not detected, 4 if detected.
|
# Returns: undef if not detected, 6 if detected.
|
||||||
sub max6655_detect
|
sub max6655_detect
|
||||||
{
|
{
|
||||||
my ($chip, $file, $addr) = @_;
|
my ($chip, $file, $addr) = @_;
|
||||||
@@ -5230,8 +5230,13 @@ sub max6655_detect
|
|||||||
return unless i2c_smbus_read_byte_data($file, 0xfe) == 0x0a;
|
return unless i2c_smbus_read_byte_data($file, 0xfe) == 0x0a;
|
||||||
# checking RDRV (Manufacturer ID)
|
# checking RDRV (Manufacturer ID)
|
||||||
return unless i2c_smbus_read_byte_data($file, 0xff) == 0x4d;
|
return unless i2c_smbus_read_byte_data($file, 0xff) == 0x4d;
|
||||||
|
# checking unused bits (conversion rate, extended temperature)
|
||||||
|
return unless i2c_smbus_read_byte_data($file, 0x04) & 0xf8;
|
||||||
|
return unless i2c_smbus_read_byte_data($file, 0x10) & 0x1f;
|
||||||
|
return unless i2c_smbus_read_byte_data($file, 0x11) & 0x1f;
|
||||||
|
return unless i2c_smbus_read_byte_data($file, 0x12) & 0x1f;
|
||||||
|
|
||||||
return 4;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
# $_[0]: Chip to detect (0 = VT1211)
|
# $_[0]: Chip to detect (0 = VT1211)
|
||||||
|
|||||||
Reference in new issue
Block a user