]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
hwmon: (ina3221) Add INA3221_CONFIG to volatile_table
authorNicolin Chen <nicoleotsuka@gmail.com>
Sat, 29 Sep 2018 21:44:05 +0000 (14:44 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 11 Oct 2018 03:37:13 +0000 (20:37 -0700)
The MSB (15th bit) of INA3221_CONFIG is a self-clear reset bit.
So this register should be added to the volatile_table of the
regmap_config. Otherwise, we will see this bit is sticky in the
regcache which might accidentally reset the chip when an actual
write happens to the register.

This might not be a severe bug for the current code line since
there's no second place touching the INA3221_CONFIG except the
reset routine in the probe().

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina3221.c

index e6b49500c52aedc8751afd7114ed2283e505ea56..cfe65ff01051c323a9b5d348b22c7efadae2b6ea 100644 (file)
@@ -353,7 +353,7 @@ static struct attribute *ina3221_attrs[] = {
 ATTRIBUTE_GROUPS(ina3221);
 
 static const struct regmap_range ina3221_yes_ranges[] = {
-       regmap_reg_range(INA3221_SHUNT1, INA3221_BUS3),
+       regmap_reg_range(INA3221_CONFIG, INA3221_BUS3),
        regmap_reg_range(INA3221_MASK_ENABLE, INA3221_MASK_ENABLE),
 };