From ec19dbfa3f8499806c7939aa6725afe2d9f04815 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 26 May 2004 19:04:44 +0000 Subject: [PATCH] Refine MAX6650/MAX6651 detection. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2566 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 772b23a7..57a4c7a6 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -4284,14 +4284,20 @@ sub w83l785ts_detect # alarm enable register (0x08) - top 3 bits # alarm status register (0x0A) - top 3 bits # tachometer count time register (0x16) - top 6 bits +# Additionally, not all values are possible for lower 3 bits of +# the configuration register. sub max6650_detect { my ($chip, $file) = @_; + + my $conf = i2c_smbus_read_byte_data($file,0x02); + return if i2c_smbus_read_byte_data($file,0x16) & 0xFC; return if i2c_smbus_read_byte_data($file,0x0A) & 0xE0; return if i2c_smbus_read_byte_data($file,0x08) & 0xE0; return if i2c_smbus_read_byte_data($file,0x14) & 0xE0; - return if i2c_smbus_read_byte_data($file,0x02) & 0xC0; + return if ($conf & 0xC0) or ($conf & 0x07) > 4; + return 4; }