staging: iio: cdc: ad7746: Use _raw and _scale for temperature channels.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 26 Jun 2022 12:29:31 +0000 (13:29 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:30:00 +0000 (22:30 +0100)
commit431e9147b4667d67399fe5db4f8203d55811951b
treef653af3c5f57c928791a7cd86d34b68a3672817c
parent90e7853ce051bca3690d3518e523f427e55c4806
staging: iio: cdc: ad7746: Use _raw and _scale for temperature channels.

Performing the maths to rescale a 24 bit raw reading within the driver
was resulting in precision losses.  So make that userspace's problem
by exporting the scale and letting the maths be done in userspace with
appropriate precision.  Issue identified using roadtester testing
framework.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220626122938.582107-11-jic23@kernel.org
drivers/staging/iio/cdc/ad7746.c