Skip to content
Commit 0315253b authored by Chris Lesiak's avatar Chris Lesiak Committed by Guenter Roeck
Browse files

hwmon: (ntc_thermistor) fix iio raw to microvolts conversion



The function ntc_adc_iio_read was assuming both a 12 bit ADC and that
pullup_uv is the same as the ADC reference voltage.  If either
assumption is false, then the result is incorrect.

Attempt to use iio_convert_raw_to_processed to convert the raw value to
microvolts.  It will fail for iio channels that don't support support
IIO_CHAN_INFO_SCALE; in that case fall back to the assumptions.

Signed-off-by: default avatarChris Lesiak <chris.lesiak@licor.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent e892b75f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment