Commit 1229b084 authored by Michael Walle's avatar Michael Walle Committed by Greg Kroah-Hartman

hwmon: (adt7411) set bit 3 in CFG1 register

commit b53893aa 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: d84ca5b3 ("hwmon: Add driver for ADT7411 voltage and temperature sensor")
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8e8a07f9
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define ADT7411_REG_CFG1 0x18 #define ADT7411_REG_CFG1 0x18
#define ADT7411_CFG1_START_MONITOR (1 << 0) #define ADT7411_CFG1_START_MONITOR (1 << 0)
#define ADT7411_CFG1_RESERVED_BIT3 (1 << 3)
#define ADT7411_REG_CFG2 0x19 #define ADT7411_REG_CFG2 0x19
#define ADT7411_CFG2_DISABLE_AVG (1 << 5) #define ADT7411_CFG2_DISABLE_AVG (1 << 5)
...@@ -296,8 +297,10 @@ static int adt7411_probe(struct i2c_client *client, ...@@ -296,8 +297,10 @@ static int adt7411_probe(struct i2c_client *client,
mutex_init(&data->device_lock); mutex_init(&data->device_lock);
mutex_init(&data->update_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, 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) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment