staging: iio: ad7606: implement IIO_CHAN_INFO_OVERSAMPLING_RATIO
authorEva Rachel Retuya <eraretuya@gmail.com>
Sat, 8 Oct 2016 16:05:40 +0000 (00:05 +0800)
committerJonathan Cameron <jic23@kernel.org>
Sat, 8 Oct 2016 16:44:32 +0000 (17:44 +0100)
commit4a5936dac5aac2b8a01d861281c0d9fa05251cac
tree4d3bd8db10ebad97c1f2a55c1d471c2056354b37
parentb321a38d2407c7e425c54bc09be909a34e49f740
staging: iio: ad7606: implement IIO_CHAN_INFO_OVERSAMPLING_RATIO

This driver predates the availability of IIO_CHAN_INFO_OVERSAMPLING_RATIO
attribute wherein usage has some advantages like it can be accessed by
in-kernel consumers as well as reduces the code size.

Therefore, use IIO_CHAN_INFO_OVERSAMPLING_RATIO to implement the
oversampling_ratio attribute instead of using IIO_DEVICE_ATTR() macro.

Move code from the functions associated with IIO_DEVICE_ATTR() into
the read_raw hook as well as add the write_raw hook with both masks set
to IIO_CHAN_INFO_OVERSAMPLING_RATIO.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7606_core.c