• Stefan Popa's avatar
    iio: adc: ad7606: Move oversampling options in chip info and rework *_avail attributes · 6bf229ab
    Stefan Popa authored
    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: default avatarStefan Popa <stefan.popa@analog.com>
    Signed-off-by: default avatarBeniamin Bia <beniamin.bia@analog.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    6bf229ab
ad7606.c 14.8 KB