Lines Matching +full:adc +full:- +full:vref

1 // SPDX-License-Identifier: GPL-2.0
3 * Maxim MAX11205 16-Bit Delta-Sigma ADC
5 * Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX1240-max11205.pdf
16 #include <linux/iio/adc/ad_sigma_delta.h>
34 struct regulator *vref; member
53 reg_mv = regulator_get_voltage(st->vref); in max11205_read_raw()
61 *val = st->chip_info->out_data_rate; in max11205_read_raw()
64 return -EINVAL; in max11205_read_raw()
111 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); in max11205_probe()
113 return -ENOMEM; in max11205_probe()
117 ad_sd_init(&st->sd, indio_dev, spi, &max11205_sigma_delta_info); in max11205_probe()
119 st->chip_info = spi_get_device_match_data(spi); in max11205_probe()
121 indio_dev->name = st->chip_info->name; in max11205_probe()
122 indio_dev->modes = INDIO_DIRECT_MODE; in max11205_probe()
123 indio_dev->channels = max11205_channels; in max11205_probe()
124 indio_dev->num_channels = 1; in max11205_probe()
125 indio_dev->info = &max11205_iio_info; in max11205_probe()
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()
130 "Failed to get vref regulator\n"); 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()
140 ret = devm_ad_sd_setup_buffer_and_trigger(&spi->dev, indio_dev); in max11205_probe()
144 return devm_iio_device_register(&spi->dev, indio_dev); in max11205_probe()
178 MODULE_DESCRIPTION("MAX11205 ADC driver");