Lines Matching refs:adc

71 	struct max1118 *adc = iio_priv(indio_dev);  in max1118_read()  local
98 .rx_buf = &adc->data, in max1118_read()
105 ret = spi_sync_transfer(adc->spi, xfers + 1, 2); in max1118_read()
107 ret = spi_sync_transfer(adc->spi, xfers, 3); in max1118_read()
112 return adc->data; in max1118_read()
117 struct max1118 *adc = iio_priv(indio_dev); in max1118_get_vref_mV() local
118 const struct spi_device_id *id = spi_get_device_id(adc->spi); in max1118_get_vref_mV()
127 vref_uV = regulator_get_voltage(adc->reg); in max1118_get_vref_mV()
140 struct max1118 *adc = iio_priv(indio_dev); in max1118_read_raw() local
144 mutex_lock(&adc->lock); in max1118_read_raw()
146 mutex_unlock(&adc->lock); in max1118_read_raw()
171 struct max1118 *adc = iio_priv(indio_dev); in max1118_trigger_handler() local
175 mutex_lock(&adc->lock); in max1118_trigger_handler()
183 dev_warn(&adc->spi->dev, in max1118_trigger_handler()
188 adc->scan.channels[i] = ret; in max1118_trigger_handler()
191 iio_push_to_buffers_with_timestamp(indio_dev, &adc->scan, in max1118_trigger_handler()
194 mutex_unlock(&adc->lock); in max1118_trigger_handler()
209 struct max1118 *adc; in max1118_probe() local
213 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc)); in max1118_probe()
217 adc = iio_priv(indio_dev); in max1118_probe()
218 adc->spi = spi; in max1118_probe()
219 mutex_init(&adc->lock); in max1118_probe()
222 adc->reg = devm_regulator_get(&spi->dev, "vref"); in max1118_probe()
223 if (IS_ERR(adc->reg)) in max1118_probe()
224 return dev_err_probe(&spi->dev, PTR_ERR(adc->reg), in max1118_probe()
226 ret = regulator_enable(adc->reg); in max1118_probe()
231 adc->reg); in max1118_probe()