From 47ed2c0ffdea5061d48c5c4b3fed4c8204cafcda Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 11 May 2008 20:56:25 +0000 Subject: [PATCH] Add Dallas DS1631 detection. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5249 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 e3909a46..2c13d028 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,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 3.0.1 (2008-01-28) documentation: Update the application writing guidelines diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index dd117258..d1578683 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);