iio: adc: ad7091r: Move generic AD7091R code to base driver and header file
authorMarcelo Schmitt <marcelo.schmitt@analog.com>
Tue, 19 Dec 2023 20:27:04 +0000 (17:27 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 26 Dec 2023 15:40:41 +0000 (15:40 +0000)
commit5b035ed0a5b4857f8e0dc1328dd66e930ea6eedc
treed9ac1a66a64a25f81fa9140161abda59309b3917
parente71c5c89bcb165a02df35325aa13d1ee40112401
iio: adc: ad7091r: Move generic AD7091R code to base driver and header file

Some code generic to AD7091R devices such as channel definitions were in
the AD7091R-5 driver. There was also some generic register definitions
declared in the base driver which would make more sense to be in the
header file.
The device state struct will be needed for the ad7091r8 driver in a
follow up patch so that ought to be moved to the header file as well.
Lastly, a couple of regmap callback functions are also capable of
abstracting characteristics of different AD7091R devices and those are
now being exported to IIO_AD7091R name space.

Move AD7091R generic code either to the base driver or to the header
file so both the ad7091r5 and the ad7091r8 driver can use those
declaration in follow up patches.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Link: https://lore.kernel.org/r/6376fc523ee503d47ec499e2cd2ef13bfb5fd8ba.1703013352.git.marcelo.schmitt1@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7091r-base.c
drivers/iio/adc/ad7091r-base.h
drivers/iio/adc/ad7091r5.c