iio: adc: ad7124: Shift to dynamic allocation for channel configuration
authorMircea Caprioru <mircea.caprioru@analog.com>
Tue, 25 Jun 2019 08:11:26 +0000 (11:11 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 26 Jun 2019 20:24:21 +0000 (21:24 +0100)
commit1478a388f4baaa6da4767a0d7cf82a47826b9fc0
tree85ba5b41c620765b9f79d9aa3d956fffcf484911
parent0eaecea6e4878abbf1d3e8de3e4eeabc856133d4
iio: adc: ad7124: Shift to dynamic allocation for channel configuration

This patch changes the channel configuration member of the device
structure from a fixed size array to a dynamic allocated one with a size
equal to the number of channels specified in the device tree. This will
ensure a more flexibility for compatible devices.

Ex. ad7124-4 - can have 4 differential or 8 pseudo-differential channels
ad7124-8 - can have 8 differential or 16 pseudo-differential channels

Also the device can suspport any other combination of differential and
pseudo-differential channels base on the physical number of inputs
available.

Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7124.c