Lines Matching full:vref
69 struct regulator *vref; member
193 if (adc->vref) { in mcp3911_read_raw()
194 ret = regulator_get_voltage(adc->vref); in mcp3911_read_raw()
197 "failed to get vref voltage: %d\n", in mcp3911_read_raw()
209 * Raw = ((Voltage)/(Vref) * 2^23 * Gain * 1.5 in mcp3911_read_raw()
210 * Voltage = Raw * (Vref)/(2^23 * Gain * 1.5) in mcp3911_read_raw()
369 if (adc->vref) { in mcp3911_config()
403 static void mcp3911_cleanup_regulator(void *vref) in mcp3911_cleanup_regulator() argument
405 regulator_disable(vref); in mcp3911_cleanup_regulator()
438 adc->vref = devm_regulator_get_optional(&adc->spi->dev, "vref"); in mcp3911_probe()
439 if (IS_ERR(adc->vref)) { in mcp3911_probe()
440 if (PTR_ERR(adc->vref) == -ENODEV) { in mcp3911_probe()
441 adc->vref = NULL; in mcp3911_probe()
445 PTR_ERR(adc->vref)); in mcp3911_probe()
446 return PTR_ERR(adc->vref); in mcp3911_probe()
450 ret = regulator_enable(adc->vref); in mcp3911_probe()
455 mcp3911_cleanup_regulator, adc->vref); in mcp3911_probe()