iio: adc: at91-sama5d2_adc: convert to platform specific data structures
authorEugen Hristev <eugen.hristev@microchip.com>
Wed, 1 Sep 2021 12:30:07 +0000 (15:30 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 14 Sep 2021 11:00:34 +0000 (12:00 +0100)
commit8940de2e48902e95b588b6244d5a1b61a4d75c4a
treedba4811fb45046a9afd780f8a33e4ea0dd18dec3
parent841a5b651815aba221cc003b0457dfc201a8a0c1
iio: adc: at91-sama5d2_adc: convert to platform specific data structures

Convert the driver to platform specific structures. This means:
- create a register layout struct that will hold offsets for registers
- create a platform struct that will hold platform information (number of
channels, indexes for different channels and pointer to layout struct)
- convert specific macros that are platform dependent into platform variables

This step is in fact a no-op, but allows the driver to be more flexible
and for future enhancement including adding new platforms that are partly
compatible with the current driver and differ slightly in register layout
or capabilities for example.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lore.kernel.org/r/20210901123013.329792-5-eugen.hristev@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c