From: Guenter Roeck <linux@roeck-us.net>
To: Michael Walle <michael@walle.cc>, Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, Rini <rini@arvoo.nl>
Subject: Re: [PATCH] hwmon: adt7411: set bit 3 in CFG1 register
Date: Tue, 19 Jul 2016 18:55:22 -0700 [thread overview]
Message-ID: <578EDA0A.2060706@roeck-us.net> (raw)
In-Reply-To: <1468939406-25461-1-git-send-email-michael@walle.cc>
On 07/19/2016 07:43 AM, Michael Walle wrote:
> According to the datasheet you should only write 1 to this bit. If it is
> not set, at least AIN3 will return bad values on newer silicon revisions.
>
> Fixes: d84ca5b345c2 ("hwmon: Add driver for ADT7411 voltage and temperature sensor")
> Signed-off-by: Michael Walle <michael@walle.cc>
Applied.
Thanks,
Guenter
> ---
>
> This is v2 of the previous patch "hwmon: adt7411: add rev5 workaround".
>
> Changes since v1:
> - use adt7411_modify_bit once with a bitmask
> - change wording of the commit message and the comment. Just mention
> that the datasheet requires to set this bit on writes.
>
> drivers/hwmon/adt7411.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c
> index 827c037..a7f8869 100644
> --- a/drivers/hwmon/adt7411.c
> +++ b/drivers/hwmon/adt7411.c
> @@ -30,6 +30,7 @@
>
> #define ADT7411_REG_CFG1 0x18
> #define ADT7411_CFG1_START_MONITOR (1 << 0)
> +#define ADT7411_CFG1_RESERVED_BIT3 (1 << 3)
>
> #define ADT7411_REG_CFG2 0x19
> #define ADT7411_CFG2_DISABLE_AVG (1 << 5)
> @@ -296,8 +297,10 @@ static int adt7411_probe(struct i2c_client *client,
> mutex_init(&data->device_lock);
> mutex_init(&data->update_lock);
>
> + /* According to the datasheet, we must only write 1 to bit 3 */
> ret = adt7411_modify_bit(client, ADT7411_REG_CFG1,
> - ADT7411_CFG1_START_MONITOR, 1);
> + ADT7411_CFG1_RESERVED_BIT3
> + | ADT7411_CFG1_START_MONITOR, 1);
> if (ret < 0)
> return ret;
>
>
prev parent reply other threads:[~2016-07-20 1:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 11:52 [PATCH] hwmon: adt7411: add rev5 workaround Michael Walle
2016-07-14 20:56 ` Guenter Roeck
2016-07-14 22:24 ` Michael Walle
2016-07-14 22:37 ` Guenter Roeck
2016-07-15 9:16 ` Michael Walle
2016-07-15 13:50 ` Guenter Roeck
2016-07-19 14:43 ` [PATCH] hwmon: adt7411: set bit 3 in CFG1 register Michael Walle
2016-07-20 1:55 ` Guenter Roeck [this message]
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=578EDA0A.2060706@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=michael@walle.cc \
--cc=rini@arvoo.nl \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox