From: Chris Lesiak Date: Mon, 1 Jun 2015 16:27:37 +0000 (-0500) Subject: hwmon: (ntc_thermistor) fix iio raw to microvolts conversion X-Git-Tag: omap-for-v4.3/legacy-v2-signed~189^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0315253b19bbc63eedad2f6125c21e280c76e29b;p=pandora-kernel.git 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: Chris Lesiak Signed-off-by: Guenter Roeck --- Reading git-diff-tree failed