summaryrefslogtreecommitdiff
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2021-03-08 11:02:19 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-25 19:13:51 +0000
commit4f2d9cced4c1ccda7ca0c888892954361c8a397e (patch)
tree37ec102b1f2aa8d1e1ac4df94b541eb1bfff360f /drivers/iio/industrialio-buffer.c
parent635ef601b2387c3215252c9931786524d122c0e7 (diff)
hwmon: (ntc_thermistor): try reading processed
Before trying the custom method of reading the sensor as raw and then converting, we want to use iio_read_channel_processed_scale() which first tries to see if the ADC can provide a processed value directly, else reads raw and applies scaling inside of IIO using the scale attributes of the ADC. We need to multiply the scaled value with 1000 to get to microvolts from millivolts which is what processed IIO channels returns. Keep the code that assumes 12bit ADC around as a fallback. This gives correct readings on the AB8500 thermistor inputs used in the Ux500 HREFP520 platform for reading battery and board temperature. Cc: Peter Rosin <peda@axentia.se> Cc: Chris Lesiak <chris.lesiak@licor.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: linux-iio@vger.kernel.org Link: https://lore.kernel.org/linux-iio/20201224011607.1059534-1-linus.walleij@linaro.org/ Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Chris Lesiak <chris.lesiak@licor.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210308100219.2732156-2-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
0 files changed, 0 insertions, 0 deletions