From 52c42c3794e40ee6f86298d096d60aacb29e2ca5 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 11 May 2008 21:01:18 +0000 Subject: [PATCH] Add Dallas DS1631 detection. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5250 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + prog/detect/sensors-detect | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 44f7fc34..477fff86 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,7 @@ SVN-HEAD Fix the parsing of I2C addresses not to scan Detect and skip 1-register-only I2C devices Avoid SMBus word transactions where possible + Add Dallas DS1631 detection 2.10.6 "Welcome Home Lina" (20080306) Library: Fix fschrc and fschmd support diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index c2559579..841e0fe3 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -910,7 +910,7 @@ use vars qw(@pci_adapters_sis5595 @pci_adapters_sis645 @pci_adapters_sis96x); i2c_detect => sub { adm9240_detect(0, @_); }, }, { - name => "Dallas Semiconductor DS1621", + name => "Dallas Semiconductor DS1621/DS1631", driver => "ds1621", i2c_addrs => [0x48..0x4f], i2c_detect => sub { ds1621_detect(@_); }, @@ -3812,7 +3812,10 @@ sub ds1621_detect return if ($slope != 0x10 || $counter > $slope); my $temp = i2c_smbus_read_word_data($file,0xAA); - return if $temp < 0 || ($temp & 0x7f00); + return if $temp < 0 || ($temp & 0x0f00); + # On the DS1631, the following two checks are too strict in theory, + # but in practice I very much doubt that anyone will set temperature + # limits not a multiple of 0.5 degrees C. my $high = i2c_smbus_read_word_data($file,0xA1); return if $high < 0 || ($high & 0x7f00); my $low = i2c_smbus_read_word_data($file,0xA2);