iio: adc: Add scaling support to exynos adc driver
authorJonathan Bakker <xc-racer2@live.ca>
Fri, 8 May 2020 21:14:00 +0000 (14:14 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 May 2020 16:31:12 +0000 (17:31 +0100)
commit754718a5b43c851546c3bb70e8d41bf81cb42b30
tree920da4779d768c14958b68249b5d8484b6bf9859
parent5cb1a5481cc3a1101457abd6abffc9b168bc7bb4
iio: adc: Add scaling support to exynos adc driver

Currently the driver only exposes the raw counts.  As we
have the regulator voltage and the maximum value (stored in
the data mask), we can trivially produce a scaling fraction
of voltage / max value.

This assumes that the regulator voltage is in fact the max
voltage, which appears to be the case for all mainline dts
and cross referenced with the public Exynos4412 and S5PV210
datasheets.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/exynos_adc.c