iio: adc: ad7192: Correct reference voltage
authorAlisa-Dariana Roman <alisa.roman@analog.com>
Sun, 24 Sep 2023 15:21:48 +0000 (18:21 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 5 Oct 2023 17:06:46 +0000 (18:06 +0100)
commit7e7dcab620cd6d34939f615cac63fc0ef7e81c72
tree48e8b3d24d928426841fef06e34d11589cb274eb
parent7e87ab38eed09c9dec56da361d74158159ae84a3
iio: adc: ad7192: Correct reference voltage

The avdd and the reference voltage are two different sources but the
reference voltage was assigned according to the avdd supply.

Add vref regulator structure and set the reference voltage according to
the vref supply from the devicetree.

In case vref supply is missing, reference voltage is set according to
the avdd supply for compatibility with old devicetrees.

Fixes: b581f748cce0 ("staging: iio: adc: ad7192: move out of staging")
Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230924152149.41884-1-alisadariana@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7192.c