On Tue, Aug 27, 2024 at 08:34:55AM -0700, Guenter Roeck wrote: > +static int ina2xx_in_read(struct device *dev, u32 attr, int channel, long *val) > +{ > + int voltage_reg = channel ? INA2XX_BUS_VOLTAGE : INA2XX_SHUNT_VOLTAGE; > + u32 under_voltage_mask = channel ? INA226_BUS_UNDER_VOLTAGE_MASK > + : INA226_SHUNT_UNDER_VOLTAGE_MASK; > + u32 over_voltage_mask = channel ? INA226_BUS_OVER_VOLTAGE_MASK > + : INA226_SHUNT_OVER_VOLTAGE_MASK; > + struct ina2xx_data *data = dev_get_drvdata(dev); > + struct regmap *regmap = data->regmap; > + unsigned int regval; > + int ret; > + > + switch (attr) { > + case hwmon_in_input: > + ret = regmap_read(regmap, voltage_reg, ®val); > + if (ret) > + return ret; > + *val = ina2xx_get_value(data, voltage_reg, regval); Doesn't it need to call ina2xx_read_init() too? Originally, [1][2] call ina2xx_value_show() and then ina2xx_read_reg() and detect if the chip has been reset. [1]: https://elixir.bootlin.com/linux/v6.10/source/drivers/hwmon/ina2xx.c#L542 [2]: https://elixir.bootlin.com/linux/v6.10/source/drivers/hwmon/ina2xx.c#L554