]> git.baikalelectronics.ru Git - kernel.git/commit
staging: iio: cdc: ad7746: Switch from _offset to _zeropoint for differential channels.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 26 Jun 2022 12:29:33 +0000 (13:29 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:30:01 +0000 (22:30 +0100)
commit6b310c0edde6aa58e3f2ea3bb38f8a32175ec263
tree23c2a006bd3b6d05fa31ab2e5a20aee5ac3f5ee6
parentbd04a9d57578e839305ef6f7656f3683a5220cdf
staging: iio: cdc: ad7746: Switch from _offset to _zeropoint for differential channels.

As this offset is applied equally to both lines of the differential
pair, _ofset should not be used. Use the new ABI _zeropoint instead
to avoid userspace software applying this value when calculating
real value = (_raw + _offset) * _scale

Also add a comment to explain why an offset of 0x800000 is applied
within the driver rather than exposed to userspace.

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-13-jic23@kernel.org
drivers/staging/iio/cdc/ad7746.c