From: aurelien@aurel32.net (Aurélien Jarno)
To: lm-sensors@vger.kernel.org
Subject: Broken DS1621 detection / ds1621 module / A7V8X
Date: Thu, 19 May 2005 06:25:31 +0000 [thread overview]
Message-ID: <20050119203306.GB19261@bode.aurel32.net> (raw)
In-Reply-To: <200501040208.12906.p.henning@fh-karlsruhe.de>
Hi all,
After some discussion on IRC with Jean Delvare, here is the final patch
for the 2.4 driver. The 2.6 patch has already been sent to Greg KH in
an other mail.
Bye,
Aurelien
--
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73
: :' : Debian GNU/Linux developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
Index: kernel/chips/ds1621.c
=================================RCS file: /home/cvs/lm_sensors2/kernel/chips/ds1621.c,v
retrieving revision 1.16
diff -u -1 -b -p -r1.16 ds1621.c
--- kernel/chips/ds1621.c 4 Dec 2004 21:18:34 -0000 1.16
+++ kernel/chips/ds1621.c 19 Jan 2005 20:22:41 -0000
@@ -45,5 +45,4 @@ SENSORS_INSMOD_1(ds1621);
/* 7 6 5 4 3 2 1 0 */
-/* |Done|THF |TLF |NVB | 1 | 0 |POL |1SHOT| */
-#define DS1621_REG_CONFIG_MASK 0x0C
-#define DS1621_REG_CONFIG_VAL 0x08
+/* |Done|THF |TLF |NVB | X | X |POL |1SHOT| */
+#define DS1621_REG_CONFIG_NVB 0x10
#define DS1621_REG_CONFIG_POLARITY 0x02
@@ -167,3 +166,3 @@ int ds1621_detect(struct i2c_adapter *ad
{
- int i, conf;
+ int i, conf, temp;
struct i2c_client *new_client;
@@ -205,7 +204,22 @@ int ds1621_detect(struct i2c_adapter *ad
if (kind < 0) {
+ /* The NVB bit should be low if no EEPROM write has been
+ requested during the latest 10ms, which is highly
+ improbable in our case. */
conf = i2c_smbus_read_byte_data(new_client,
DS1621_REG_CONF);
- if ((conf & DS1621_REG_CONFIG_MASK)
- != DS1621_REG_CONFIG_VAL)
+ if (conf & DS1621_REG_CONFIG_NVB)
goto ERROR1;
+ /* The 7 lowest bits of a temperature should always be 0. */
+ temp = ds1621_read_value(new_client,
+ DS1621_REG_TEMP);
+ if (temp & 0x007f)
+ goto exit_free;
+ temp = ds1621_read_value(new_client,
+ DS1621_REG_TEMP_MIN);
+ if (temp & 0x007f)
+ goto exit_free;
+ temp = ds1621_read_value(new_client,
+ DS1621_REG_TEMP_MAX);
+ if (temp & 0x007f)
+ goto exit_free;
}
next prev parent reply other threads:[~2005-05-19 6:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 6:25 Broken DS1621 detection / ds1621 module / A7V8X Prof. Dr. Peter A. Henning
2005-05-19 6:25 ` Aurelien Jarno
2005-05-19 6:25 ` Prof. Dr. Peter A. Henning
2005-05-19 6:25 ` Aurélien Jarno [this message]
2005-05-19 6:25 ` Aurélien Jarno
2005-05-19 6:25 ` Aurélien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050119203306.GB19261@bode.aurel32.net \
--to=aurelien@aurel32.net \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.