All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rini <rini@arvoo.nl>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] adt7411: set reserved bit
Date: Thu, 21 Oct 2010 13:44:41 +0000	[thread overview]
Message-ID: <20101021134441.GA10439@arv-002> (raw)

This patch set the reserved bit in cfg1 register.
This bit should be 1 at startup but it's not.

Signed-off-by: Rini <rini@arvoo.nl>
---
 drivers/hwmon/adt7411.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c
index f13c843..c516876 100644
--- a/drivers/hwmon/adt7411.c
+++ b/drivers/hwmon/adt7411.c
@@ -31,6 +31,7 @@
 
 #define ADT7411_REG_CFG1			0x18
 #define ADT7411_CFG1_START_MONITOR		(1 << 0)
+#define ADT7411_CFG1_RESERVED			(1 << 3)
 
 #define ADT7411_REG_CFG2			0x19
 #define ADT7411_CFG2_DISABLE_AVG		(1 << 5)
@@ -291,6 +292,15 @@ static int __devinit adt7411_probe(struct i2c_client *client,
 	mutex_init(&data->device_lock);
 	mutex_init(&data->update_lock);
 
+	/*
+	 * reserved bit should be 1, despite document say it's 1 at powerup
+	 * it's not. Gives bad values at input3 when 0
+	 */
+	ret = adt7411_modify_bit(client, ADT7411_REG_CFG1,
+				ADT7411_CFG1_RESERVED, 1);
+	if (ret < 0)
+		goto exit_free;
+
 	ret = adt7411_modify_bit(client, ADT7411_REG_CFG1,
 				 ADT7411_CFG1_START_MONITOR, 1);
 	if (ret < 0)
-- 
1.7.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2010-10-21 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 13:44 Rini [this message]
2010-10-21 13:54 ` [lm-sensors] [PATCH] adt7411: set reserved bit Jean Delvare

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=20101021134441.GA10439@arv-002 \
    --to=rini@arvoo.nl \
    --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.