Lines Matching refs:regval
198 static int ina2xx_read_reg(struct device *dev, int reg, unsigned int *regval) in ina2xx_read_reg() argument
207 ret = regmap_read(data->regmap, reg, regval); in ina2xx_read_reg()
211 dev_dbg(dev, "read %d, val = 0x%04x\n", reg, *regval); in ina2xx_read_reg()
221 if (*regval == 0) { in ina2xx_read_reg()
257 unsigned int regval) in ina2xx_get_value() argument
264 val = DIV_ROUND_CLOSEST((s16)regval, data->config->shunt_div); in ina2xx_get_value()
267 val = (regval >> data->config->bus_voltage_shift) in ina2xx_get_value()
272 val = regval * data->power_lsb_uW; in ina2xx_get_value()
276 val = regval * data->current_lsb_uA; in ina2xx_get_value()
280 val = regval; in ina2xx_get_value()
297 unsigned int regval; in ina2xx_show_value() local
299 int err = ina2xx_read_reg(dev, attr->index, ®val); in ina2xx_show_value()
305 ina2xx_get_value(data, attr->index, regval)); in ina2xx_show_value()
378 unsigned int regval; in ina226_show_interval() local
380 status = regmap_read(data->regmap, INA2XX_CONFIG, ®val); in ina226_show_interval()
384 return snprintf(buf, PAGE_SIZE, "%d\n", ina226_reg_to_interval(regval)); in ina226_show_interval()