OSDN Git Service

iio: adc: ad7606: Move oversampling options in chip info and rework *_avail attributes
authorStefan Popa <stefan.popa@analog.com>
Tue, 2 Apr 2019 13:18:39 +0000 (16:18 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Apr 2019 12:22:29 +0000 (13:22 +0100)
commit6bf229abce7528bcf70c62d913eeabfc770ee72c
treee7498b3a6f01330be9e66f3005ea9770653a6818
parent9044b6e25e2fba8c5586f958da6ff89582d06a3d
iio: adc: ad7606: Move oversampling options in chip info and rework *_avail attributes

Available oversampling ratios and scales can be shown by calling a
common ad7606_show_avail function which takes as parameters the array
which stores the values, together with the size of the array.

Oversampling options are now defined in chip info
structure and they are loaded at probe.

Has_Oversampling attribute was removed because oversampling_num was added
and it is not needed anymore.

The purpose of this patch is to deal with the scale_avail and
oversampling_avail arrays in a generic way. This makes it easier to add
support for new devices which will work with different scales and
oversampling ratios. It is also an intermediate step for adding support
for ad7616 which has different oversampling sampling ratios available.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7606.c
drivers/iio/adc/ad7606.h