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)
commit2d72ead25abb72996a7e92608224d2503a3bac9c
tree23c2a006bd3b6d05fa31ab2e5a20aee5ac3f5ee6
parent5c64990b99aa91622cf044a9a2f7a78de8f770a2
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