hwmon: ntc: fix iio raw to microvolts conversion
Guenter Roeck
AppliedQuoted 9 lines · Chris Lesiak
The function
ntc_adc_iio_readwas assuming both a 12 bit ADC and thatpullup_uvis the same as the ADC reference voltage. If either assumption is false, then the result is incorrect.Attempt to use
iio_convert_raw_to_processedto convert the raw value to microvolts. It will fail for iio channels that don't support supportIIO_CHAN_INFO_SCALE; in that case fall back to the assumptions.Signed-off-by Chris Lesiak <[email protected]>
Applied to -next.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors