diff options
author | Michael Walle <michael@walle.cc> | 2016-07-19 16:43:26 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2017-02-10 11:04:07 +0100 |
commit | 2c8c5e677787929594e6b9d5363737e9319ad1db (patch) | |
tree | 0d2f16f6c4996a3f4e85a208dbedf361d3b47f27 | |
parent | ebee2e2f308f75e2bba58f6194fa39fce4ef9529 (diff) | |
download | linux-stable-2c8c5e677787929594e6b9d5363737e9319ad1db.tar.gz linux-stable-2c8c5e677787929594e6b9d5363737e9319ad1db.tar.bz2 linux-stable-2c8c5e677787929594e6b9d5363737e9319ad1db.zip |
hwmon: (adt7411) set bit 3 in CFG1 register
commit b53893aae441a034bf4dbbad42fe218561d7d81f upstream.
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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r-- | drivers/hwmon/adt7411.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index d9299dee37d1..dddaa161aadb 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) @@ -292,8 +293,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; |