iio: adc: ad7091r5: Add scale and external VREF support
authorPaul Cercueil <paul.cercueil@analog.com>
Fri, 15 Nov 2019 13:57:21 +0000 (15:57 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Nov 2019 17:06:10 +0000 (17:06 +0000)
commit260442cc5be4e652628f01ea6ac58f542e2c8e7a
treeaf3b8084491889f2a8458fd5d03c4a7a1534058c
parentca69300173b642ba64118200172171ea5967b6c5
iio: adc: ad7091r5: Add scale and external VREF support

The scale can now be obtained with the "in_voltage_scale" file.
By default, the scale returned corresponds to the internal VREF of 2.5V.

It is possible to use an external VREF (through the REFIN/REFOUT pin of
the chip), by passing a regulator to the driver. The scale will then be
calculated according to the voltage reported by the regulator.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Co-developed-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7091r-base.c
drivers/iio/adc/ad7091r-base.h
drivers/iio/adc/ad7091r5.c