Lines Matching full:vref
154 struct regulator *vref[4]; member
422 unsigned int res, gain, full_scale, vref; in ad7124_write_raw() local
439 vref = st->channel_config[chan->address].vref_mv * 1000000LL; in ad7124_write_raw()
440 res = DIV_ROUND_CLOSEST(vref, full_scale); in ad7124_write_raw()
559 if (IS_ERR(st->vref[refsel])) { in ad7124_init_channel_vref()
563 return PTR_ERR(st->vref[refsel]); in ad7124_init_channel_vref()
566 regulator_get_voltage(st->vref[refsel]); in ad7124_init_channel_vref()
741 for (i = 0; i < ARRAY_SIZE(st->vref); i++) { in ad7124_probe()
745 st->vref[i] = devm_regulator_get_optional(&spi->dev, in ad7124_probe()
747 if (PTR_ERR(st->vref[i]) == -ENODEV) in ad7124_probe()
749 else if (IS_ERR(st->vref[i])) in ad7124_probe()
750 return PTR_ERR(st->vref[i]); in ad7124_probe()
752 ret = regulator_enable(st->vref[i]); in ad7124_probe()
796 for (i = ARRAY_SIZE(st->vref) - 1; i >= 0; i--) { in ad7124_probe()
797 if (!IS_ERR_OR_NULL(st->vref[i])) in ad7124_probe()
798 regulator_disable(st->vref[i]); in ad7124_probe()
814 for (i = ARRAY_SIZE(st->vref) - 1; i >= 0; i--) { in ad7124_remove()
815 if (!IS_ERR_OR_NULL(st->vref[i])) in ad7124_remove()
816 regulator_disable(st->vref[i]); in ad7124_remove()