iio: adc: ad7173: add calibration support
authorGuillaume Ranquet <granquet@baylibre.com>
Mon, 2 Dec 2024 10:09:52 +0000 (11:09 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 11 Dec 2024 19:20:49 +0000 (19:20 +0000)
commit031bdc8aee01b7b298159eee541844d8bff4467d
treed99082bbfd5c991c368aa77af4a6213302c7c845
parentc3948d09008085993eda43d687993f79b55aacda
iio: adc: ad7173: add calibration support

The ad7173 family of chips has up to four calibration modes.

Internal zero scale: removes ADC core offset errors.
Internal full scale: removes ADC core gain errors.
System zero scale: reduces offset error to the order of channel noise.
System full scale: reduces gain error to the order of channel noise.

All voltage channels will undergo an internal zero/full scale
calibration at bootup.

System zero/full scale can be done after bootup using the newly created
iio interface 'sys_calibration' and 'sys_calibration_mode'

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
Link: https://patch.msgid.link/20241202-ad411x_calibration-v3-1-beb6aeec39e2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7173.c