Home
last modified time | relevance | path

Searched refs:vref (Results 1 – 25 of 252) sorted by relevance

1234567891011

/linux/drivers/iio/adc/
H A Dsd_adc_modulator.c31 struct regulator *vref; member
39 if (priv->vref) in iio_sd_mod_enable()
40 return regulator_enable(priv->vref); in iio_sd_mod_enable()
49 if (priv->vref) in iio_sd_mod_disable()
50 regulator_disable(priv->vref); in iio_sd_mod_disable()
106 struct regulator *vref; in iio_sd_mod_probe() local
122 vref = devm_regulator_get_optional(dev, "vref"); in iio_sd_mod_probe()
123 if (IS_ERR(vref)) { in iio_sd_mod_probe()
124 if (PTR_ERR(vref) != -ENODEV) in iio_sd_mod_probe()
125 return dev_err_probe(dev, PTR_ERR(vref), "Failed to get vref\n"); in iio_sd_mod_probe()
[all …]
H A Dlpc18xx_adc.c42 struct regulator *vref; member
104 *val = regulator_get_voltage(adc->vref) / 1000; in lpc18xx_adc_read_raw()
124 static void lpc18xx_regulator_disable(void *vref) in lpc18xx_regulator_disable() argument
126 regulator_disable(vref); in lpc18xx_regulator_disable()
154 adc->vref = devm_regulator_get(&pdev->dev, "vref"); in lpc18xx_adc_probe()
155 if (IS_ERR(adc->vref)) in lpc18xx_adc_probe()
156 return dev_err_probe(&pdev->dev, PTR_ERR(adc->vref), in lpc18xx_adc_probe()
165 ret = regulator_enable(adc->vref); in lpc18xx_adc_probe()
171 ret = devm_add_action_or_reset(&pdev->dev, lpc18xx_regulator_disable, adc->vref); in lpc18xx_adc_probe()
H A Dmax11205.c34 struct regulator *vref; member
53 reg_mv = regulator_get_voltage(st->vref); in max11205_read_raw()
127 st->vref = devm_regulator_get(&spi->dev, "vref"); in max11205_probe()
128 if (IS_ERR(st->vref)) in max11205_probe()
129 return dev_err_probe(&spi->dev, PTR_ERR(st->vref), in max11205_probe()
132 ret = regulator_enable(st->vref); in max11205_probe()
136 ret = devm_add_action_or_reset(&spi->dev, max11205_reg_disable, st->vref); in max11205_probe()
H A Dmax1241.c25 struct regulator *vref; member
94 vref_uV = regulator_get_voltage(adc->vref); in max1241_read_raw()
118 err = regulator_disable(adc->vref); in max1241_disable_vref_action()
143 adc->vref = devm_regulator_get(dev, "vref"); in max1241_probe()
144 if (IS_ERR(adc->vref)) in max1241_probe()
145 return dev_err_probe(dev, PTR_ERR(adc->vref), in max1241_probe()
148 ret = regulator_enable(adc->vref); in max1241_probe()
H A Dad7949.c82 struct regulator *vref; member
239 ret = regulator_get_voltage(ad7949_adc->vref); in ad7949_spi_read_raw()
368 ad7949_adc->vref = devm_regulator_get_optional(dev, "vrefin"); in ad7949_spi_probe()
369 if (IS_ERR(ad7949_adc->vref)) { in ad7949_spi_probe()
370 ret = PTR_ERR(ad7949_adc->vref); in ad7949_spi_probe()
374 ad7949_adc->vref = devm_regulator_get_optional(dev, "vref"); in ad7949_spi_probe()
375 if (IS_ERR(ad7949_adc->vref)) { in ad7949_spi_probe()
376 ret = PTR_ERR(ad7949_adc->vref); in ad7949_spi_probe()
387 ret = regulator_enable(ad7949_adc->vref); in ad7949_spi_probe()
394 ad7949_adc->vref); in ad7949_spi_probe()
H A Dfsl-imx25-gcq.c42 struct regulator *vref[4]; member
181 if (priv->vref[refp]) in mx25_gcq_ext_regulator_setup()
189 priv->vref[refp] = devm_regulator_get_optional(dev, reg_name); in mx25_gcq_ext_regulator_setup()
190 if (IS_ERR(priv->vref[refp])) in mx25_gcq_ext_regulator_setup()
191 return dev_err_probe(dev, PTR_ERR(priv->vref[refp]), in mx25_gcq_ext_regulator_setup()
242 regulator_get_voltage(priv->vref[refp]); in mx25_gcq_setup_cfgs()
328 if (!priv->vref[i]) in mx25_gcq_probe()
331 ret = regulator_enable(priv->vref[i]); in mx25_gcq_probe()
336 priv->vref[i]); in mx25_gcq_probe()
H A Dad7091r-base.c104 if (st->vref) { in ad7091r_read_raw()
105 ret = regulator_get_voltage(st->vref); in ad7091r_read_raw()
293 regulator_disable(st->vref); in ad7091r_remove()
345 st->vref = devm_regulator_get_optional(dev, "vref"); in ad7091r_probe()
346 if (IS_ERR(st->vref)) { in ad7091r_probe()
347 if (PTR_ERR(st->vref) == -EPROBE_DEFER) in ad7091r_probe()
350 st->vref = NULL; in ad7091r_probe()
358 ret = regulator_enable(st->vref); in ad7091r_probe()
H A Dti-tlc4541.c112 int vref; in tlc4541_get_range() local
114 vref = regulator_get_voltage(st->reg); in tlc4541_get_range()
115 if (vref < 0) in tlc4541_get_range()
116 return vref; in tlc4541_get_range()
118 vref /= 1000; in tlc4541_get_range()
120 return vref; in tlc4541_get_range()
H A Drockchip_saradc.c73 struct regulator *vref; member
352 regulator_disable(info->vref); in rockchip_saradc_regulator_disable()
411 regulator_unregister_notifier(info->vref, &info->nb); in rockchip_saradc_regulator_unreg_notifier()
473 info->vref = devm_regulator_get(&pdev->dev, "vref"); in rockchip_saradc_probe()
474 if (IS_ERR(info->vref)) in rockchip_saradc_probe()
475 return dev_err_probe(&pdev->dev, PTR_ERR(info->vref), in rockchip_saradc_probe()
490 ret = regulator_enable(info->vref); in rockchip_saradc_probe()
501 ret = regulator_get_voltage(info->vref); in rockchip_saradc_probe()
532 ret = regulator_register_notifier(info->vref, &info->nb); in rockchip_saradc_probe()
554 regulator_disable(info->vref); in rockchip_saradc_suspend()
[all …]
H A Dimx7d_adc.c119 struct regulator *vref; member
321 info->vref_uv = regulator_get_voltage(info->vref); in imx7d_adc_read_raw()
437 ret = regulator_enable(info->vref); in imx7d_adc_enable()
449 regulator_disable(info->vref); in imx7d_adc_enable()
466 regulator_disable(info->vref); in imx7d_adc_disable()
505 info->vref = devm_regulator_get(dev, "vref"); in imx7d_adc_probe()
506 if (IS_ERR(info->vref)) in imx7d_adc_probe()
507 return dev_err_probe(dev, PTR_ERR(info->vref), in imx7d_adc_probe()
H A Dad7124.c175 struct regulator *vref[4]; member
371 if (IS_ERR(st->vref[refsel])) { in ad7124_init_config_vref()
375 return PTR_ERR(st->vref[refsel]); in ad7124_init_config_vref()
377 cfg->vref_mv = regulator_get_voltage(st->vref[refsel]); in ad7124_init_config_vref()
633 unsigned int res, gain, full_scale, vref; in ad7124_write_raw() local
658 vref = st->channels[chan->address].cfg.vref_mv * 1000000LL; in ad7124_write_raw()
659 res = DIV_ROUND_CLOSEST(vref, full_scale); in ad7124_write_raw()
965 for (i = 0; i < ARRAY_SIZE(st->vref); i++) { in ad7124_probe()
969 st->vref[i] = devm_regulator_get_optional(&spi->dev, in ad7124_probe()
971 if (PTR_ERR(st->vref[i]) == -ENODEV) in ad7124_probe()
[all …]
H A Dlpc32xx_adc.c52 struct regulator *vref; member
91 *val = regulator_get_voltage(st->vref) / 1000; in lpc32xx_read_raw()
189 st->vref = devm_regulator_get(&pdev->dev, "vref"); in lpc32xx_adc_probe()
190 if (IS_ERR(st->vref)) { in lpc32xx_adc_probe()
H A Dad7298.c211 int vref; in ad7298_get_ref_voltage() local
214 vref = regulator_get_voltage(st->reg); in ad7298_get_ref_voltage()
215 if (vref < 0) in ad7298_get_ref_voltage()
216 return vref; in ad7298_get_ref_voltage()
218 return vref / 1000; in ad7298_get_ref_voltage()
H A Dti-ads7950.c349 int vref; in ti_ads7950_get_range() local
352 vref = st->vref_mv; in ti_ads7950_get_range()
354 vref = regulator_get_voltage(st->reg); in ti_ads7950_get_range()
355 if (vref < 0) in ti_ads7950_get_range()
356 return vref; in ti_ads7950_get_range()
358 vref /= 1000; in ti_ads7950_get_range()
362 vref *= 2; in ti_ads7950_get_range()
364 return vref; in ti_ads7950_get_range()
H A Dad7768-1.c156 struct regulator *vref; member
383 scale_uv = regulator_get_voltage(st->vref); in ad7768_read_raw()
539 regulator_disable(st->vref); in ad7768_regulator_disable()
579 st->vref = devm_regulator_get(&spi->dev, "vref"); in ad7768_probe()
580 if (IS_ERR(st->vref)) in ad7768_probe()
581 return PTR_ERR(st->vref); in ad7768_probe()
583 ret = regulator_enable(st->vref); in ad7768_probe()
/linux/drivers/iio/dac/
H A Dti-dac7311.c49 struct regulator *vref; member
179 ret = regulator_get_voltage(ti_dac->vref); in ti_dac_read_raw()
270 ti_dac->vref = devm_regulator_get(dev, "vref"); in ti_dac_probe()
271 if (IS_ERR(ti_dac->vref)) in ti_dac_probe()
272 return dev_err_probe(dev, PTR_ERR(ti_dac->vref), in ti_dac_probe()
275 ret = regulator_enable(ti_dac->vref); in ti_dac_probe()
293 regulator_disable(ti_dac->vref); in ti_dac_probe()
304 regulator_disable(ti_dac->vref); in ti_dac_remove()
H A Dti-dac082s085.c51 struct regulator *vref; member
200 ret = regulator_get_voltage(ti_dac->vref); in ti_dac_read_raw()
288 ti_dac->vref = devm_regulator_get(dev, "vref"); in ti_dac_probe()
289 if (IS_ERR(ti_dac->vref)) in ti_dac_probe()
290 return PTR_ERR(ti_dac->vref); in ti_dac_probe()
292 ret = regulator_enable(ti_dac->vref); in ti_dac_probe()
312 regulator_disable(ti_dac->vref); in ti_dac_probe()
323 regulator_disable(ti_dac->vref); in ti_dac_remove()
H A Dad3552r-common.c54 s64 vref, tmp, common, offset, gn, gp; in ad3552r_get_custom_range() local
61 vref = 2500; in ad3552r_get_custom_range()
69 *v_max = vref + tmp; in ad3552r_get_custom_range()
74 *v_min = vref - tmp; in ad3552r_get_custom_range()
H A Dad5764.c226 int vref; in ad5764_read_raw() local
253 vref = ad5764_get_channel_vref(st, chan->channel); in ad5764_read_raw()
254 if (vref < 0) in ad5764_read_raw()
255 return vref; in ad5764_read_raw()
257 *val = vref * 4 / 1000; in ad5764_read_raw()
/linux/drivers/hwmon/
H A Dadc128d818.c61 int vref; /* Reference voltage in mV */ member
157 val = DIV_ROUND_CLOSEST(data->in[index][nr] * data->vref, 4095); in adc128_in_show()
435 int err, vref; in adc128_probe() local
442 vref = devm_regulator_get_enable_read_voltage(dev, "vref"); in adc128_probe()
443 if (vref == -ENODEV) { in adc128_probe()
445 data->vref = 2560; /* 2.56V, in mV */ in adc128_probe()
446 } else if (vref < 0) { in adc128_probe()
447 return vref; in adc128_probe()
450 data->vref = DIV_ROUND_CLOSEST(vref, 1000); in adc128_probe()
/linux/drivers/input/touchscreen/
H A Dads7846.c185 #define READ_12BIT_DFR(x, adc, vref) (ADS_START | ADS_A2A1A0_d_ ## x \ argument
187 (adc ? ADS_PD10_ADC_ON : 0) | (vref ? ADS_PD10_REF_ON : 0))
189 #define READ_Y(vref) (READ_12BIT_DFR(y, 1, vref)) argument
190 #define READ_Z1(vref) (READ_12BIT_DFR(z1, 1, vref)) argument
191 #define READ_Z2(vref) (READ_12BIT_DFR(z2, 1, vref)) argument
192 #define READ_X(vref) (READ_12BIT_DFR(x, 1, vref)) argument
728 static u8 ads7846_get_cmd(enum ads7846_cmds cmd_idx, int vref) in ads7846_get_cmd() argument
732 return READ_Y(vref); in ads7846_get_cmd()
734 return READ_X(vref); in ads7846_get_cmd()
738 return READ_Z1(vref); in ads7846_get_cmd()
[all …]
/linux/arch/arm64/boot/dts/freescale/
H A Dimx8mq-nitrogen.dts61 reg_vref_0v9: regulator-vref-0v9 {
63 regulator-name = "vref-0v9";
68 reg_vref_1v8: regulator-vref-1v8 {
70 regulator-name = "vref-1v8";
75 reg_vref_2v5: regulator-vref-2v5 {
77 regulator-name = "vref-2v5";
82 reg_vref_3v3: regulator-vref-3v3 {
84 regulator-name = "vref-3v3";
89 reg_vref_5v: regulator-vref-5v {
91 regulator-name = "vref-5v";
/linux/drivers/iio/pressure/
H A Dzpa2326.c133 struct regulator *vref; member
336 err = regulator_enable(private->vref); in zpa2326_power_on()
342 goto vref; in zpa2326_power_on()
360 vref: in zpa2326_power_on()
361 regulator_disable(private->vref); in zpa2326_power_on()
380 regulator_disable(private->vref); in zpa2326_power_off()
1624 priv->vref = devm_regulator_get(parent, "vref"); in zpa2326_probe()
1625 if (IS_ERR(priv->vref)) in zpa2326_probe()
1626 return PTR_ERR(priv->vref); in zpa2326_probe()
/linux/Documentation/devicetree/bindings/staging/iio/adc/
H A Dspear-adc.txt10 - vref-external: External voltage reference in milli-volts. If omitted
23 vref-external = <2500>; /* 2.5V VRef */
/linux/arch/arm/boot/dts/st/
H A Dstm32429i-eval.dts92 vref: regulator-vref { label
94 regulator-name = "vref";
168 vref-supply = <&vref>;

1234567891011