]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9e2cf0d7701c1a54a283cdaf58e15f69951b3e16
treef653af3c5f57c928791a7cd86d34b68a3672817c
parente68d5357786e2c7be7a2a466fa09737313088791
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